summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-08-01 21:57:33 -0500
committerYe Li <ye.li@nxp.com>2018-04-27 02:32:31 -0700
commit2fde20b3ddf037bf64706426763d88cdba2a7087 (patch)
tree63a1b732e7bb4684a54650826ca49b2d5bf1891c /drivers
parent68b9f562f46bbecdd11643bacc70fe3cd2e1243c (diff)
MLK-16118-3 core: Add power domain operation to device probe
When power domain driver is enabled, power on the power domain for the device be probed. Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit bf3e8ecc36ed9f84b9ad1348be48088fbe4eef55)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/device.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 940a153c58..303289bbe4 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -27,6 +27,9 @@
#include <dm/util.h>
#include <linux/err.h>
#include <linux/list.h>
+#ifdef CONFIG_POWER_DOMAIN
+#include <power-domain.h>
+#endif
DECLARE_GLOBAL_DATA_PTR;
@@ -376,6 +379,15 @@ int device_probe(struct udevice *dev)
if (dev->parent && device_get_uclass_id(dev) != UCLASS_PINCTRL)
pinctrl_select_state(dev, "default");
+#ifdef CONFIG_POWER_DOMAIN
+ if (dev->parent && device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) {
+ struct power_domain pd;
+ if (!power_domain_get(dev, &pd)) {
+ power_domain_on(&pd);
+ }
+ }
+#endif
+
ret = uclass_pre_probe_device(dev);
if (ret)
goto fail;