Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed24157e authored by Anton Vorontsov's avatar Anton Vorontsov Committed by David S. Miller
Browse files

powerpc/qe: Implement qe_alive_during_sleep() helper function



In some CPUs (i.e. MPC8569) QE shuts down completely during sleep,
drivers may want to know that to reinitialize registers and buffer
descriptors.

This patch implements qe_alive_during_sleep() helper function, so far
it just checks if MPC8569-compatible power management controller is
present, which is a sign that QE turns off during sleep.

Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e0ad2cd8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -154,6 +154,7 @@ int qe_get_snum(void);
void qe_put_snum(u8 snum);
void qe_put_snum(u8 snum);
unsigned int qe_get_num_of_risc(void);
unsigned int qe_get_num_of_risc(void);
unsigned int qe_get_num_of_snums(void);
unsigned int qe_get_num_of_snums(void);
int qe_alive_during_sleep(void);


/* we actually use cpm_muram implementation, define this for convenience */
/* we actually use cpm_muram implementation, define this for convenience */
#define qe_muram_init cpm_muram_init
#define qe_muram_init cpm_muram_init
+13 −0
Original line number Original line Diff line number Diff line
@@ -65,6 +65,19 @@ static unsigned int qe_num_of_snum;


static phys_addr_t qebase = -1;
static phys_addr_t qebase = -1;


int qe_alive_during_sleep(void)
{
	static int ret = -1;

	if (ret != -1)
		return ret;

	ret = !of_find_compatible_node(NULL, NULL, "fsl,mpc8569-pmc");

	return ret;
}
EXPORT_SYMBOL(qe_alive_during_sleep);

phys_addr_t get_qe_base(void)
phys_addr_t get_qe_base(void)
{
{
	struct device_node *qe;
	struct device_node *qe;