If a device has relevant power domain, we will check the power up
result in probing the device. If the power up is failed, the device_probe
will return failure immediately.
The only exception is the new FLAG (DM_FLAG_IGNORE_POWER_ON) is set by driver
to indicate ignore the power up result.
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit
8524ca764d8fbd05da1593abfed62bb075c50cd4)
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);
+ if (!power_domain_get(dev, &pd)) {
+ if (!(dev->driver->flags & DM_FLAG_IGNORE_POWER_ON)) {
+ ret = power_domain_on(&pd);
+ if (ret) {
+ power_domain_free(&pd);
+ goto fail;
+ }
+ }
+ }
}
ret = uclass_pre_probe_device(dev);
*/
#define DM_FLAG_OS_PREPARE (1 << 10)
+/* DM should ignore the power domain on for this driver */
+#define DM_FLAG_IGNORE_POWER_ON (1 << 11)
+
/* DM should ignore the assign default clocks for this driver */
#define DM_FLAG_IGNORE_DEFAULT_CLKS (1 << 12)