aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 21:24:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 21:24:44 -0400
commit11801e9de26992d37cb869cc74f389b6a7677e0e (patch)
tree322b7ea2b475d52da27d3e01f5bc2992bb708d59 /arch/arm/plat-omap
parent1a58ddfc0fcf3d83a92573c71771962f9b218993 (diff)
parentb6e3b5c2fea9c76617e101cbbc54ed14961f9dee (diff)
Merge tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM soc-specific updates from Olof Johansson: "Most notable here is probably the addition of basic support for the BCM2835, an SoC used in some of the Roku 2 players as well as the much-hyped Raspberry Pi, cleaned up and contributed by Stephen Warren. It's still early days on mainline support, with just the basics working. But it has to start somewhere! Beyond that there's some conversions of clock infrastructure on tegra to common clock, misc updates for several other platforms, and OMAP now has its own bus (under drivers/bus) to manage its devices through. This branch adds two new directories outside of arch/arm: drivers/irqchip for new irq controllers, and drivers/bus for the above OMAP bus. It's expected that some of the other platforms will migrate parts of their platforms to those directories over time as well." Fix up trivial conflicts with the clk infrastructure changes. * tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (62 commits) ARM: shmobile: add new __iomem annotation for new code ARM: LPC32xx: Support GPI 28 ARM: LPC32xx: Platform update for devicetree completion of spi-pl022 ARM: LPC32xx: Board cleanup irqchip: fill in empty Kconfig ARM: SAMSUNG: Add check for NULL in clock interface ARM: EXYNOS: Put PCM, Slimbus, Spdif clocks to off state ARM: EXYNOS: Add bus clock for FIMD ARM: SAMSUNG: Fix HDMI related warnings ARM: S3C24XX: Add .get_rate callback for "camif-upll" clock ARM: EXYNOS: Fix incorrect help text ARM: EXYNOS: Turn off clocks for NAND, OneNAND and TSI controllers 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 ...
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h2
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h1
-rw-r--r--arch/arm/plat-omap/omap_device.c56
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 6132972aff37..9b9646c3673d 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -658,6 +658,7 @@ extern int omap2420_hwmod_init(void);
658extern int omap2430_hwmod_init(void); 658extern int omap2430_hwmod_init(void);
659extern int omap3xxx_hwmod_init(void); 659extern int omap3xxx_hwmod_init(void);
660extern int omap44xx_hwmod_init(void); 660extern int omap44xx_hwmod_init(void);
661extern int am33xx_hwmod_init(void);
661 662
662extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois); 663extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois);
663 664
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index b59edb065c70..5c93c09a80c2 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -380,17 +380,21 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
380 unsigned long event, void *dev) 380 unsigned long event, void *dev)
381{ 381{
382 struct platform_device *pdev = to_platform_device(dev); 382 struct platform_device *pdev = to_platform_device(dev);
383 struct omap_device *od;
383 384
384 switch (event) { 385 switch (event) {
385 case BUS_NOTIFY_ADD_DEVICE:
386 if (pdev->dev.of_node)
387 omap_device_build_from_dt(pdev);
388 break;
389
390 case BUS_NOTIFY_DEL_DEVICE: 386 case BUS_NOTIFY_DEL_DEVICE:
391 if (pdev->archdata.od) 387 if (pdev->archdata.od)
392 omap_device_delete(pdev->archdata.od); 388 omap_device_delete(pdev->archdata.od);
393 break; 389 break;
390 case BUS_NOTIFY_ADD_DEVICE:
391 if (pdev->dev.of_node)
392 omap_device_build_from_dt(pdev);
393 /* fall through */
394 default:
395 od = to_omap_device(pdev);
396 if (od)
397 od->_driver_status = event;
394 } 398 }
395 399
396 return NOTIFY_DONE; 400 return NOTIFY_DONE;
@@ -747,6 +751,10 @@ static int _od_suspend_noirq(struct device *dev)
747 struct omap_device *od = to_omap_device(pdev); 751 struct omap_device *od = to_omap_device(pdev);
748 int ret; 752 int ret;
749 753
754 /* Don't attempt late suspend on a driver that is not bound */
755 if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER)
756 return 0;
757
750 ret = pm_generic_suspend_noirq(dev); 758 ret = pm_generic_suspend_noirq(dev);
751 759
752 if (!ret && !pm_runtime_status_suspended(dev)) { 760 if (!ret && !pm_runtime_status_suspended(dev)) {
@@ -1120,3 +1128,41 @@ static int __init omap_device_init(void)
1120 return 0; 1128 return 0;
1121} 1129}
1122core_initcall(omap_device_init); 1130core_initcall(omap_device_init);
1131
1132/**
1133 * omap_device_late_idle - idle devices without drivers
1134 * @dev: struct device * associated with omap_device
1135 * @data: unused
1136 *
1137 * Check the driver bound status of this device, and idle it
1138 * if there is no driver attached.
1139 */
1140static int __init omap_device_late_idle(struct device *dev, void *data)
1141{
1142 struct platform_device *pdev = to_platform_device(dev);
1143 struct omap_device *od = to_omap_device(pdev);
1144
1145 if (!od)
1146 return 0;
1147
1148 /*
1149 * If omap_device state is enabled, but has no driver bound,
1150 * idle it.
1151 */
1152 if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) {
1153 if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
1154 dev_warn(dev, "%s: enabled but no driver. Idling\n",
1155 __func__);
1156 omap_device_idle(pdev);
1157 }
1158 }
1159
1160 return 0;
1161}
1162
1163static int __init omap_device_late_init(void)
1164{
1165 bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
1166 return 0;
1167}
1168late_initcall(omap_device_late_init);