diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-01-07 06:35:21 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-01-21 03:43:15 -0500 |
commit | fbdd9a70c21002c6ce50cd653380641a8b575eff (patch) | |
tree | 4ab0c95aaac6f1c0a24173452e3bbb1f8a275794 | |
parent | 10f0fc17f54527520959298f947c9b9e80643f84 (diff) |
sh: ap325rxa MMC support using spi_gpio and mmc_spi
This patch adds CN3 MMC support for ap325rxa using the mmc_spi
driver on top of the bitbanging spi_gpio driver.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/boards/board-ap325rxa.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 25a3306ce8dc..caf4c33f4e84 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/smsc911x.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> |
@@ -317,6 +319,20 @@ static struct platform_device ceu_device = { | |||
317 | }, | 319 | }, |
318 | }; | 320 | }; |
319 | 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 | |||
320 | static struct platform_device *ap325rxa_devices[] __initdata = { | 336 | static struct platform_device *ap325rxa_devices[] __initdata = { |
321 | &smsc9118_device, | 337 | &smsc9118_device, |
322 | &ap325rxa_nor_flash_device, | 338 | &ap325rxa_nor_flash_device, |
@@ -326,6 +342,7 @@ static struct platform_device *ap325rxa_devices[] __initdata = { | |||
326 | &camera_device, | 342 | &camera_device, |
327 | #endif | 343 | #endif |
328 | &nand_flash_device, | 344 | &nand_flash_device, |
345 | &sdcard_cn3_device, | ||
329 | }; | 346 | }; |
330 | 347 | ||
331 | static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | 348 | static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { |
@@ -334,6 +351,15 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | |||
334 | }, | 351 | }, |
335 | }; | 352 | }; |
336 | 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 | |||
337 | static int __init ap325rxa_devices_setup(void) | 363 | static int __init ap325rxa_devices_setup(void) |
338 | { | 364 | { |
339 | /* LD3 and LD4 LEDs */ | 365 | /* LD3 and LD4 LEDs */ |
@@ -431,6 +457,9 @@ static int __init ap325rxa_devices_setup(void) | |||
431 | i2c_register_board_info(0, ap325rxa_i2c_devices, | 457 | i2c_register_board_info(0, ap325rxa_i2c_devices, |
432 | ARRAY_SIZE(ap325rxa_i2c_devices)); | 458 | ARRAY_SIZE(ap325rxa_i2c_devices)); |
433 | 459 | ||
460 | spi_register_board_info(ap325rxa_spi_devices, | ||
461 | ARRAY_SIZE(ap325rxa_spi_devices)); | ||
462 | |||
434 | return platform_add_devices(ap325rxa_devices, | 463 | return platform_add_devices(ap325rxa_devices, |
435 | ARRAY_SIZE(ap325rxa_devices)); | 464 | ARRAY_SIZE(ap325rxa_devices)); |
436 | } | 465 | } |