diff options
author | Olof Johansson <olof@lixom.net> | 2012-09-21 00:27:41 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-09-21 00:27:41 -0400 |
commit | b612a85792192b70e6497619521772c38ace758e (patch) | |
tree | 0405e78c23b600153bee5a0e19a5129ddca832f9 /arch/arm/plat-omap | |
parent | ea832c41dacbc4a5f3888d9ef7c38213914aba2a (diff) | |
parent | 3aec092eed5d8d2b19a62b0aeed3acea9471099a (diff) |
Merge branch 'next/soc' into next/multiplatform
* next/soc: (50 commits)
ARM: OMAP: AM33xx hwmod: fixup SPI after platform_data move
MAINTAINERS: add an entry for the BCM2835 ARM sub-architecture
ARM: bcm2835: instantiate console UART
ARM: bcm2835: add stub clock driver
ARM: bcm2835: add system timer
ARM: bcm2835: add interrupt controller driver
ARM: add infra-structure for BCM2835 and Raspberry Pi
ARM: tegra20: add CPU hotplug support
ARM: tegra30: add CPU hotplug support
ARM: tegra: clean up the common assembly macros into sleep.h
ARM: tegra: replace the CPU CAR access code by tegra_cpu_car_ops
ARM: tegra: introduce tegra_cpu_car_ops structures
ARM: Tegra: Add smp_twd clock for Tegra20
ARM: AM33XX: clock: Add dcan clock aliases for device-tree
ARM: OMAP2+: dpll: Add missing soc_is_am33xx() check for common functions
ARM: OMAP: omap_device: idle devices with no driver bound
ARM: OMAP: omap_device: don't attempt late suspend if no driver bound
ARM: OMAP: omap_device: keep track of driver bound status
ARM: OMAP3+: hwmod: Add AM33XX HWMOD data
ARM: OMAP2+: hwmod: Hook-up am33xx support in omap_hwmod framework
...
Change/remove conflict in arch/arm/mach-ux500/clock.c resolved.
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_device.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_hwmod.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 56 |
3 files changed, 54 insertions, 5 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index 4327b2c90c3d..e7259c0d33ec 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h | |||
@@ -60,6 +60,7 @@ extern struct dev_pm_domain omap_device_pm_domain; | |||
60 | * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM | 60 | * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM |
61 | * @_state: one of OMAP_DEVICE_STATE_* (see above) | 61 | * @_state: one of OMAP_DEVICE_STATE_* (see above) |
62 | * @flags: device flags | 62 | * @flags: device flags |
63 | * @_driver_status: one of BUS_NOTIFY_*_DRIVER from <linux/device.h> | ||
63 | * | 64 | * |
64 | * Integrates omap_hwmod data into Linux platform_device. | 65 | * Integrates omap_hwmod data into Linux platform_device. |
65 | * | 66 | * |
@@ -73,6 +74,7 @@ struct omap_device { | |||
73 | struct omap_device_pm_latency *pm_lats; | 74 | struct omap_device_pm_latency *pm_lats; |
74 | u32 dev_wakeup_lat; | 75 | u32 dev_wakeup_lat; |
75 | u32 _dev_wakeup_lat_limit; | 76 | u32 _dev_wakeup_lat_limit; |
77 | unsigned long _driver_status; | ||
76 | u8 pm_lats_cnt; | 78 | u8 pm_lats_cnt; |
77 | s8 pm_lat_level; | 79 | s8 pm_lat_level; |
78 | u8 hwmods_cnt; | 80 | u8 hwmods_cnt; |
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 5857b9cd6eb9..05330735f23f 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
@@ -659,6 +659,7 @@ extern int omap2420_hwmod_init(void); | |||
659 | extern int omap2430_hwmod_init(void); | 659 | extern int omap2430_hwmod_init(void); |
660 | extern int omap3xxx_hwmod_init(void); | 660 | extern int omap3xxx_hwmod_init(void); |
661 | extern int omap44xx_hwmod_init(void); | 661 | extern int omap44xx_hwmod_init(void); |
662 | extern int am33xx_hwmod_init(void); | ||
662 | 663 | ||
663 | extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois); | 664 | extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois); |
664 | 665 | ||
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 2dddfc4c63af..d5f617c542d3 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -388,17 +388,21 @@ static int _omap_device_notifier_call(struct notifier_block *nb, | |||
388 | unsigned long event, void *dev) | 388 | unsigned long event, void *dev) |
389 | { | 389 | { |
390 | struct platform_device *pdev = to_platform_device(dev); | 390 | struct platform_device *pdev = to_platform_device(dev); |
391 | struct omap_device *od; | ||
391 | 392 | ||
392 | switch (event) { | 393 | switch (event) { |
393 | case BUS_NOTIFY_ADD_DEVICE: | ||
394 | if (pdev->dev.of_node) | ||
395 | omap_device_build_from_dt(pdev); | ||
396 | break; | ||
397 | |||
398 | case BUS_NOTIFY_DEL_DEVICE: | 394 | case BUS_NOTIFY_DEL_DEVICE: |
399 | if (pdev->archdata.od) | 395 | if (pdev->archdata.od) |
400 | omap_device_delete(pdev->archdata.od); | 396 | omap_device_delete(pdev->archdata.od); |
401 | break; | 397 | break; |
398 | case BUS_NOTIFY_ADD_DEVICE: | ||
399 | if (pdev->dev.of_node) | ||
400 | omap_device_build_from_dt(pdev); | ||
401 | /* fall through */ | ||
402 | default: | ||
403 | od = to_omap_device(pdev); | ||
404 | if (od) | ||
405 | od->_driver_status = event; | ||
402 | } | 406 | } |
403 | 407 | ||
404 | return NOTIFY_DONE; | 408 | return NOTIFY_DONE; |
@@ -802,6 +806,10 @@ static int _od_suspend_noirq(struct device *dev) | |||
802 | struct omap_device *od = to_omap_device(pdev); | 806 | struct omap_device *od = to_omap_device(pdev); |
803 | int ret; | 807 | int ret; |
804 | 808 | ||
809 | /* Don't attempt late suspend on a driver that is not bound */ | ||
810 | if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) | ||
811 | return 0; | ||
812 | |||
805 | ret = pm_generic_suspend_noirq(dev); | 813 | ret = pm_generic_suspend_noirq(dev); |
806 | 814 | ||
807 | if (!ret && !pm_runtime_status_suspended(dev)) { | 815 | if (!ret && !pm_runtime_status_suspended(dev)) { |
@@ -1175,3 +1183,41 @@ static int __init omap_device_init(void) | |||
1175 | return 0; | 1183 | return 0; |
1176 | } | 1184 | } |
1177 | core_initcall(omap_device_init); | 1185 | core_initcall(omap_device_init); |
1186 | |||
1187 | /** | ||
1188 | * omap_device_late_idle - idle devices without drivers | ||
1189 | * @dev: struct device * associated with omap_device | ||
1190 | * @data: unused | ||
1191 | * | ||
1192 | * Check the driver bound status of this device, and idle it | ||
1193 | * if there is no driver attached. | ||
1194 | */ | ||
1195 | static int __init omap_device_late_idle(struct device *dev, void *data) | ||
1196 | { | ||
1197 | struct platform_device *pdev = to_platform_device(dev); | ||
1198 | struct omap_device *od = to_omap_device(pdev); | ||
1199 | |||
1200 | if (!od) | ||
1201 | return 0; | ||
1202 | |||
1203 | /* | ||
1204 | * If omap_device state is enabled, but has no driver bound, | ||
1205 | * idle it. | ||
1206 | */ | ||
1207 | if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) { | ||
1208 | if (od->_state == OMAP_DEVICE_STATE_ENABLED) { | ||
1209 | dev_warn(dev, "%s: enabled but no driver. Idling\n", | ||
1210 | __func__); | ||
1211 | omap_device_idle(pdev); | ||
1212 | } | ||
1213 | } | ||
1214 | |||
1215 | return 0; | ||
1216 | } | ||
1217 | |||
1218 | static int __init omap_device_late_init(void) | ||
1219 | { | ||
1220 | bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle); | ||
1221 | return 0; | ||
1222 | } | ||
1223 | late_initcall(omap_device_late_init); | ||