summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-08-01 21:57:33 -0500
committerJason Liu <jason.hui.liu@nxp.com>2017-11-03 02:37:05 +0800
commitbf3e8ecc36ed9f84b9ad1348be48088fbe4eef55 (patch)
treefa5638fef78ce1700c65618ac1c8a3b18a8f8e6c
parentf5fcb1903d935c2e1037b6a1fc61f1c290818727 (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>
-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 70fcfc23e0..88be0fa945 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -24,6 +24,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;
@@ -345,6 +348,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;