diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-01-07 06:36:10 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-01-21 03:43:23 -0500 |
commit | 70e5c4f0843c3021a2e95b46edd8925a885d2e31 (patch) | |
tree | 4610bda44f328deb59195745641a7968f541cb8a /arch/sh/boards | |
parent | fbdd9a70c21002c6ce50cd653380641a8b575eff (diff) |
sh: Migo-R MMC support using spi_gpio and mmc_spi.
This patch adds CN9 MMC support for MigoR 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>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/mach-migor/setup.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 53537fec3194..28e56c5809a2 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -18,10 +18,12 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/spi/spi.h> | ||
22 | #include <linux/spi/spi_gpio.h> | ||
23 | #include <video/sh_mobile_lcdc.h> | ||
21 | #include <media/sh_mobile_ceu.h> | 24 | #include <media/sh_mobile_ceu.h> |
22 | #include <media/ov772x.h> | 25 | #include <media/ov772x.h> |
23 | #include <media/tw9910.h> | 26 | #include <media/tw9910.h> |
24 | #include <video/sh_mobile_lcdc.h> | ||
25 | #include <asm/clock.h> | 27 | #include <asm/clock.h> |
26 | #include <asm/machvec.h> | 28 | #include <asm/machvec.h> |
27 | #include <asm/io.h> | 29 | #include <asm/io.h> |
@@ -395,6 +397,20 @@ static struct tw9910_video_info tw9910_info = { | |||
395 | } | 397 | } |
396 | }; | 398 | }; |
397 | 399 | ||
400 | struct spi_gpio_platform_data sdcard_cn9_platform_data = { | ||
401 | .sck = GPIO_PTD0, | ||
402 | .mosi = GPIO_PTD1, | ||
403 | .miso = GPIO_PTD2, | ||
404 | .num_chipselect = 1, | ||
405 | }; | ||
406 | |||
407 | static struct platform_device sdcard_cn9_device = { | ||
408 | .name = "spi_gpio", | ||
409 | .dev = { | ||
410 | .platform_data = &sdcard_cn9_platform_data, | ||
411 | }, | ||
412 | }; | ||
413 | |||
398 | static struct platform_device *migor_devices[] __initdata = { | 414 | static struct platform_device *migor_devices[] __initdata = { |
399 | &smc91x_eth_device, | 415 | &smc91x_eth_device, |
400 | &sh_keysc_device, | 416 | &sh_keysc_device, |
@@ -402,6 +418,7 @@ static struct platform_device *migor_devices[] __initdata = { | |||
402 | &migor_ceu_device, | 418 | &migor_ceu_device, |
403 | &migor_nor_flash_device, | 419 | &migor_nor_flash_device, |
404 | &migor_nand_flash_device, | 420 | &migor_nand_flash_device, |
421 | &sdcard_cn9_device, | ||
405 | }; | 422 | }; |
406 | 423 | ||
407 | static struct i2c_board_info migor_i2c_devices[] = { | 424 | static struct i2c_board_info migor_i2c_devices[] = { |
@@ -422,6 +439,15 @@ static struct i2c_board_info migor_i2c_devices[] = { | |||
422 | }, | 439 | }, |
423 | }; | 440 | }; |
424 | 441 | ||
442 | static struct spi_board_info migor_spi_devices[] = { | ||
443 | { | ||
444 | .modalias = "mmc_spi", | ||
445 | .max_speed_hz = 5000000, | ||
446 | .chip_select = 0, | ||
447 | .controller_data = (void *) GPIO_PTD5, | ||
448 | }, | ||
449 | }; | ||
450 | |||
425 | static int __init migor_devices_setup(void) | 451 | static int __init migor_devices_setup(void) |
426 | { | 452 | { |
427 | /* Lit D11 LED */ | 453 | /* Lit D11 LED */ |
@@ -544,6 +570,9 @@ static int __init migor_devices_setup(void) | |||
544 | i2c_register_board_info(0, migor_i2c_devices, | 570 | i2c_register_board_info(0, migor_i2c_devices, |
545 | ARRAY_SIZE(migor_i2c_devices)); | 571 | ARRAY_SIZE(migor_i2c_devices)); |
546 | 572 | ||
573 | spi_register_board_info(migor_spi_devices, | ||
574 | ARRAY_SIZE(migor_spi_devices)); | ||
575 | |||
547 | return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); | 576 | return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); |
548 | } | 577 | } |
549 | __initcall(migor_devices_setup); | 578 | __initcall(migor_devices_setup); |