diff options
author | Kevin Hilman <khilman@ti.com> | 2012-07-10 14:13:16 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2012-09-12 13:51:49 -0400 |
commit | e753345bec8fef81d1e87710917f89dc75f39b2a (patch) | |
tree | 16ea644456b7caf76baf9bae2fb9c9228778a2cb /arch/arm | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) |
ARM: OMAP: omap_device: keep track of driver bound status
Use the bus notifier to keep track of driver bound status by adding a
new internal field to struct omap_device: _driver_status.
This will be useful for follow-up patches which need to know whether
or not a driver is bound in order to make intelligent omap_device
enable/idle decisions.
Reviewed-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_device.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 14 |
2 files changed, 11 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/omap_device.c b/arch/arm/plat-omap/omap_device.c index c490240bb82c..1d1b5ff78306 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -385,17 +385,21 @@ static int _omap_device_notifier_call(struct notifier_block *nb, | |||
385 | unsigned long event, void *dev) | 385 | unsigned long event, void *dev) |
386 | { | 386 | { |
387 | struct platform_device *pdev = to_platform_device(dev); | 387 | struct platform_device *pdev = to_platform_device(dev); |
388 | struct omap_device *od; | ||
388 | 389 | ||
389 | switch (event) { | 390 | switch (event) { |
390 | case BUS_NOTIFY_ADD_DEVICE: | ||
391 | if (pdev->dev.of_node) | ||
392 | omap_device_build_from_dt(pdev); | ||
393 | break; | ||
394 | |||
395 | case BUS_NOTIFY_DEL_DEVICE: | 391 | case BUS_NOTIFY_DEL_DEVICE: |
396 | if (pdev->archdata.od) | 392 | if (pdev->archdata.od) |
397 | omap_device_delete(pdev->archdata.od); | 393 | omap_device_delete(pdev->archdata.od); |
398 | break; | 394 | break; |
395 | case BUS_NOTIFY_ADD_DEVICE: | ||
396 | if (pdev->dev.of_node) | ||
397 | omap_device_build_from_dt(pdev); | ||
398 | /* fall through */ | ||
399 | default: | ||
400 | od = to_omap_device(pdev); | ||
401 | if (od) | ||
402 | od->_driver_status = event; | ||
399 | } | 403 | } |
400 | 404 | ||
401 | return NOTIFY_DONE; | 405 | return NOTIFY_DONE; |