}
}
- if (!(drv->flags &
+ if (!(flags & DM_REMOVE_NO_PD) &&
+ !(drv->flags &
(DM_FLAG_DEFAULT_PD_CTRL_OFF | DM_FLAG_REMOVE_WITH_PD_ON)) &&
dev != gd->cur_serial_dev)
dev_power_domain_off(dev);
while (!list_empty(&uc->dev_head)) {
dev = list_first_entry(&uc->dev_head, struct udevice,
uclass_node);
- ret = device_remove(dev, DM_REMOVE_NORMAL);
+ ret = device_remove(dev, DM_REMOVE_NORMAL | DM_REMOVE_NO_PD);
if (ret)
return log_msg_ret("remove", ret);
ret = device_unbind(dev);
*/
enum {
/* Normal remove, remove all devices */
- DM_REMOVE_NORMAL = 1 << 0,
+ DM_REMOVE_NORMAL = 1 << 0,
/* Remove devices with active DMA */
- DM_REMOVE_ACTIVE_DMA = DM_FLAG_ACTIVE_DMA,
+ DM_REMOVE_ACTIVE_DMA = DM_FLAG_ACTIVE_DMA,
/* Remove devices which need some final OS preparation steps */
- DM_REMOVE_OS_PREPARE = DM_FLAG_OS_PREPARE,
+ DM_REMOVE_OS_PREPARE = DM_FLAG_OS_PREPARE,
/* Add more use cases here */
/* Remove devices with any active flag */
- DM_REMOVE_ACTIVE_ALL = DM_REMOVE_ACTIVE_DMA | DM_REMOVE_OS_PREPARE,
+ DM_REMOVE_ACTIVE_ALL = DM_REMOVE_ACTIVE_DMA | DM_REMOVE_OS_PREPARE,
+
+ /* Don't power down any attached power domains */
+ DM_REMOVE_NO_PD = 1 << 1,
};
/**