Enable power domain associated with the device when probe.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
#include <dm/util.h>
#include <linux/err.h>
#include <linux/list.h>
+#include <power-domain.h>
DECLARE_GLOBAL_DATA_PTR;
int device_probe(struct udevice *dev)
{
+ struct power_domain pd;
const struct driver *drv;
int size = 0;
int ret;
if (dev->parent && device_get_uclass_id(dev) != UCLASS_PINCTRL)
pinctrl_select_state(dev, "default");
+ if (dev->parent && device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) {
+ if (!power_domain_get(dev, &pd))
+ power_domain_on(&pd);
+ }
+
ret = uclass_pre_probe_device(dev);
if (ret)
goto fail;