Commit 2e3fc56c authored by Magnus Damm's avatar Magnus Damm Committed by Paul Mundt

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: default avatarMagnus Damm <damm@opensource.se>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 6d522b05
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi_gpio.h>
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h> #include <media/sh_mobile_ceu.h>
#include <media/ov772x.h> #include <media/ov772x.h>
...@@ -390,17 +388,25 @@ static struct platform_device migor_ceu_device = { ...@@ -390,17 +388,25 @@ static struct platform_device migor_ceu_device = {
}, },
}; };
struct spi_gpio_platform_data sdcard_cn9_platform_data = { static struct resource sdhi_cn9_resources[] = {
.sck = GPIO_PTD0, [0] = {
.mosi = GPIO_PTD1, .name = "SDHI",
.miso = GPIO_PTD2, .start = 0x04ce0000,
.num_chipselect = 1, .end = 0x04ce01ff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 101,
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device sdcard_cn9_device = { static struct platform_device sdhi_cn9_device = {
.name = "spi_gpio", .name = "sh_mobile_sdhi",
.dev = { .num_resources = ARRAY_SIZE(sdhi_cn9_resources),
.platform_data = &sdcard_cn9_platform_data, .resource = sdhi_cn9_resources,
.archdata = {
.hwblk_id = HWBLK_SDHI,
}, },
}; };
...@@ -467,20 +473,11 @@ static struct platform_device *migor_devices[] __initdata = { ...@@ -467,20 +473,11 @@ static struct platform_device *migor_devices[] __initdata = {
&migor_ceu_device, &migor_ceu_device,
&migor_nor_flash_device, &migor_nor_flash_device,
&migor_nand_flash_device, &migor_nand_flash_device,
&sdcard_cn9_device, &sdhi_cn9_device,
&migor_camera[0], &migor_camera[0],
&migor_camera[1], &migor_camera[1],
}; };
static struct spi_board_info migor_spi_devices[] = {
{
.modalias = "mmc_spi",
.max_speed_hz = 5000000,
.chip_select = 0,
.controller_data = (void *) GPIO_PTD5,
},
};
static int __init migor_devices_setup(void) static int __init migor_devices_setup(void)
{ {
...@@ -525,6 +522,16 @@ static int __init migor_devices_setup(void) ...@@ -525,6 +522,16 @@ static int __init migor_devices_setup(void)
gpio_request(GPIO_PTA1, NULL); gpio_request(GPIO_PTA1, NULL);
gpio_direction_input(GPIO_PTA1); gpio_direction_input(GPIO_PTA1);
/* SDHI */
gpio_request(GPIO_FN_SDHICD, NULL);
gpio_request(GPIO_FN_SDHIWP, NULL);
gpio_request(GPIO_FN_SDHID3, NULL);
gpio_request(GPIO_FN_SDHID2, NULL);
gpio_request(GPIO_FN_SDHID1, NULL);
gpio_request(GPIO_FN_SDHID0, NULL);
gpio_request(GPIO_FN_SDHICMD, NULL);
gpio_request(GPIO_FN_SDHICLK, NULL);
/* Touch Panel */ /* Touch Panel */
gpio_request(GPIO_FN_IRQ6, NULL); gpio_request(GPIO_FN_IRQ6, NULL);
...@@ -612,9 +619,6 @@ static int __init migor_devices_setup(void) ...@@ -612,9 +619,6 @@ static int __init migor_devices_setup(void)
i2c_register_board_info(0, migor_i2c_devices, i2c_register_board_info(0, migor_i2c_devices,
ARRAY_SIZE(migor_i2c_devices)); ARRAY_SIZE(migor_i2c_devices));
spi_register_board_info(migor_spi_devices,
ARRAY_SIZE(migor_spi_devices));
return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices)); return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
} }
arch_initcall(migor_devices_setup); arch_initcall(migor_devices_setup);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment