diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2010-08-23 11:10:55 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-09-23 20:14:14 -0400 |
commit | 0d5e825252e184a5608c8a9827b79f591535b806 (patch) | |
tree | 073835ecb7b1cd834b5e5587a820d52ffdc30bb9 | |
parent | a1ed40cb258ba7a8574e662de5ae6ba4dc314436 (diff) |
OMAP: omap_device: make all devices a child of a new parent device
In order to help differentiate omap_devices from normal
platform_devices, make them all a parent of a new common parent
device.
Then, in order to determine if a platform_device is also an
omap_device, checking the parent is all that is needed.
Users of this feature are the runtime PM core for OMAP, where we need
to know if a device being passed in is an omap_device or not in order
to know whether to call the omap_device API with it.
In addition, all omap_devices will now show up under /sys/devices/omap
instead of /sys/devices/platform
Acked-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_device.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index bad4c3df70d..28e2d1a7843 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h | |||
@@ -36,6 +36,8 @@ | |||
36 | 36 | ||
37 | #include <plat/omap_hwmod.h> | 37 | #include <plat/omap_hwmod.h> |
38 | 38 | ||
39 | extern struct device omap_device_parent; | ||
40 | |||
39 | /* omap_device._state values */ | 41 | /* omap_device._state values */ |
40 | #define OMAP_DEVICE_STATE_UNKNOWN 0 | 42 | #define OMAP_DEVICE_STATE_UNKNOWN 0 |
41 | #define OMAP_DEVICE_STATE_ENABLED 1 | 43 | #define OMAP_DEVICE_STATE_ENABLED 1 |
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 7f05f491186..8215b1bf40f 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -465,6 +465,7 @@ int omap_device_register(struct omap_device *od) | |||
465 | { | 465 | { |
466 | pr_debug("omap_device: %s: registering\n", od->pdev.name); | 466 | pr_debug("omap_device: %s: registering\n", od->pdev.name); |
467 | 467 | ||
468 | od->pdev.dev.parent = &omap_device_parent; | ||
468 | return platform_device_register(&od->pdev); | 469 | return platform_device_register(&od->pdev); |
469 | } | 470 | } |
470 | 471 | ||
@@ -737,3 +738,14 @@ int omap_device_enable_clocks(struct omap_device *od) | |||
737 | /* XXX pass along return value here? */ | 738 | /* XXX pass along return value here? */ |
738 | return 0; | 739 | return 0; |
739 | } | 740 | } |
741 | |||
742 | struct device omap_device_parent = { | ||
743 | .init_name = "omap", | ||
744 | .parent = &platform_bus, | ||
745 | }; | ||
746 | |||
747 | static int __init omap_device_init(void) | ||
748 | { | ||
749 | return device_register(&omap_device_parent); | ||
750 | } | ||
751 | core_initcall(omap_device_init); | ||