MLK-21287 soc: imx: keep resource power ON if subdomain is wakeup source
authorAnson Huang <Anson.Huang@nxp.com>
Wed, 27 Mar 2019 09:23:32 +0000 (17:23 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commitdbc9abcf114bde0d7e4dd60d058a8b4abca92303
tree69b2f071406b9b8b00096b4ae168b2b0181f9250
parent038efe2377e555ed654c078e04984363ec832435
MLK-21287 soc: imx: keep resource power ON if subdomain is wakeup source

The power mode operation ONLY checks whether the resource being
powered OFF is a wakeup source, and skip power OFF operation if
it is a wakeup source, but it does NOT consider the power tree
status, if any of its children is a wakeup source, it needs to
be kept powered ON for its children's wakeup capability.

For example, on i.MX8QXP, CAN1 shares CAN0's power, if CAN1 is
enabled as wakeup source, CAN0's power needs to be ON even it
is NOT a wakeup source, this patch adds support for such scenario.

As it uses recursion, to avoid overhead during runtime power
management, introduce a variable to make sure this logic is ONLY
enabled during suspend/resume.

The generic power domain framework for handling device power
according to wakeup status does NOT consider the virtual devices,
e.g., if debug uart is enabled as wakeup source, the device wakeup
capability check for uart device returns false, ONLY the ttydev has
wakeup capability, that will cause resume_needed() return false
and uart device power will be OFF even its child device "ttydev" is
enabeld as wakeup source.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Tested-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit 459db9c5f53735f33753a7a60232784b3d09d261)
drivers/soc/imx/pm-domains.c