aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-02-06 14:22:21 -0500
committerArnd Bergmann <arnd@arndb.de>2012-02-13 01:31:29 -0500
commit18403424c4fe5bac509bf52343f5d5407d45ee3a (patch)
treeae9a0f3056c712ee7f8042d667b267bedda92abf /arch/arm/mach-ux500
parentd65b4e98d7ea3038b767b70fe8be959b2913f16d (diff)
ARM: ux500: pass parent pointer to each platform device
This patch provides a means for any device within ux500 platform code to allocate its own parent. This is particularly prudent with the introduction of /sys/devices/socX, as a device can now proclaim to be integral part of an SoC, rather than a more generic platform device. Latter patches make good use of this functionality. 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>
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c31
-rw-r--r--arch/arm/mach-ux500/board-mop500.c62
-rw-r--r--arch/arm/mach-ux500/board-mop500.h8
-rw-r--r--arch/arm/mach-ux500/board-u5500-sdi.c4
-rw-r--r--arch/arm/mach-ux500/board-u5500.c23
-rw-r--r--arch/arm/mach-ux500/cpu-db5500.c18
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c15
-rw-r--r--arch/arm/mach-ux500/devices-common.c13
-rw-r--r--arch/arm/mach-ux500/devices-common.h39
-rw-r--r--arch/arm/mach-ux500/devices-db5500.h116
-rw-r--r--arch/arm/mach-ux500/devices-db8500.h166
-rw-r--r--arch/arm/mach-ux500/dma-db5500.c3
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h8
-rw-r--r--arch/arm/mach-ux500/include/mach/usb.h4
-rw-r--r--arch/arm/mach-ux500/usb.c4
15 files changed, 289 insertions, 225 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 5dde4d4ebe8..479ebe04cf9 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -104,7 +104,7 @@ static struct mmci_platform_data mop500_sdi0_data = {
104#endif 104#endif
105}; 105};
106 106
107static void sdi0_configure(void) 107static void sdi0_configure(struct device *parent)
108{ 108{
109 int ret; 109 int ret;
110 110
@@ -123,15 +123,15 @@ static void sdi0_configure(void)
123 gpio_direction_output(sdi0_en, 1); 123 gpio_direction_output(sdi0_en, 1);
124 124
125 /* Add the device, force v2 to subrevision 1 */ 125 /* Add the device, force v2 to subrevision 1 */
126 db8500_add_sdi0(&mop500_sdi0_data, U8500_SDI_V2_PERIPHID); 126 db8500_add_sdi0(parent, &mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
127} 127}
128 128
129void mop500_sdi_tc35892_init(void) 129void mop500_sdi_tc35892_init(struct device *parent)
130{ 130{
131 mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD; 131 mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
132 sdi0_en = GPIO_SDMMC_EN; 132 sdi0_en = GPIO_SDMMC_EN;
133 sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL; 133 sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
134 sdi0_configure(); 134 sdi0_configure(parent);
135} 135}
136 136
137/* 137/*
@@ -246,12 +246,13 @@ static struct mmci_platform_data mop500_sdi4_data = {
246#endif 246#endif
247}; 247};
248 248
249void __init mop500_sdi_init(void) 249void __init mop500_sdi_init(struct device *parent)
250{ 250{
251 /* PoP:ed eMMC */ 251 /* PoP:ed eMMC */
252 db8500_add_sdi2(&mop500_sdi2_data, U8500_SDI_V2_PERIPHID); 252 db8500_add_sdi2(parent, &mop500_sdi2_data, U8500_SDI_V2_PERIPHID);
253 /* On-board eMMC */ 253 /* On-board eMMC */
254 db8500_add_sdi4(&mop500_sdi4_data, U8500_SDI_V2_PERIPHID); 254 db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
255
255 /* 256 /*
256 * On boards with the TC35892 GPIO expander, sdi0 will finally 257 * On boards with the TC35892 GPIO expander, sdi0 will finally
257 * be added when the TC35892 initializes and calls 258 * be added when the TC35892 initializes and calls
@@ -259,31 +260,31 @@ void __init mop500_sdi_init(void)
259 */ 260 */
260} 261}
261 262
262void __init snowball_sdi_init(void) 263void __init snowball_sdi_init(struct device *parent)
263{ 264{
264 /* On Snowball MMC_CAP_SD_HIGHSPEED isn't supported (Hardware issue?) */ 265 /* On Snowball MMC_CAP_SD_HIGHSPEED isn't supported (Hardware issue?) */
265 mop500_sdi0_data.capabilities &= ~MMC_CAP_SD_HIGHSPEED; 266 mop500_sdi0_data.capabilities &= ~MMC_CAP_SD_HIGHSPEED;
266 /* On-board eMMC */ 267 /* On-board eMMC */
267 db8500_add_sdi4(&mop500_sdi4_data, U8500_SDI_V2_PERIPHID); 268 db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
268 /* External Micro SD slot */ 269 /* External Micro SD slot */
269 mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO; 270 mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
270 mop500_sdi0_data.cd_invert = true; 271 mop500_sdi0_data.cd_invert = true;
271 sdi0_en = SNOWBALL_SDMMC_EN_GPIO; 272 sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
272 sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO; 273 sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
273 sdi0_configure(); 274 sdi0_configure(parent);
274} 275}
275 276
276void __init hrefv60_sdi_init(void) 277void __init hrefv60_sdi_init(struct device *parent)
277{ 278{
278 /* PoP:ed eMMC */ 279 /* PoP:ed eMMC */
279 db8500_add_sdi2(&mop500_sdi2_data, U8500_SDI_V2_PERIPHID); 280 db8500_add_sdi2(parent, &mop500_sdi2_data, U8500_SDI_V2_PERIPHID);
280 /* On-board eMMC */ 281 /* On-board eMMC */
281 db8500_add_sdi4(&mop500_sdi4_data, U8500_SDI_V2_PERIPHID); 282 db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
282 /* External Micro SD slot */ 283 /* External Micro SD slot */
283 mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO; 284 mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
284 sdi0_en = HREFV60_SDMMC_EN_GPIO; 285 sdi0_en = HREFV60_SDMMC_EN_GPIO;
285 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO; 286 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
286 sdi0_configure(); 287 sdi0_configure(parent);
287 /* WLAN SDIO channel */ 288 /* WLAN SDIO channel */
288 db8500_add_sdi1(&mop500_sdi1_data, U8500_SDI_V2_PERIPHID); 289 db8500_add_sdi1(parent, &mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
289} 290}
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 5c00712907d..f9ce2a1211c 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -226,7 +226,12 @@ static struct tps6105x_platform_data mop500_tps61052_data = {
226 226
227static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base) 227static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base)
228{ 228{
229 mop500_sdi_tc35892_init(); 229 struct device *parent = NULL;
230#if 0
231 /* FIXME: Is the sdi actually part of tc3589x? */
232 parent = tc3589x->dev;
233#endif
234 mop500_sdi_tc35892_init(parent);
230} 235}
231 236
232static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = { 237static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = {
@@ -353,12 +358,12 @@ U8500_I2C_CONTROLLER(1, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
353U8500_I2C_CONTROLLER(2, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); 358U8500_I2C_CONTROLLER(2, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
354U8500_I2C_CONTROLLER(3, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); 359U8500_I2C_CONTROLLER(3, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
355 360
356static void __init mop500_i2c_init(void) 361static void __init mop500_i2c_init(struct device *parent)
357{ 362{
358 db8500_add_i2c0(&u8500_i2c0_data); 363 db8500_add_i2c0(parent, &u8500_i2c0_data);
359 db8500_add_i2c1(&u8500_i2c1_data); 364 db8500_add_i2c1(parent, &u8500_i2c1_data);
360 db8500_add_i2c2(&u8500_i2c2_data); 365 db8500_add_i2c2(parent, &u8500_i2c2_data);
361 db8500_add_i2c3(&u8500_i2c3_data); 366 db8500_add_i2c3(parent, &u8500_i2c3_data);
362} 367}
363 368
364static struct gpio_keys_button mop500_gpio_keys[] = { 369static struct gpio_keys_button mop500_gpio_keys[] = {
@@ -451,9 +456,9 @@ static struct pl022_ssp_controller ssp0_platform_data = {
451 .num_chipselect = 5, 456 .num_chipselect = 5,
452}; 457};
453 458
454static void __init mop500_spi_init(void) 459static void __init mop500_spi_init(struct device *parent)
455{ 460{
456 db8500_add_ssp0(&ssp0_platform_data); 461 db8500_add_ssp0(parent, &ssp0_platform_data);
457} 462}
458 463
459#ifdef CONFIG_STE_DMA40 464#ifdef CONFIG_STE_DMA40
@@ -587,11 +592,11 @@ static struct amba_pl011_data uart2_plat = {
587#endif 592#endif
588}; 593};
589 594
590static void __init mop500_uart_init(void) 595static void __init mop500_uart_init(struct device *parent)
591{ 596{
592 db8500_add_uart0(&uart0_plat); 597 db8500_add_uart0(parent, &uart0_plat);
593 db8500_add_uart1(&uart1_plat); 598 db8500_add_uart1(parent, &uart1_plat);
594 db8500_add_uart2(&uart2_plat); 599 db8500_add_uart2(parent, &uart2_plat);
595} 600}
596 601
597static struct platform_device *snowball_platform_devs[] __initdata = { 602static struct platform_device *snowball_platform_devs[] __initdata = {
@@ -603,21 +608,22 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
603 608
604static void __init mop500_init_machine(void) 609static void __init mop500_init_machine(void)
605{ 610{
611 struct device *parent = NULL;
606 int i2c0_devs; 612 int i2c0_devs;
607 613
608 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; 614 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
609 615
610 u8500_init_devices(); 616 parent = u8500_init_devices();
611 617
612 mop500_pins_init(); 618 mop500_pins_init();
613 619
614 platform_add_devices(mop500_platform_devs, 620 platform_add_devices(mop500_platform_devs,
615 ARRAY_SIZE(mop500_platform_devs)); 621 ARRAY_SIZE(mop500_platform_devs));
616 622
617 mop500_i2c_init(); 623 mop500_i2c_init(parent);
618 mop500_sdi_init(); 624 mop500_sdi_init(parent);
619 mop500_spi_init(); 625 mop500_spi_init(parent);
620 mop500_uart_init(); 626 mop500_uart_init(parent);
621 627
622 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 628 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
623 629
@@ -631,19 +637,20 @@ static void __init mop500_init_machine(void)
631 637
632static void __init snowball_init_machine(void) 638static void __init snowball_init_machine(void)
633{ 639{
640 struct device *parent = NULL;
634 int i2c0_devs; 641 int i2c0_devs;
635 642
636 u8500_init_devices(); 643 parent = u8500_init_devices();
637 644
638 snowball_pins_init(); 645 snowball_pins_init();
639 646
640 platform_add_devices(snowball_platform_devs, 647 platform_add_devices(snowball_platform_devs,
641 ARRAY_SIZE(snowball_platform_devs)); 648 ARRAY_SIZE(snowball_platform_devs));
642 649
643 mop500_i2c_init(); 650 mop500_i2c_init(parent);
644 snowball_sdi_init(); 651 snowball_sdi_init(parent);
645 mop500_spi_init(); 652 mop500_spi_init(parent);
646 mop500_uart_init(); 653 mop500_uart_init(parent);
647 654
648 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 655 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
649 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); 656 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
@@ -656,6 +663,7 @@ static void __init snowball_init_machine(void)
656 663
657static void __init hrefv60_init_machine(void) 664static void __init hrefv60_init_machine(void)
658{ 665{
666 struct device *parent = NULL;
659 int i2c0_devs; 667 int i2c0_devs;
660 668
661 /* 669 /*
@@ -665,17 +673,17 @@ static void __init hrefv60_init_machine(void)
665 */ 673 */
666 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; 674 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
667 675
668 u8500_init_devices(); 676 parent = u8500_init_devices();
669 677
670 hrefv60_pins_init(); 678 hrefv60_pins_init();
671 679
672 platform_add_devices(mop500_platform_devs, 680 platform_add_devices(mop500_platform_devs,
673 ARRAY_SIZE(mop500_platform_devs)); 681 ARRAY_SIZE(mop500_platform_devs));
674 682
675 mop500_i2c_init(); 683 mop500_i2c_init(parent);
676 hrefv60_sdi_init(); 684 hrefv60_sdi_init(parent);
677 mop500_spi_init(); 685 mop500_spi_init(parent);
678 mop500_uart_init(); 686 mop500_uart_init(parent);
679 687
680 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); 688 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
681 689
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index f926d3db620..3d594c24bfe 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -75,10 +75,10 @@
75 75
76struct i2c_board_info; 76struct i2c_board_info;
77 77
78extern void mop500_sdi_init(void); 78extern void mop500_sdi_init(struct device *parent);
79extern void snowball_sdi_init(void); 79extern void snowball_sdi_init(struct device *parent);
80extern void hrefv60_sdi_init(void); 80extern void hrefv60_sdi_init(struct device *parent);
81extern void mop500_sdi_tc35892_init(void); 81extern void mop500_sdi_tc35892_init(struct device *parent);
82void __init mop500_u8500uib_init(void); 82void __init mop500_u8500uib_init(void);
83void __init mop500_stuib_init(void); 83void __init mop500_stuib_init(void);
84void __init mop500_pins_init(void); 84void __init mop500_pins_init(void);
diff --git a/arch/arm/mach-ux500/board-u5500-sdi.c b/arch/arm/mach-ux500/board-u5500-sdi.c
index 63c3f8058ff..836112eedde 100644
--- a/arch/arm/mach-ux500/board-u5500-sdi.c
+++ b/arch/arm/mach-ux500/board-u5500-sdi.c
@@ -66,9 +66,9 @@ static struct mmci_platform_data u5500_sdi0_data = {
66#endif 66#endif
67}; 67};
68 68
69void __init u5500_sdi_init(void) 69void __init u5500_sdi_init(struct device *parent)
70{ 70{
71 nmk_config_pins(u5500_sdi_pins, ARRAY_SIZE(u5500_sdi_pins)); 71 nmk_config_pins(u5500_sdi_pins, ARRAY_SIZE(u5500_sdi_pins));
72 72
73 db5500_add_sdi0(&u5500_sdi0_data); 73 db5500_add_sdi0(parent, &u5500_sdi0_data);
74} 74}
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c
index 9de9e9c4dbb..d7a9596ff66 100644
--- a/arch/arm/mach-ux500/board-u5500.c
+++ b/arch/arm/mach-ux500/board-u5500.c
@@ -97,9 +97,9 @@ static struct i2c_board_info __initdata u5500_i2c2_devices[] = {
97 }, 97 },
98}; 98};
99 99
100static void __init u5500_i2c_init(void) 100static void __init u5500_i2c_init(struct device *parent)
101{ 101{
102 db5500_add_i2c2(&u5500_i2c2_data); 102 db5500_add_i2c2(parent, &u5500_i2c2_data);
103 i2c_register_board_info(2, ARRAY_AND_SIZE(u5500_i2c2_devices)); 103 i2c_register_board_info(2, ARRAY_AND_SIZE(u5500_i2c2_devices));
104} 104}
105 105
@@ -126,20 +126,23 @@ static struct platform_device *u5500_platform_devices[] __initdata = {
126 &ab5500_device, 126 &ab5500_device,
127}; 127};
128 128
129static void __init u5500_uart_init(void) 129static void __init u5500_uart_init(struct device *parent)
130{ 130{
131 db5500_add_uart0(NULL); 131 db5500_add_uart0(parent, NULL);
132 db5500_add_uart1(NULL); 132 db5500_add_uart1(parent, NULL);
133 db5500_add_uart2(NULL); 133 db5500_add_uart2(parent, NULL);
134} 134}
135 135
136static void __init u5500_init_machine(void) 136static void __init u5500_init_machine(void)
137{ 137{
138 u5500_init_devices(); 138 struct device *parent = NULL;
139
140 parent = u5500_init_devices();
139 nmk_config_pins(u5500_pins, ARRAY_SIZE(u5500_pins)); 141 nmk_config_pins(u5500_pins, ARRAY_SIZE(u5500_pins));
140 u5500_i2c_init(); 142
141 u5500_sdi_init(); 143 u5500_i2c_init(parent);
142 u5500_uart_init(); 144 u5500_sdi_init(parent);
145 u5500_uart_init(parent);
143 146
144 platform_add_devices(u5500_platform_devices, 147 platform_add_devices(u5500_platform_devices,
145 ARRAY_SIZE(u5500_platform_devices)); 148 ARRAY_SIZE(u5500_platform_devices));
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c
index 18aa5c05c69..c402fd6efe5 100644
--- a/arch/arm/mach-ux500/cpu-db5500.c
+++ b/arch/arm/mach-ux500/cpu-db5500.c
@@ -147,13 +147,13 @@ static resource_size_t __initdata db5500_gpio_base[] = {
147 U5500_GPIOBANK7_BASE, 147 U5500_GPIOBANK7_BASE,
148}; 148};
149 149
150static void __init db5500_add_gpios(void) 150static void __init db5500_add_gpios(struct device *parent)
151{ 151{
152 struct nmk_gpio_platform_data pdata = { 152 struct nmk_gpio_platform_data pdata = {
153 /* No custom data yet */ 153 /* No custom data yet */
154 }; 154 };
155 155
156 dbx500_add_gpios(ARRAY_AND_SIZE(db5500_gpio_base), 156 dbx500_add_gpios(parent, ARRAY_AND_SIZE(db5500_gpio_base),
157 IRQ_DB5500_GPIO0, &pdata); 157 IRQ_DB5500_GPIO0, &pdata);
158} 158}
159 159
@@ -212,14 +212,18 @@ static int usb_db5500_tx_dma_cfg[] = {
212 DB5500_DMA_DEV38_USB_OTG_OEP_8 212 DB5500_DMA_DEV38_USB_OTG_OEP_8
213}; 213};
214 214
215void __init u5500_init_devices(void) 215struct device* __init u5500_init_devices(void)
216{ 216{
217 db5500_add_gpios(); 217 /* FIXME: First parameter to be a real parent. */
218 db5500_add_gpios(NULL);
218 db5500_pmu_init(); 219 db5500_pmu_init();
219 db5500_dma_init(); 220 db5500_dma_init(NULL);
220 db5500_add_rtc(); 221 db5500_add_rtc(NULL);
221 db5500_add_usb(usb_db5500_rx_dma_cfg, usb_db5500_tx_dma_cfg); 222 db5500_add_usb(NULL, usb_db5500_rx_dma_cfg, usb_db5500_tx_dma_cfg);
222 223
223 platform_add_devices(db5500_platform_devs, 224 platform_add_devices(db5500_platform_devs,
224 ARRAY_SIZE(db5500_platform_devs)); 225 ARRAY_SIZE(db5500_platform_devs));
226
227 /* FIXME: Return value to be a real parent. */
228 return NULL;
225} 229}
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 7176ee7491a..1e8a2cb7e50 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -132,13 +132,13 @@ static resource_size_t __initdata db8500_gpio_base[] = {
132 U8500_GPIOBANK8_BASE, 132 U8500_GPIOBANK8_BASE,
133}; 133};
134 134
135static void __init db8500_add_gpios(void) 135static void __init db8500_add_gpios(struct device *parent)
136{ 136{
137 struct nmk_gpio_platform_data pdata = { 137 struct nmk_gpio_platform_data pdata = {
138 .supports_sleepmode = true, 138 .supports_sleepmode = true,
139 }; 139 };
140 140
141 dbx500_add_gpios(ARRAY_AND_SIZE(db8500_gpio_base), 141 dbx500_add_gpios(parent, ARRAY_AND_SIZE(db8500_gpio_base),
142 IRQ_DB8500_GPIO0, &pdata); 142 IRQ_DB8500_GPIO0, &pdata);
143} 143}
144 144
@@ -167,14 +167,15 @@ static int usb_db8500_tx_dma_cfg[] = {
167/* 167/*
168 * This function is called from the board init 168 * This function is called from the board init
169 */ 169 */
170void __init u8500_init_devices(void) 170struct device* __init u8500_init_devices(void)
171{ 171{
172 db8500_add_rtc(); 172 db8500_add_rtc(NULL);
173 db8500_add_gpios(); 173 db8500_add_gpios(NULL);
174 db8500_add_usb(usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); 174 db8500_add_usb(NULL, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg);
175 175
176 platform_device_register_simple("cpufreq-u8500", -1, NULL, 0); 176 platform_device_register_simple("cpufreq-u8500", -1, NULL, 0);
177 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); 177 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
178 178
179 return ; 179 /* FIXME: Return value to be a real parent. */
180 return NULL;
180} 181}
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c
index c563e5418d8..96be2482ea4 100644
--- a/arch/arm/mach-ux500/devices-common.c
+++ b/arch/arm/mach-ux500/devices-common.c
@@ -20,8 +20,9 @@
20#include "devices-common.h" 20#include "devices-common.h"
21 21
22struct amba_device * 22struct amba_device *
23dbx500_add_amba_device(const char *name, resource_size_t base, 23dbx500_add_amba_device(struct device *parent, const char *name,
24 int irq, void *pdata, unsigned int periphid) 24 resource_size_t base, int irq, void *pdata,
25 unsigned int periphid)
25{ 26{
26 struct amba_device *dev; 27 struct amba_device *dev;
27 int ret; 28 int ret;
@@ -109,7 +110,7 @@ dbx500_add_platform_device_4k1irq(const char *name, int id,
109} 110}
110 111
111static struct platform_device * 112static struct platform_device *
112dbx500_add_gpio(int id, resource_size_t addr, int irq, 113dbx500_add_gpio(struct device *parent, int id, resource_size_t addr, int irq,
113 struct nmk_gpio_platform_data *pdata) 114 struct nmk_gpio_platform_data *pdata)
114{ 115{
115 struct resource resources[] = { 116 struct resource resources[] = {
@@ -130,8 +131,8 @@ dbx500_add_gpio(int id, resource_size_t addr, int irq,
130 pdata, sizeof(*pdata)); 131 pdata, sizeof(*pdata));
131} 132}
132 133
133void dbx500_add_gpios(resource_size_t *base, int num, int irq, 134void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num,
134 struct nmk_gpio_platform_data *pdata) 135 int irq, struct nmk_gpio_platform_data *pdata)
135{ 136{
136 int first = 0; 137 int first = 0;
137 int i; 138 int i;
@@ -141,6 +142,6 @@ void dbx500_add_gpios(resource_size_t *base, int num, int irq,
141 pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first); 142 pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first);
142 pdata->num_gpio = 32; 143 pdata->num_gpio = 32;
143 144
144 dbx500_add_gpio(i, base[i], irq, pdata); 145 dbx500_add_gpio(parent, i, base[i], irq, pdata);
145 } 146 }
146} 147}
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h
index 7825705033b..f8adff891a9 100644
--- a/arch/arm/mach-ux500/devices-common.h
+++ b/arch/arm/mach-ux500/devices-common.h
@@ -9,7 +9,7 @@
9#define __DEVICES_COMMON_H 9#define __DEVICES_COMMON_H
10 10
11extern struct amba_device * 11extern struct amba_device *
12dbx500_add_amba_device(const char *name, resource_size_t base, 12dbx500_add_amba_device(struct device *parent, const char *name, resource_size_t base,
13 int irq, void *pdata, unsigned int periphid); 13 int irq, void *pdata, unsigned int periphid);
14 14
15extern struct platform_device * 15extern struct platform_device *
@@ -20,43 +20,46 @@ dbx500_add_platform_device_4k1irq(const char *name, int id,
20struct spi_master_cntlr; 20struct spi_master_cntlr;
21 21
22static inline struct amba_device * 22static inline struct amba_device *
23dbx500_add_msp_spi(const char *name, resource_size_t base, int irq, 23dbx500_add_msp_spi(struct device *parent, const char *name,
24 resource_size_t base, int irq,
24 struct spi_master_cntlr *pdata) 25 struct spi_master_cntlr *pdata)
25{ 26{
26 return dbx500_add_amba_device(name, base, irq, pdata, 0); 27 return dbx500_add_amba_device(parent, name, base, irq,
28 pdata, 0);
27} 29}
28 30
29static inline struct amba_device * 31static inline struct amba_device *
30dbx500_add_spi(const char *name, resource_size_t base, int irq, 32dbx500_add_spi(struct device *parent, const char *name, resource_size_t base,
31 struct spi_master_cntlr *pdata, 33 int irq, struct spi_master_cntlr *pdata,
32 u32 periphid) 34 u32 periphid)
33{ 35{
34 return dbx500_add_amba_device(name, base, irq, pdata, periphid); 36 return dbx500_add_amba_device(parent, name, base, irq,
37 pdata, periphid);
35} 38}
36 39
37struct mmci_platform_data; 40struct mmci_platform_data;
38 41
39static inline struct amba_device * 42static inline struct amba_device *
40dbx500_add_sdi(const char *name, resource_size_t base, int irq, 43dbx500_add_sdi(struct device *parent, const char *name, resource_size_t base,
41 struct mmci_platform_data *pdata, 44 int irq, struct mmci_platform_data *pdata, u32 periphid)
42 u32 periphid)
43{ 45{
44 return dbx500_add_amba_device(name, base, irq, pdata, periphid); 46 return dbx500_add_amba_device(parent, name, base, irq,
47 pdata, periphid);
45} 48}
46 49
47struct amba_pl011_data; 50struct amba_pl011_data;
48 51
49static inline struct amba_device * 52static inline struct amba_device *
50dbx500_add_uart(const char *name, resource_size_t base, int irq, 53dbx500_add_uart(struct device *parent, const char *name, resource_size_t base,
51 struct amba_pl011_data *pdata) 54 int irq, struct amba_pl011_data *pdata)
52{ 55{
53 return dbx500_add_amba_device(name, base, irq, pdata, 0); 56 return dbx500_add_amba_device(parent, name, base, irq, pdata, 0);
54} 57}
55 58
56struct nmk_i2c_controller; 59struct nmk_i2c_controller;
57 60
58static inline struct platform_device * 61static inline struct platform_device *
59dbx500_add_i2c(int id, resource_size_t base, int irq, 62dbx500_add_i2c(struct device *parent, int id, resource_size_t base, int irq,
60 struct nmk_i2c_controller *pdata) 63 struct nmk_i2c_controller *pdata)
61{ 64{
62 return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq, 65 return dbx500_add_platform_device_4k1irq("nmk-i2c", id, base, irq,
@@ -74,14 +77,14 @@ dbx500_add_msp_i2s(int id, resource_size_t base, int irq,
74} 77}
75 78
76static inline struct amba_device * 79static inline struct amba_device *
77dbx500_add_rtc(resource_size_t base, int irq) 80dbx500_add_rtc(struct device *parent, resource_size_t base, int irq)
78{ 81{
79 return dbx500_add_amba_device("rtc-pl031", base, irq, NULL, 0); 82 return dbx500_add_amba_device(parent, "rtc-pl031", base, irq, NULL, 0);
80} 83}
81 84
82struct nmk_gpio_platform_data; 85struct nmk_gpio_platform_data;
83 86
84void dbx500_add_gpios(resource_size_t *base, int num, int irq, 87void dbx500_add_gpios(struct device *parent, resource_size_t *base, int num,
85 struct nmk_gpio_platform_data *pdata); 88 int irq, struct nmk_gpio_platform_data *pdata);
86 89
87#endif 90#endif
diff --git a/arch/arm/mach-ux500/devices-db5500.h b/arch/arm/mach-ux500/devices-db5500.h
index 0c4bccd02b9..e70955502c3 100644
--- a/arch/arm/mach-ux500/devices-db5500.h
+++ b/arch/arm/mach-ux500/devices-db5500.h
@@ -10,70 +10,90 @@
10 10
11#include "devices-common.h" 11#include "devices-common.h"
12 12
13#define db5500_add_i2c1(pdata) \ 13#define db5500_add_i2c1(parent, pdata) \
14 dbx500_add_i2c(1, U5500_I2C1_BASE, IRQ_DB5500_I2C1, pdata) 14 dbx500_add_i2c(parent, 1, U5500_I2C1_BASE, IRQ_DB5500_I2C1, pdata)
15#define db5500_add_i2c2(pdata) \ 15#define db5500_add_i2c2(parent, pdata) \
16 dbx500_add_i2c(2, U5500_I2C2_BASE, IRQ_DB5500_I2C2, pdata) 16 dbx500_add_i2c(parent, 2, U5500_I2C2_BASE, IRQ_DB5500_I2C2, pdata)
17#define db5500_add_i2c3(pdata) \ 17#define db5500_add_i2c3(parent, pdata) \
18 dbx500_add_i2c(3, U5500_I2C3_BASE, IRQ_DB5500_I2C3, pdata) 18 dbx500_add_i2c(parent, 3, U5500_I2C3_BASE, IRQ_DB5500_I2C3, pdata)
19 19
20#define db5500_add_msp0_i2s(pdata) \ 20#define db5500_add_msp0_spi(parent, pdata) \
21 dbx500_add_msp_i2s(0, U5500_MSP0_BASE, IRQ_DB5500_MSP0, pdata) 21 dbx500_add_msp_spi(parent, "msp0", U5500_MSP0_BASE, \
22#define db5500_add_msp1_i2s(pdata) \ 22 IRQ_DB5500_MSP0, pdata)
23 dbx500_add_msp_i2s(1, U5500_MSP1_BASE, IRQ_DB5500_MSP1, pdata) 23#define db5500_add_msp1_spi(parent, pdata) \
24#define db5500_add_msp2_i2s(pdata) \ 24 dbx500_add_msp_spi(parent, "msp1", U5500_MSP1_BASE, \
25 dbx500_add_msp_i2s(2, U5500_MSP2_BASE, IRQ_DB5500_MSP2, pdata) 25 IRQ_DB5500_MSP1, pdata)
26#define db5500_add_msp2_spi(parent, pdata) \
27 dbx500_add_msp_spi(parent, "msp2", U5500_MSP2_BASE, \
28 IRQ_DB5500_MSP2, pdata)
26 29
27#define db5500_add_msp0_spi(pdata) \ 30#define db5500_add_msp0_spi(parent, pdata) \
28 dbx500_add_msp_spi("msp0", U5500_MSP0_BASE, IRQ_DB5500_MSP0, pdata) 31 dbx500_add_msp_spi(parent, "msp0", U5500_MSP0_BASE, \
29#define db5500_add_msp1_spi(pdata) \ 32 IRQ_DB5500_MSP0, pdata)
30 dbx500_add_msp_spi("msp1", U5500_MSP1_BASE, IRQ_DB5500_MSP1, pdata) 33#define db5500_add_msp1_spi(parent, pdata) \
31#define db5500_add_msp2_spi(pdata) \ 34 dbx500_add_msp_spi(parent, "msp1", U5500_MSP1_BASE, \
32 dbx500_add_msp_spi("msp2", U5500_MSP2_BASE, IRQ_DB5500_MSP2, pdata) 35 IRQ_DB5500_MSP1, pdata)
36#define db5500_add_msp2_spi(parent, pdata) \
37 dbx500_add_msp_spi(parent, "msp2", U5500_MSP2_BASE, \
38 IRQ_DB5500_MSP2, pdata)
33 39
34#define db5500_add_rtc() \ 40#define db5500_add_rtc(parent) \
35 dbx500_add_rtc(U5500_RTC_BASE, IRQ_DB5500_RTC); 41 dbx500_add_rtc(parent, U5500_RTC_BASE, IRQ_DB5500_RTC);
36 42
37#define db5500_add_usb(rx_cfg, tx_cfg) \ 43#define db5500_add_usb(parent, rx_cfg, tx_cfg) \
38 ux500_add_usb(U5500_USBOTG_BASE, IRQ_DB5500_USBOTG, rx_cfg, tx_cfg) 44 ux500_add_usb(parent, U5500_USBOTG_BASE, \
45 IRQ_DB5500_USBOTG, rx_cfg, tx_cfg)
39 46
40#define db5500_add_sdi0(pdata) \ 47#define db5500_add_sdi0(parent, pdata) \
41 dbx500_add_sdi("sdi0", U5500_SDI0_BASE, IRQ_DB5500_SDMMC0, pdata, \ 48 dbx500_add_sdi(parent, "sdi0", U5500_SDI0_BASE, \
49 IRQ_DB5500_SDMMC0, pdata, \
42 0x10480180) 50 0x10480180)
43#define db5500_add_sdi1(pdata) \ 51#define db5500_add_sdi1(parent, pdata) \
44 dbx500_add_sdi("sdi1", U5500_SDI1_BASE, IRQ_DB5500_SDMMC1, pdata, \ 52 dbx500_add_sdi(parent, "sdi1", U5500_SDI1_BASE, \
53 IRQ_DB5500_SDMMC1, pdata, \
45 0x10480180) 54 0x10480180)
46#define db5500_add_sdi2(pdata) \ 55#define db5500_add_sdi2(parent, pdata) \
47 dbx500_add_sdi("sdi2", U5500_SDI2_BASE, IRQ_DB5500_SDMMC2, pdata \ 56 dbx500_add_sdi(parent, "sdi2", U5500_SDI2_BASE, \
57 IRQ_DB5500_SDMMC2, pdata \
48 0x10480180) 58 0x10480180)
49#define db5500_add_sdi3(pdata) \ 59#define db5500_add_sdi3(parent, pdata) \
50 dbx500_add_sdi("sdi3", U5500_SDI3_BASE, IRQ_DB5500_SDMMC3, pdata \ 60 dbx500_add_sdi(parent, "sdi3", U5500_SDI3_BASE, \
61 IRQ_DB5500_SDMMC3, pdata \
51 0x10480180) 62 0x10480180)
52#define db5500_add_sdi4(pdata) \ 63#define db5500_add_sdi4(parent, pdata) \
53 dbx500_add_sdi("sdi4", U5500_SDI4_BASE, IRQ_DB5500_SDMMC4, pdata \ 64 dbx500_add_sdi(parent, "sdi4", U5500_SDI4_BASE, \
65 IRQ_DB5500_SDMMC4, pdata \
54 0x10480180) 66 0x10480180)
55 67
56/* This one has a bad peripheral ID in the U5500 silicon */ 68/* This one has a bad peripheral ID in the U5500 silicon */
57#define db5500_add_spi0(pdata) \ 69#define db5500_add_spi0(parent, pdata) \
58 dbx500_add_spi("spi0", U5500_SPI0_BASE, IRQ_DB5500_SPI0, pdata, \ 70 dbx500_add_spi(parent, "spi0", U5500_SPI0_BASE, \
71 IRQ_DB5500_SPI0, pdata, \
59 0x10080023) 72 0x10080023)
60#define db5500_add_spi1(pdata) \ 73#define db5500_add_spi1(parent, pdata) \
61 dbx500_add_spi("spi1", U5500_SPI1_BASE, IRQ_DB5500_SPI1, pdata, \ 74 dbx500_add_spi(parent, "spi1", U5500_SPI1_BASE, \
75 IRQ_DB5500_SPI1, pdata, \
62 0x10080023) 76 0x10080023)
63#define db5500_add_spi2(pdata) \ 77#define db5500_add_spi2(parent, pdata) \
64 dbx500_add_spi("spi2", U5500_SPI2_BASE, IRQ_DB5500_SPI2, pdata \ 78 dbx500_add_spi(parent, "spi2", U5500_SPI2_BASE, \
79 IRQ_DB5500_SPI2, pdata \
65 0x10080023) 80 0x10080023)
66#define db5500_add_spi3(pdata) \ 81#define db5500_add_spi3(parent, pdata) \
67 dbx500_add_spi("spi3", U5500_SPI3_BASE, IRQ_DB5500_SPI3, pdata \ 82 dbx500_add_spi(parent, "spi3", U5500_SPI3_BASE, \
83 IRQ_DB5500_SPI3, pdata \
68 0x10080023) 84 0x10080023)
69 85
70#define db5500_add_uart0(plat) \ 86#define db5500_add_uart0(parent, plat) \
71 dbx500_add_uart("uart0", U5500_UART0_BASE, IRQ_DB5500_UART0, plat) 87 dbx500_add_uart(parent, "uart0", U5500_UART0_BASE, \
72#define db5500_add_uart1(plat) \ 88 IRQ_DB5500_UART0, plat)
73 dbx500_add_uart("uart1", U5500_UART1_BASE, IRQ_DB5500_UART1, plat) 89#define db5500_add_uart1(parent, plat) \
74#define db5500_add_uart2(plat) \ 90 dbx500_add_uart(parent, "uart1", U5500_UART1_BASE, \
75 dbx500_add_uart("uart2", U5500_UART2_BASE, IRQ_DB5500_UART2, plat) 91 IRQ_DB5500_UART1, plat)
76#define db5500_add_uart3(plat) \ 92#define db5500_add_uart2(parent, plat) \
77 dbx500_add_uart("uart3", U5500_UART3_BASE, IRQ_DB5500_UART3, plat) 93 dbx500_add_uart(parent, "uart2", U5500_UART2_BASE, \
94 IRQ_DB5500_UART2, plat)
95#define db5500_add_uart3(parent, plat) \
96 dbx500_add_uart(parent, "uart3", U5500_UART3_BASE, \
97 IRQ_DB5500_UART3, plat)
78 98
79#endif 99#endif
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h
index cbd4a9ae810..9bd08ad7004 100644
--- a/arch/arm/mach-ux500/devices-db8500.h
+++ b/arch/arm/mach-ux500/devices-db8500.h
@@ -14,7 +14,9 @@ struct ske_keypad_platform_data;
14struct pl022_ssp_controller; 14struct pl022_ssp_controller;
15 15
16static inline struct platform_device * 16static inline struct platform_device *
17db8500_add_ske_keypad(struct ske_keypad_platform_data *pdata) 17db8500_add_ske_keypad(struct device *parent,
18 struct ske_keypad_platform_data *pdata,
19 size_t size)
18{ 20{
19 return dbx500_add_platform_device_4k1irq("nmk-ske-keypad", -1, 21 return dbx500_add_platform_device_4k1irq("nmk-ske-keypad", -1,
20 U8500_SKE_BASE, 22 U8500_SKE_BASE,
@@ -22,80 +24,100 @@ db8500_add_ske_keypad(struct ske_keypad_platform_data *pdata)
22} 24}
23 25
24static inline struct amba_device * 26static inline struct amba_device *
25db8500_add_ssp(const char *name, resource_size_t base, int irq, 27db8500_add_ssp(struct device *parent, const char *name, resource_size_t base,
26 struct pl022_ssp_controller *pdata) 28 int irq, struct pl022_ssp_controller *pdata)
27{ 29{
28 return dbx500_add_amba_device(name, base, irq, pdata, 0); 30 return dbx500_add_amba_device(parent, name, base, irq, pdata, 0);
29} 31}
30 32
31 33
32#define db8500_add_i2c0(pdata) \ 34#define db8500_add_i2c0(parent, pdata) \
33 dbx500_add_i2c(0, U8500_I2C0_BASE, IRQ_DB8500_I2C0, pdata) 35 dbx500_add_i2c(parent, 0, U8500_I2C0_BASE, IRQ_DB8500_I2C0, pdata)
34#define db8500_add_i2c1(pdata) \ 36#define db8500_add_i2c1(parent, pdata) \
35 dbx500_add_i2c(1, U8500_I2C1_BASE, IRQ_DB8500_I2C1, pdata) 37 dbx500_add_i2c(parent, 1, U8500_I2C1_BASE, IRQ_DB8500_I2C1, pdata)
36#define db8500_add_i2c2(pdata) \ 38#define db8500_add_i2c2(parent, pdata) \
37 dbx500_add_i2c(2, U8500_I2C2_BASE, IRQ_DB8500_I2C2, pdata) 39 dbx500_add_i2c(parent, 2, U8500_I2C2_BASE, IRQ_DB8500_I2C2, pdata)
38#define db8500_add_i2c3(pdata) \ 40#define db8500_add_i2c3(parent, pdata) \
39 dbx500_add_i2c(3, U8500_I2C3_BASE, IRQ_DB8500_I2C3, pdata) 41 dbx500_add_i2c(parent, 3, U8500_I2C3_BASE, IRQ_DB8500_I2C3, pdata)
40#define db8500_add_i2c4(pdata) \ 42#define db8500_add_i2c4(parent, pdata) \
41 dbx500_add_i2c(4, U8500_I2C4_BASE, IRQ_DB8500_I2C4, pdata) 43 dbx500_add_i2c(parent, 4, U8500_I2C4_BASE, IRQ_DB8500_I2C4, pdata)
42 44
43#define db8500_add_msp0_i2s(pdata) \ 45#define db8500_add_msp0_i2s(parent, pdata) \
44 dbx500_add_msp_i2s(0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, pdata) 46 dbx500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, pdata)
45#define db8500_add_msp1_i2s(pdata) \ 47#define db8500_add_msp1_i2s(parent, pdata) \
46 dbx500_add_msp_i2s(1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, pdata) 48 dbx500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, pdata)
47#define db8500_add_msp2_i2s(pdata) \ 49#define db8500_add_msp2_i2s(parent, pdata) \
48 dbx500_add_msp_i2s(2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, pdata) 50 dbx500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, pdata)
49#define db8500_add_msp3_i2s(pdata) \ 51#define db8500_add_msp3_i2s(parent, pdata) \
50 dbx500_add_msp_i2s(3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, pdata) 52 dbx500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, pdata)
51 53
52#define db8500_add_msp0_spi(pdata) \ 54#define db8500_add_msp0_spi(parent, pdata) \
53 dbx500_add_msp_spi("msp0", U8500_MSP0_BASE, IRQ_DB8500_MSP0, pdata) 55 dbx500_add_msp_spi(parent, "msp0", U8500_MSP0_BASE, \
54#define db8500_add_msp1_spi(pdata) \ 56 IRQ_DB8500_MSP0, pdata)
55 dbx500_add_msp_spi("msp1", U8500_MSP1_BASE, IRQ_DB8500_MSP1, pdata) 57#define db8500_add_msp1_spi(parent, pdata) \
56#define db8500_add_msp2_spi(pdata) \ 58 dbx500_add_msp_spi(parent, "msp1", U8500_MSP1_BASE, \
57 dbx500_add_msp_spi("msp2", U8500_MSP2_BASE, IRQ_DB8500_MSP2, pdata) 59 IRQ_DB8500_MSP1, pdata)
58#define db8500_add_msp3_spi(pdata) \ 60#define db8500_add_msp2_spi(parent, pdata) \
59 dbx500_add_msp_spi("msp3", U8500_MSP3_BASE, IRQ_DB8500_MSP1, pdata) 61 dbx500_add_msp_spi(parent, "msp2", U8500_MSP2_BASE, \
60 62 IRQ_DB8500_MSP2, pdata)
61#define db8500_add_rtc() \ 63#define db8500_add_msp3_spi(parent, pdata) \
62 dbx500_add_rtc(U8500_RTC_BASE, IRQ_DB8500_RTC); 64 dbx500_add_msp_spi(parent, "msp3", U8500_MSP3_BASE, \
63 65 IRQ_DB8500_MSP1, pdata)
64#define db8500_add_usb(rx_cfg, tx_cfg) \ 66
65 ux500_add_usb(U8500_USBOTG_BASE, IRQ_DB8500_USBOTG, rx_cfg, tx_cfg) 67#define db8500_add_rtc(parent) \
66 68 dbx500_add_rtc(parent, U8500_RTC_BASE, IRQ_DB8500_RTC);
67#define db8500_add_sdi0(pdata, pid) \ 69
68 dbx500_add_sdi("sdi0", U8500_SDI0_BASE, IRQ_DB8500_SDMMC0, pdata, pid) 70#define db8500_add_usb(parent, rx_cfg, tx_cfg) \
69#define db8500_add_sdi1(pdata, pid) \ 71 ux500_add_usb(parent, U8500_USBOTG_BASE, \
70 dbx500_add_sdi("sdi1", U8500_SDI1_BASE, IRQ_DB8500_SDMMC1, pdata, pid) 72 IRQ_DB8500_USBOTG, rx_cfg, tx_cfg)
71#define db8500_add_sdi2(pdata, pid) \ 73
72 dbx500_add_sdi("sdi2", U8500_SDI2_BASE, IRQ_DB8500_SDMMC2, pdata, pid) 74#define db8500_add_sdi0(parent, pdata, pid) \
73#define db8500_add_sdi3(pdata, pid) \ 75 dbx500_add_sdi(parent, "sdi0", U8500_SDI0_BASE, \
74 dbx500_add_sdi("sdi3", U8500_SDI3_BASE, IRQ_DB8500_SDMMC3, pdata, pid) 76 IRQ_DB8500_SDMMC0, pdata, pid)
75#define db8500_add_sdi4(pdata, pid) \ 77#define db8500_add_sdi1(parent, pdata, pid) \
76 dbx500_add_sdi("sdi4", U8500_SDI4_BASE, IRQ_DB8500_SDMMC4, pdata, pid) 78 dbx500_add_sdi(parent, "sdi1", U8500_SDI1_BASE, \
77#define db8500_add_sdi5(pdata, pid) \ 79 IRQ_DB8500_SDMMC1, pdata, pid)
78 dbx500_add_sdi("sdi5", U8500_SDI5_BASE, IRQ_DB8500_SDMMC5, pdata, pid) 80#define db8500_add_sdi2(parent, pdata, pid) \
79 81 dbx500_add_sdi(parent, "sdi2", U8500_SDI2_BASE, \
80#define db8500_add_ssp0(pdata) \ 82 IRQ_DB8500_SDMMC2, pdata, pid)
81 db8500_add_ssp("ssp0", U8500_SSP0_BASE, IRQ_DB8500_SSP0, pdata) 83#define db8500_add_sdi3(parent, pdata, pid) \
82#define db8500_add_ssp1(pdata) \ 84 dbx500_add_sdi(parent, "sdi3", U8500_SDI3_BASE, \
83 db8500_add_ssp("ssp1", U8500_SSP1_BASE, IRQ_DB8500_SSP1, pdata) 85 IRQ_DB8500_SDMMC3, pdata, pid)
84 86#define db8500_add_sdi4(parent, pdata, pid) \
85#define db8500_add_spi0(pdata) \ 87 dbx500_add_sdi(parent, "sdi4", U8500_SDI4_BASE, \
86 dbx500_add_spi("spi0", U8500_SPI0_BASE, IRQ_DB8500_SPI0, pdata, 0) 88 IRQ_DB8500_SDMMC4, pdata, pid)
87#define db8500_add_spi1(pdata) \ 89#define db8500_add_sdi5(parent, pdata, pid) \
88 dbx500_add_spi("spi1", U8500_SPI1_BASE, IRQ_DB8500_SPI1, pdata, 0) 90 dbx500_add_sdi(parent, "sdi5", U8500_SDI5_BASE, \
89#define db8500_add_spi2(pdata) \ 91 IRQ_DB8500_SDMMC5, pdata, pid)
90 dbx500_add_spi("spi2", U8500_SPI2_BASE, IRQ_DB8500_SPI2, pdata, 0) 92
91#define db8500_add_spi3(pdata) \ 93#define db8500_add_ssp0(parent, pdata) \
92 dbx500_add_spi("spi3", U8500_SPI3_BASE, IRQ_DB8500_SPI3, pdata, 0) 94 db8500_add_ssp(parent, "ssp0", U8500_SSP0_BASE, \
93 95 IRQ_DB8500_SSP0, pdata)
94#define db8500_add_uart0(pdata) \ 96#define db8500_add_ssp1(parent, pdata) \
95 dbx500_add_uart("uart0", U8500_UART0_BASE, IRQ_DB8500_UART0, pdata) 97 db8500_add_ssp(parent, "ssp1", U8500_SSP1_BASE, \
96#define db8500_add_uart1(pdata) \ 98 IRQ_DB8500_SSP1, pdata)
97 dbx500_add_uart("uart1", U8500_UART1_BASE, IRQ_DB8500_UART1, pdata) 99
98#define db8500_add_uart2(pdata) \ 100#define db8500_add_spi0(parent, pdata) \
99 dbx500_add_uart("uart2", U8500_UART2_BASE, IRQ_DB8500_UART2, pdata) 101 dbx500_add_spi(parent, "spi0", U8500_SPI0_BASE, \
102 IRQ_DB8500_SPI0, pdata, 0)
103#define db8500_add_spi1(parent, pdata) \
104 dbx500_add_spi(parent, "spi1", U8500_SPI1_BASE, \
105 IRQ_DB8500_SPI1, pdata, 0)
106#define db8500_add_spi2(parent, pdata) \
107 dbx500_add_spi(parent, "spi2", U8500_SPI2_BASE, \
108 IRQ_DB8500_SPI2, pdata, 0)
109#define db8500_add_spi3(parent, pdata) \
110 dbx500_add_spi(parent, "spi3", U8500_SPI3_BASE, \
111 IRQ_DB8500_SPI3, pdata, 0)
112
113#define db8500_add_uart0(parent, pdata) \
114 dbx500_add_uart(parent, "uart0", U8500_UART0_BASE, \
115 IRQ_DB8500_UART0, pdata)
116#define db8500_add_uart1(parent, pdata) \
117 dbx500_add_uart(parent, "uart1", U8500_UART1_BASE, \
118 IRQ_DB8500_UART1, pdata)
119#define db8500_add_uart2(parent, pdata) \
120 dbx500_add_uart(parent, "uart2", U8500_UART2_BASE, \
121 IRQ_DB8500_UART2, pdata)
100 122
101#endif 123#endif
diff --git a/arch/arm/mach-ux500/dma-db5500.c b/arch/arm/mach-ux500/dma-db5500.c
index 1cfab68ae41..41e9470fa0e 100644
--- a/arch/arm/mach-ux500/dma-db5500.c
+++ b/arch/arm/mach-ux500/dma-db5500.c
@@ -125,10 +125,11 @@ static struct platform_device dma40_device = {
125 .resource = dma40_resources 125 .resource = dma40_resources
126}; 126};
127 127
128void __init db5500_dma_init(void) 128void __init db5500_dma_init(struct device *parent)
129{ 129{
130 int ret; 130 int ret;
131 131
132 dma40_device.dev.parent = parent;
132 ret = platform_device_register(&dma40_device); 133 ret = platform_device_register(&dma40_device);
133 if (ret) 134 if (ret)
134 dev_err(&dma40_device.dev, "unable to register device: %d\n", ret); 135 dev_err(&dma40_device.dev, "unable to register device: %d\n", ret);
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index a7d363fdb4c..e46b8b12056 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -18,14 +18,14 @@ void __init ux500_map_io(void);
18extern void __init u5500_map_io(void); 18extern void __init u5500_map_io(void);
19extern void __init u8500_map_io(void); 19extern void __init u8500_map_io(void);
20 20
21extern void __init u5500_init_devices(void); 21extern struct device * __init u5500_init_devices(void);
22extern void __init u8500_init_devices(void); 22extern struct device * __init u8500_init_devices(void);
23 23
24extern void __init ux500_init_irq(void); 24extern void __init ux500_init_irq(void);
25 25
26extern void __init u5500_sdi_init(void); 26extern void __init u5500_sdi_init(struct device *parent);
27 27
28extern void __init db5500_dma_init(void); 28extern void __init db5500_dma_init(struct device *parent);
29 29
30/* We re-use nomadik_timer for this platform */ 30/* We re-use nomadik_timer for this platform */
31extern void nmdk_timer_init(void); 31extern void nmdk_timer_init(void);
diff --git a/arch/arm/mach-ux500/include/mach/usb.h b/arch/arm/mach-ux500/include/mach/usb.h
index d3739d41881..4c1cc50a595 100644
--- a/arch/arm/mach-ux500/include/mach/usb.h
+++ b/arch/arm/mach-ux500/include/mach/usb.h
@@ -20,6 +20,6 @@ struct ux500_musb_board_data {
20 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 20 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
21}; 21};
22 22
23void ux500_add_usb(resource_size_t base, int irq, int *dma_rx_cfg, 23void ux500_add_usb(struct device *parent, resource_size_t base,
24 int *dma_tx_cfg); 24 int irq, int *dma_rx_cfg, int *dma_tx_cfg);
25#endif 25#endif
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c
index 9f9e1c20306..5329a2cc680 100644
--- a/arch/arm/mach-ux500/usb.c
+++ b/arch/arm/mach-ux500/usb.c
@@ -140,8 +140,8 @@ static inline void ux500_usb_dma_update_tx_ch_config(int *dst_dev_type)
140 musb_dma_tx_ch[idx].dst_dev_type = dst_dev_type[idx]; 140 musb_dma_tx_ch[idx].dst_dev_type = dst_dev_type[idx];
141} 141}
142 142
143void ux500_add_usb(resource_size_t base, int irq, int *dma_rx_cfg, 143void ux500_add_usb(struct device *parent, resource_size_t base, int irq,
144 int *dma_tx_cfg) 144 int *dma_rx_cfg, int *dma_tx_cfg)
145{ 145{
146 ux500_musb_device.resource[0].start = base; 146 ux500_musb_device.resource[0].start = base;
147 ux500_musb_device.resource[0].end = base + SZ_64K - 1; 147 ux500_musb_device.resource[0].end = base + SZ_64K - 1;