diff options
author | Lee Jones <lee.jones@linaro.org> | 2012-02-06 14:22:25 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-02-13 01:31:44 -0500 |
commit | b024a0c804356d90b13c072c8bbb444d9e745a66 (patch) | |
tree | 5e0ef411be516b6b9a176f0e9b84ccd665bdcd3e | |
parent | eda413c228e227d888bc13d210e7c4c6aa62a682 (diff) |
ARM: ux500: move top level platform devices in sysfs to /sys/devices/socX
At the request of Arnd Bergmann this patch moves all SoC
platform devices found in sysfs from /sys/devices/platform to
/sys/devices/soc<SoCNum>/. It is believed as the devices are
SoC specific and a /sys/devices/soc node has recently
become available, that this would be a more appropriate place to
display the data.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-u5500.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-ux500/cpu-db5500.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-ux500/cpu-db8500.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-ux500/devices-common.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-ux500/usb.c | 3 |
6 files changed, 40 insertions, 4 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index f9ce2a1211c9..04afcdf8b0cf 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -610,6 +610,7 @@ static void __init mop500_init_machine(void) | |||
610 | { | 610 | { |
611 | struct device *parent = NULL; | 611 | struct device *parent = NULL; |
612 | int i2c0_devs; | 612 | int i2c0_devs; |
613 | int i; | ||
613 | 614 | ||
614 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; | 615 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; |
615 | 616 | ||
@@ -617,6 +618,9 @@ static void __init mop500_init_machine(void) | |||
617 | 618 | ||
618 | mop500_pins_init(); | 619 | mop500_pins_init(); |
619 | 620 | ||
621 | for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) | ||
622 | mop500_platform_devs[i]->dev.parent = parent; | ||
623 | |||
620 | platform_add_devices(mop500_platform_devs, | 624 | platform_add_devices(mop500_platform_devs, |
621 | ARRAY_SIZE(mop500_platform_devs)); | 625 | ARRAY_SIZE(mop500_platform_devs)); |
622 | 626 | ||
@@ -639,11 +643,15 @@ static void __init snowball_init_machine(void) | |||
639 | { | 643 | { |
640 | struct device *parent = NULL; | 644 | struct device *parent = NULL; |
641 | int i2c0_devs; | 645 | int i2c0_devs; |
646 | int i; | ||
642 | 647 | ||
643 | parent = u8500_init_devices(); | 648 | parent = u8500_init_devices(); |
644 | 649 | ||
645 | snowball_pins_init(); | 650 | snowball_pins_init(); |
646 | 651 | ||
652 | for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++) | ||
653 | snowball_platform_devs[i]->dev.parent = parent; | ||
654 | |||
647 | platform_add_devices(snowball_platform_devs, | 655 | platform_add_devices(snowball_platform_devs, |
648 | ARRAY_SIZE(snowball_platform_devs)); | 656 | ARRAY_SIZE(snowball_platform_devs)); |
649 | 657 | ||
@@ -665,6 +673,7 @@ static void __init hrefv60_init_machine(void) | |||
665 | { | 673 | { |
666 | struct device *parent = NULL; | 674 | struct device *parent = NULL; |
667 | int i2c0_devs; | 675 | int i2c0_devs; |
676 | int i; | ||
668 | 677 | ||
669 | /* | 678 | /* |
670 | * The HREFv60 board removed a GPIO expander and routed | 679 | * The HREFv60 board removed a GPIO expander and routed |
@@ -677,6 +686,9 @@ static void __init hrefv60_init_machine(void) | |||
677 | 686 | ||
678 | hrefv60_pins_init(); | 687 | hrefv60_pins_init(); |
679 | 688 | ||
689 | for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) | ||
690 | mop500_platform_devs[i]->dev.parent = parent; | ||
691 | |||
680 | platform_add_devices(mop500_platform_devs, | 692 | platform_add_devices(mop500_platform_devs, |
681 | ARRAY_SIZE(mop500_platform_devs)); | 693 | ARRAY_SIZE(mop500_platform_devs)); |
682 | 694 | ||
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c index d7a9596ff664..0ff4be72a809 100644 --- a/arch/arm/mach-ux500/board-u5500.c +++ b/arch/arm/mach-ux500/board-u5500.c | |||
@@ -136,6 +136,7 @@ static void __init u5500_uart_init(struct device *parent) | |||
136 | static void __init u5500_init_machine(void) | 136 | static void __init u5500_init_machine(void) |
137 | { | 137 | { |
138 | struct device *parent = NULL; | 138 | struct device *parent = NULL; |
139 | int i; | ||
139 | 140 | ||
140 | parent = u5500_init_devices(); | 141 | parent = u5500_init_devices(); |
141 | nmk_config_pins(u5500_pins, ARRAY_SIZE(u5500_pins)); | 142 | nmk_config_pins(u5500_pins, ARRAY_SIZE(u5500_pins)); |
@@ -144,6 +145,9 @@ static void __init u5500_init_machine(void) | |||
144 | u5500_sdi_init(parent); | 145 | u5500_sdi_init(parent); |
145 | u5500_uart_init(parent); | 146 | u5500_uart_init(parent); |
146 | 147 | ||
148 | for (i = 0; i < ARRAY_SIZE(u5500_platform_devices); i++) | ||
149 | u5500_platform_devices[i]->dev.parent = parent; | ||
150 | |||
147 | platform_add_devices(u5500_platform_devices, | 151 | platform_add_devices(u5500_platform_devices, |
148 | ARRAY_SIZE(u5500_platform_devices)); | 152 | ARRAY_SIZE(u5500_platform_devices)); |
149 | } | 153 | } |
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c index 8f8acfdd4a1b..bca47f32082f 100644 --- a/arch/arm/mach-ux500/cpu-db5500.c +++ b/arch/arm/mach-ux500/cpu-db5500.c | |||
@@ -227,6 +227,7 @@ static struct device * __init db5500_soc_device_init(void) | |||
227 | struct device * __init u5500_init_devices(void) | 227 | struct device * __init u5500_init_devices(void) |
228 | { | 228 | { |
229 | struct device *parent; | 229 | struct device *parent; |
230 | int i; | ||
230 | 231 | ||
231 | parent = db5500_soc_device_init(); | 232 | parent = db5500_soc_device_init(); |
232 | 233 | ||
@@ -236,6 +237,9 @@ struct device * __init u5500_init_devices(void) | |||
236 | db5500_add_rtc(parent); | 237 | db5500_add_rtc(parent); |
237 | db5500_add_usb(parent, usb_db5500_rx_dma_cfg, usb_db5500_tx_dma_cfg); | 238 | db5500_add_usb(parent, usb_db5500_rx_dma_cfg, usb_db5500_tx_dma_cfg); |
238 | 239 | ||
240 | for (i = 0; i < ARRAY_SIZE(db5500_platform_devs); i++) | ||
241 | db5500_platform_devs[i]->dev.parent = parent; | ||
242 | |||
239 | platform_add_devices(db5500_platform_devs, | 243 | platform_add_devices(db5500_platform_devs, |
240 | ARRAY_SIZE(db5500_platform_devs)); | 244 | ARRAY_SIZE(db5500_platform_devs)); |
241 | 245 | ||
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index afcde3df71d7..9bd8163896cf 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -188,6 +188,7 @@ static struct device * __init db8500_soc_device_init(void) | |||
188 | struct device * __init u8500_init_devices(void) | 188 | struct device * __init u8500_init_devices(void) |
189 | { | 189 | { |
190 | struct device *parent; | 190 | struct device *parent; |
191 | int i; | ||
191 | 192 | ||
192 | parent = db8500_soc_device_init(); | 193 | parent = db8500_soc_device_init(); |
193 | 194 | ||
@@ -195,7 +196,12 @@ struct device * __init u8500_init_devices(void) | |||
195 | db8500_add_gpios(parent); | 196 | db8500_add_gpios(parent); |
196 | db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); | 197 | db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); |
197 | 198 | ||
198 | platform_device_register_simple("cpufreq-u8500", -1, NULL, 0); | 199 | platform_device_register_data(parent, |
200 | "cpufreq-u8500", -1, NULL, 0); | ||
201 | |||
202 | for (i = 0; i < ARRAY_SIZE(platform_devs); i++) | ||
203 | platform_devs[i]->dev.parent = parent; | ||
204 | |||
199 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); | 205 | platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); |
200 | 206 | ||
201 | return parent; | 207 | return parent; |
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c index 96be2482ea45..96effbd8ceb5 100644 --- a/arch/arm/mach-ux500/devices-common.c +++ b/arch/arm/mach-ux500/devices-common.c | |||
@@ -47,6 +47,8 @@ dbx500_add_amba_device(struct device *parent, const char *name, | |||
47 | 47 | ||
48 | dev->dev.platform_data = pdata; | 48 | dev->dev.platform_data = pdata; |
49 | 49 | ||
50 | dev->dev.parent = parent; | ||
51 | |||
50 | ret = amba_device_register(dev, &iomem_resource); | 52 | ret = amba_device_register(dev, &iomem_resource); |
51 | if (ret) { | 53 | if (ret) { |
52 | kfree(dev); | 54 | kfree(dev); |
@@ -126,9 +128,14 @@ dbx500_add_gpio(struct device *parent, int id, resource_size_t addr, int irq, | |||
126 | } | 128 | } |
127 | }; | 129 | }; |
128 | 130 | ||
129 | return platform_device_register_resndata(NULL, "gpio", id, | 131 | return platform_device_register_resndata( |
130 | resources, ARRAY_SIZE(resources), | 132 | parent, |
131 | pdata, sizeof(*pdata)); | 133 | "gpio", |
134 | id, | ||
135 | resources, | ||
136 | ARRAY_SIZE(resources), | ||
137 | pdata, | ||
138 | sizeof(*pdata)); | ||
132 | } | 139 | } |
133 | 140 | ||
134 | void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num, | 141 | void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num, |
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c index 5329a2cc6807..a74af389bc63 100644 --- a/arch/arm/mach-ux500/usb.c +++ b/arch/arm/mach-ux500/usb.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/platform_device.h> | 7 | #include <linux/platform_device.h> |
8 | #include <linux/usb/musb.h> | 8 | #include <linux/usb/musb.h> |
9 | #include <linux/dma-mapping.h> | 9 | #include <linux/dma-mapping.h> |
10 | |||
10 | #include <plat/ste_dma40.h> | 11 | #include <plat/ste_dma40.h> |
11 | #include <mach/hardware.h> | 12 | #include <mach/hardware.h> |
12 | #include <mach/usb.h> | 13 | #include <mach/usb.h> |
@@ -151,5 +152,7 @@ void ux500_add_usb(struct device *parent, resource_size_t base, int irq, | |||
151 | ux500_usb_dma_update_rx_ch_config(dma_rx_cfg); | 152 | ux500_usb_dma_update_rx_ch_config(dma_rx_cfg); |
152 | ux500_usb_dma_update_tx_ch_config(dma_tx_cfg); | 153 | ux500_usb_dma_update_tx_ch_config(dma_tx_cfg); |
153 | 154 | ||
155 | ux500_musb_device.dev.parent = parent; | ||
156 | |||
154 | platform_device_register(&ux500_musb_device); | 157 | platform_device_register(&ux500_musb_device); |
155 | } | 158 | } |