aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500.c
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2010-09-29 10:16:32 -0400
committerLinus Walleij <linus.walleij@stericsson.com>2010-12-08 07:14:06 -0500
commitfbf1eadf950da1f5f5ed2e454d2f191f90fe1ebe (patch)
treea45df8b1d1e8e5bd76f524cff01dcf9e35d82f0a /arch/arm/mach-ux500/board-mop500.c
parent1bde668c8afa279d81b8f26b2120b906f38f7822 (diff)
ux500: rework device registration
Change the Ux500 devices to be dynamically allocated and added by calling functions instead of referencing structures, thereby allowing 5500 and other derivatives' support to be added without having to duplicate structures, use fixup functions, or use compile-time macros. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 9aeefc403f35..8edc27f41f0d 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -34,6 +34,7 @@
34#include <mach/devices.h> 34#include <mach/devices.h>
35#include <mach/irqs.h> 35#include <mach/irqs.h>
36 36
37#include "devices-db8500.h"
37#include "pins-db8500.h" 38#include "pins-db8500.h"
38#include "board-mop500.h" 39#include "board-mop500.h"
39 40
@@ -192,12 +193,13 @@ U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
192U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 193U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
193U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 194U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
194 195
195static struct amba_device *amba_devs[] __initdata = { 196static void __init mop500_i2c_init(void)
196 &ux500_uart0_device, 197{
197 &ux500_uart1_device, 198 db8500_add_i2c0(&u8500_i2c0_data);
198 &ux500_uart2_device, 199 db8500_add_i2c1(&u8500_i2c1_data);
199 &u8500_ssp0_device, 200 db8500_add_i2c2(&u8500_i2c2_data);
200}; 201 db8500_add_i2c3(&u8500_i2c3_data);
202}
201 203
202static const unsigned int ux500_keymap[] = { 204static const unsigned int ux500_keymap[] = {
203 KEY(2, 5, KEY_END), 205 KEY(2, 5, KEY_END),
@@ -308,36 +310,34 @@ static struct ske_keypad_platform_data ske_keypad_board = {
308 310
309/* add any platform devices here - TODO */ 311/* add any platform devices here - TODO */
310static struct platform_device *platform_devs[] __initdata = { 312static struct platform_device *platform_devs[] __initdata = {
311 &u8500_i2c0_device,
312 &ux500_i2c1_device,
313 &ux500_i2c2_device,
314 &ux500_i2c3_device,
315 &ux500_ske_keypad_device, 313 &ux500_ske_keypad_device,
316}; 314};
317 315
318static void __init u8500_init_machine(void) 316static void __init mop500_spi_init(void)
319{ 317{
320 int i; 318 db8500_add_ssp0(&ssp0_platform_data);
319}
321 320
321static void __init mop500_uart_init(void)
322{
323 db8500_add_uart0();
324 db8500_add_uart1();
325 db8500_add_uart2();
326}
327
328static void __init u8500_init_machine(void)
329{
322 u8500_init_devices(); 330 u8500_init_devices();
323 331
324 nmk_config_pins(mop500_pins, ARRAY_SIZE(mop500_pins)); 332 nmk_config_pins(mop500_pins, ARRAY_SIZE(mop500_pins));
325 333
326 u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data;
327 ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data;
328 ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data;
329 ux500_i2c3_device.dev.platform_data = &u8500_i2c3_data;
330 ux500_ske_keypad_device.dev.platform_data = &ske_keypad_board; 334 ux500_ske_keypad_device.dev.platform_data = &ske_keypad_board;
331
332 u8500_ssp0_device.dev.platform_data = &ssp0_platform_data;
333
334 /* Register the active AMBA devices on this board */
335 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
336 amba_device_register(amba_devs[i], &iomem_resource);
337
338 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); 335 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
339 336
337 mop500_i2c_init();
340 mop500_sdi_init(); 338 mop500_sdi_init();
339 mop500_spi_init();
340 mop500_uart_init();
341 341
342 /* If HW is early drop (ED) or V1.0 then use SPI to access AB8500 */ 342 /* If HW is early drop (ED) or V1.0 then use SPI to access AB8500 */
343 if (cpu_is_u8500ed() || cpu_is_u8500v10()) 343 if (cpu_is_u8500ed() || cpu_is_u8500v10())