diff options
Diffstat (limited to 'arch/sh/boards/board-ap325rxa.c')
-rw-r--r-- | arch/sh/boards/board-ap325rxa.c | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 1c67cba6e34f..caf4c33f4e84 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c | |||
@@ -18,8 +18,10 @@ | |||
18 | #include <linux/mtd/sh_flctl.h> | 18 | #include <linux/mtd/sh_flctl.h> |
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/smc911x.h> | 21 | #include <linux/smsc911x.h> |
22 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
23 | #include <linux/spi/spi.h> | ||
24 | #include <linux/spi/spi_gpio.h> | ||
23 | #include <media/soc_camera_platform.h> | 25 | #include <media/soc_camera_platform.h> |
24 | #include <media/sh_mobile_ceu.h> | 26 | #include <media/sh_mobile_ceu.h> |
25 | #include <video/sh_mobile_lcdc.h> | 27 | #include <video/sh_mobile_lcdc.h> |
@@ -27,12 +29,14 @@ | |||
27 | #include <asm/clock.h> | 29 | #include <asm/clock.h> |
28 | #include <cpu/sh7723.h> | 30 | #include <cpu/sh7723.h> |
29 | 31 | ||
30 | static struct smc911x_platdata smc911x_info = { | 32 | static struct smsc911x_platform_config smsc911x_config = { |
31 | .flags = SMC911X_USE_32BIT, | 33 | .phy_interface = PHY_INTERFACE_MODE_MII, |
32 | .irq_flags = IRQF_TRIGGER_LOW, | 34 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
35 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
36 | .flags = SMSC911X_USE_32BIT, | ||
33 | }; | 37 | }; |
34 | 38 | ||
35 | static struct resource smc9118_resources[] = { | 39 | static struct resource smsc9118_resources[] = { |
36 | [0] = { | 40 | [0] = { |
37 | .start = 0xb6080000, | 41 | .start = 0xb6080000, |
38 | .end = 0xb60fffff, | 42 | .end = 0xb60fffff, |
@@ -45,13 +49,13 @@ static struct resource smc9118_resources[] = { | |||
45 | } | 49 | } |
46 | }; | 50 | }; |
47 | 51 | ||
48 | static struct platform_device smc9118_device = { | 52 | static struct platform_device smsc9118_device = { |
49 | .name = "smc911x", | 53 | .name = "smsc911x", |
50 | .id = -1, | 54 | .id = -1, |
51 | .num_resources = ARRAY_SIZE(smc9118_resources), | 55 | .num_resources = ARRAY_SIZE(smsc9118_resources), |
52 | .resource = smc9118_resources, | 56 | .resource = smsc9118_resources, |
53 | .dev = { | 57 | .dev = { |
54 | .platform_data = &smc911x_info, | 58 | .platform_data = &smsc911x_config, |
55 | }, | 59 | }, |
56 | }; | 60 | }; |
57 | 61 | ||
@@ -315,8 +319,22 @@ static struct platform_device ceu_device = { | |||
315 | }, | 319 | }, |
316 | }; | 320 | }; |
317 | 321 | ||
322 | struct spi_gpio_platform_data sdcard_cn3_platform_data = { | ||
323 | .sck = GPIO_PTD0, | ||
324 | .mosi = GPIO_PTD1, | ||
325 | .miso = GPIO_PTD2, | ||
326 | .num_chipselect = 1, | ||
327 | }; | ||
328 | |||
329 | static struct platform_device sdcard_cn3_device = { | ||
330 | .name = "spi_gpio", | ||
331 | .dev = { | ||
332 | .platform_data = &sdcard_cn3_platform_data, | ||
333 | }, | ||
334 | }; | ||
335 | |||
318 | static struct platform_device *ap325rxa_devices[] __initdata = { | 336 | static struct platform_device *ap325rxa_devices[] __initdata = { |
319 | &smc9118_device, | 337 | &smsc9118_device, |
320 | &ap325rxa_nor_flash_device, | 338 | &ap325rxa_nor_flash_device, |
321 | &lcdc_device, | 339 | &lcdc_device, |
322 | &ceu_device, | 340 | &ceu_device, |
@@ -324,6 +342,7 @@ static struct platform_device *ap325rxa_devices[] __initdata = { | |||
324 | &camera_device, | 342 | &camera_device, |
325 | #endif | 343 | #endif |
326 | &nand_flash_device, | 344 | &nand_flash_device, |
345 | &sdcard_cn3_device, | ||
327 | }; | 346 | }; |
328 | 347 | ||
329 | static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | 348 | static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { |
@@ -332,6 +351,15 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | |||
332 | }, | 351 | }, |
333 | }; | 352 | }; |
334 | 353 | ||
354 | static struct spi_board_info ap325rxa_spi_devices[] = { | ||
355 | { | ||
356 | .modalias = "mmc_spi", | ||
357 | .max_speed_hz = 5000000, | ||
358 | .chip_select = 0, | ||
359 | .controller_data = (void *) GPIO_PTD5, | ||
360 | }, | ||
361 | }; | ||
362 | |||
335 | static int __init ap325rxa_devices_setup(void) | 363 | static int __init ap325rxa_devices_setup(void) |
336 | { | 364 | { |
337 | /* LD3 and LD4 LEDs */ | 365 | /* LD3 and LD4 LEDs */ |
@@ -429,6 +457,9 @@ static int __init ap325rxa_devices_setup(void) | |||
429 | i2c_register_board_info(0, ap325rxa_i2c_devices, | 457 | i2c_register_board_info(0, ap325rxa_i2c_devices, |
430 | ARRAY_SIZE(ap325rxa_i2c_devices)); | 458 | ARRAY_SIZE(ap325rxa_i2c_devices)); |
431 | 459 | ||
460 | spi_register_board_info(ap325rxa_spi_devices, | ||
461 | ARRAY_SIZE(ap325rxa_spi_devices)); | ||
462 | |||
432 | return platform_add_devices(ap325rxa_devices, | 463 | return platform_add_devices(ap325rxa_devices, |
433 | ARRAY_SIZE(ap325rxa_devices)); | 464 | ARRAY_SIZE(ap325rxa_devices)); |
434 | } | 465 | } |