aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/plat-omap/omap_device.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 150112e3ffc..0f519829e79 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -1133,3 +1133,41 @@ static int __init omap_device_init(void)
1133 return 0; 1133 return 0;
1134} 1134}
1135core_initcall(omap_device_init); 1135core_initcall(omap_device_init);
1136
1137/**
1138 * omap_device_late_idle - idle devices without drivers
1139 * @dev: struct device * associated with omap_device
1140 * @data: unused
1141 *
1142 * Check the driver bound status of this device, and idle it
1143 * if there is no driver attached.
1144 */
1145static int __init omap_device_late_idle(struct device *dev, void *data)
1146{
1147 struct platform_device *pdev = to_platform_device(dev);
1148 struct omap_device *od = to_omap_device(pdev);
1149
1150 if (!od)
1151 return 0;
1152
1153 /*
1154 * If omap_device state is enabled, but has no driver bound,
1155 * idle it.
1156 */
1157 if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) {
1158 if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
1159 dev_warn(dev, "%s: enabled but no driver. Idling\n",
1160 __func__);
1161 omap_device_idle(pdev);
1162 }
1163 }
1164
1165 return 0;
1166}
1167
1168static int __init omap_device_late_init(void)
1169{
1170 bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
1171 return 0;
1172}
1173late_initcall(omap_device_late_init);