diff options
author | Magnus Damm <damm@opensource.se> | 2009-10-01 22:22:43 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-25 21:37:05 -0400 |
commit | 2e3fc56c8d42ef7e0040a61f55295e3826c9d7b2 (patch) | |
tree | d2b9b2a16d23aaf56550a97ccffac0d30ad60567 | |
parent | 6d522b05984404d6c22cc5dfd2c989bbcf3df8c9 (diff) |
sh: SDHI platform data to the Migo-R board
Convert the Migo-R board to use sh_mobile_sdhi for the
SD Card connected to CN9 instead of mmc_spi.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/boards/mach-migor/setup.c | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 6ed1fd32369e..8e911360c91e 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -18,8 +18,6 @@ | |||
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 <video/sh_mobile_lcdc.h> |
24 | #include <media/sh_mobile_ceu.h> | 22 | #include <media/sh_mobile_ceu.h> |
25 | #include <media/ov772x.h> | 23 | #include <media/ov772x.h> |
@@ -390,17 +388,25 @@ static struct platform_device migor_ceu_device = { | |||
390 | }, | 388 | }, |
391 | }; | 389 | }; |
392 | 390 | ||
393 | struct spi_gpio_platform_data sdcard_cn9_platform_data = { | 391 | static struct resource sdhi_cn9_resources[] = { |
394 | .sck = GPIO_PTD0, | 392 | [0] = { |
395 | .mosi = GPIO_PTD1, | 393 | .name = "SDHI", |
396 | .miso = GPIO_PTD2, | 394 | .start = 0x04ce0000, |
397 | .num_chipselect = 1, | 395 | .end = 0x04ce01ff, |
396 | .flags = IORESOURCE_MEM, | ||
397 | }, | ||
398 | [1] = { | ||
399 | .start = 101, | ||
400 | .flags = IORESOURCE_IRQ, | ||
401 | }, | ||
398 | }; | 402 | }; |
399 | 403 | ||
400 | static struct platform_device sdcard_cn9_device = { | 404 | static struct platform_device sdhi_cn9_device = { |
401 | .name = "spi_gpio", | 405 | .name = "sh_mobile_sdhi", |
402 | .dev = { | 406 | .num_resources = ARRAY_SIZE(sdhi_cn9_resources), |
403 | .platform_data = &sdcard_cn9_platform_data, | 407 | .resource = sdhi_cn9_resources, |
408 | .archdata = { | ||
409 | .hwblk_id = HWBLK_SDHI, | ||
404 | }, | 410 | }, |
405 | }; | 411 | }; |
406 | 412 | ||
@@ -467,20 +473,11 @@ static struct platform_device *migor_devices[] __initdata = { | |||
467 | &migor_ceu_device, | 473 | &migor_ceu_device, |
468 | &migor_nor_flash_device, | 474 | &migor_nor_flash_device, |
469 | &migor_nand_flash_device, | 475 | &migor_nand_flash_device, |
470 | &sdcard_cn9_device, | 476 | &sdhi_cn9_device, |
471 | &migor_camera[0], | 477 | &migor_camera[0], |
472 | &migor_camera[1], | 478 | &migor_camera[1], |
473 | }; | 479 | }; |
474 | 480 | ||
475 | static struct spi_board_info migor_spi_devices[] = { | ||
476 | { | ||
477 | .modalias = "mmc_spi", | ||
478 | .max_speed_hz = 5000000, | ||
479 | .chip_select = 0, | ||
480 | .controller_data = (void *) GPIO_PTD5, | ||
481 | }, | ||
482 | }; | ||
483 | |||
484 | static int __init migor_devices_setup(void) | 481 | static int __init migor_devices_setup(void) |
485 | { | 482 | { |
486 | 483 | ||
@@ -525,6 +522,16 @@ static int __init migor_devices_setup(void) | |||
525 | gpio_request(GPIO_PTA1, NULL); | 522 | gpio_request(GPIO_PTA1, NULL); |
526 | gpio_direction_input(GPIO_PTA1); | 523 | gpio_direction_input(GPIO_PTA1); |
527 | 524 | ||
525 | /* SDHI */ | ||
526 | gpio_request(GPIO_FN_SDHICD, NULL); | ||
527 | gpio_request(GPIO_FN_SDHIWP, NULL); | ||
528 | gpio_request(GPIO_FN_SDHID3, NULL); | ||
529 | gpio_request(GPIO_FN_SDHID2, NULL); | ||
530 | gpio_request(GPIO_FN_SDHID1, NULL); | ||
531 | gpio_request(GPIO_FN_SDHID0, NULL); | ||
532 | gpio_request(GPIO_FN_SDHICMD, NULL); | ||
533 | gpio_request(GPIO_FN_SDHICLK, NULL); | ||
534 | |||
528 | /* Touch Panel */ | 535 | /* Touch Panel */ |
529 | gpio_request(GPIO_FN_IRQ6, NULL); | 536 | gpio_request(GPIO_FN_IRQ6, NULL); |
530 | 537 | ||
@@ -612,9 +619,6 @@ static int __init migor_devices_setup(void) | |||
612 | i2c_register_board_info(0, migor_i2c_devices, | 619 | i2c_register_board_info(0, migor_i2c_devices, |
613 | ARRAY_SIZE(migor_i2c_devices)); | 620 | ARRAY_SIZE(migor_i2c_devices)); |
614 | 621 | ||
615 | spi_register_board_info(migor_spi_devices, | ||
616 | ARRAY_SIZE(migor_spi_devices)); | ||
617 | |||
618 | return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); | 622 | return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); |
619 | } | 623 | } |
620 | arch_initcall(migor_devices_setup); | 624 | arch_initcall(migor_devices_setup); |