aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2009-10-01 22:22:56 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-10-25 21:37:05 -0400
commit17f81473d1439178a1b5c50fdc013771993d6ec4 (patch)
tree8bb763543b38faa0ca311e72718b20c8de40b87b /arch
parent2e3fc56c8d42ef7e0040a61f55295e3826c9d7b2 (diff)
sh: SDHI platform data to the AP325RXA board
Convert the AP325 board to use sh_mobile_sdhi for the SD Card connected to CN3 instead of mmc_spi. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/boards/board-ap325rxa.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c
index 2d080732a964..b95deee35e0f 100644
--- a/arch/sh/boards/board-ap325rxa.c
+++ b/arch/sh/boards/board-ap325rxa.c
@@ -20,8 +20,6 @@
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>
25#include <media/ov772x.h> 23#include <media/ov772x.h>
26#include <media/soc_camera.h> 24#include <media/soc_camera.h>
27#include <media/soc_camera_platform.h> 25#include <media/soc_camera_platform.h>
@@ -409,17 +407,25 @@ static struct platform_device ceu_device = {
409 }, 407 },
410}; 408};
411 409
412struct spi_gpio_platform_data sdcard_cn3_platform_data = { 410static struct resource sdhi0_cn3_resources[] = {
413 .sck = GPIO_PTD0, 411 [0] = {
414 .mosi = GPIO_PTD1, 412 .name = "SDHI0",
415 .miso = GPIO_PTD2, 413 .start = 0x04ce0000,
416 .num_chipselect = 1, 414 .end = 0x04ce01ff,
415 .flags = IORESOURCE_MEM,
416 },
417 [1] = {
418 .start = 101,
419 .flags = IORESOURCE_IRQ,
420 },
417}; 421};
418 422
419static struct platform_device sdcard_cn3_device = { 423static struct platform_device sdhi0_cn3_device = {
420 .name = "spi_gpio", 424 .name = "sh_mobile_sdhi",
421 .dev = { 425 .num_resources = ARRAY_SIZE(sdhi0_cn3_resources),
422 .platform_data = &sdcard_cn3_platform_data, 426 .resource = sdhi0_cn3_resources,
427 .archdata = {
428 .hwblk_id = HWBLK_SDHI0,
423 }, 429 },
424}; 430};
425 431
@@ -470,20 +476,11 @@ static struct platform_device *ap325rxa_devices[] __initdata = {
470 &lcdc_device, 476 &lcdc_device,
471 &ceu_device, 477 &ceu_device,
472 &nand_flash_device, 478 &nand_flash_device,
473 &sdcard_cn3_device, 479 &sdhi0_cn3_device,
474 &ap325rxa_camera[0], 480 &ap325rxa_camera[0],
475 &ap325rxa_camera[1], 481 &ap325rxa_camera[1],
476}; 482};
477 483
478static struct spi_board_info ap325rxa_spi_devices[] = {
479 {
480 .modalias = "mmc_spi",
481 .max_speed_hz = 5000000,
482 .chip_select = 0,
483 .controller_data = (void *) GPIO_PTD5,
484 },
485};
486
487static int __init ap325rxa_devices_setup(void) 484static int __init ap325rxa_devices_setup(void)
488{ 485{
489 /* LD3 and LD4 LEDs */ 486 /* LD3 and LD4 LEDs */
@@ -578,12 +575,19 @@ static int __init ap325rxa_devices_setup(void)
578 575
579 platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20); 576 platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
580 577
578 /* SDHI0 */
579 gpio_request(GPIO_FN_SDHI0CD_PTD, NULL);
580 gpio_request(GPIO_FN_SDHI0WP_PTD, NULL);
581 gpio_request(GPIO_FN_SDHI0D3_PTD, NULL);
582 gpio_request(GPIO_FN_SDHI0D2_PTD, NULL);
583 gpio_request(GPIO_FN_SDHI0D1_PTD, NULL);
584 gpio_request(GPIO_FN_SDHI0D0_PTD, NULL);
585 gpio_request(GPIO_FN_SDHI0CMD_PTD, NULL);
586 gpio_request(GPIO_FN_SDHI0CLK_PTD, NULL);
587
581 i2c_register_board_info(0, ap325rxa_i2c_devices, 588 i2c_register_board_info(0, ap325rxa_i2c_devices,
582 ARRAY_SIZE(ap325rxa_i2c_devices)); 589 ARRAY_SIZE(ap325rxa_i2c_devices));
583 590
584 spi_register_board_info(ap325rxa_spi_devices,
585 ARRAY_SIZE(ap325rxa_spi_devices));
586
587 return platform_add_devices(ap325rxa_devices, 591 return platform_add_devices(ap325rxa_devices,
588 ARRAY_SIZE(ap325rxa_devices)); 592 ARRAY_SIZE(ap325rxa_devices));
589} 593}