aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/boards
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-01-07 20:36:10 +0900
committerPaul Mundt <lethal@linux-sh.org>2009-01-21 17:43:23 +0900
commit70e5c4f0843c3021a2e95b46edd8925a885d2e31 (patch)
tree4610bda44f328deb59195745641a7968f541cb8a /arch/sh/boards
parentfbdd9a70c21002c6ce50cd653380641a8b575eff (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.c31
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 53537fec319..28e56c5809a 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -18,10 +18,12 @@
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/gpio.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_gpio.h>
+#include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h>
#include <media/ov772x.h>
#include <media/tw9910.h>
-#include <video/sh_mobile_lcdc.h>
#include <asm/clock.h>
#include <asm/machvec.h>
#include <asm/io.h>
@@ -395,6 +397,20 @@ static struct tw9910_video_info tw9910_info = {
}
};
+struct spi_gpio_platform_data sdcard_cn9_platform_data = {
+ .sck = GPIO_PTD0,
+ .mosi = GPIO_PTD1,
+ .miso = GPIO_PTD2,
+ .num_chipselect = 1,
+};
+
+static struct platform_device sdcard_cn9_device = {
+ .name = "spi_gpio",
+ .dev = {
+ .platform_data = &sdcard_cn9_platform_data,
+ },
+};
+
static struct platform_device *migor_devices[] __initdata = {
&smc91x_eth_device,
&sh_keysc_device,
@@ -402,6 +418,7 @@ static struct platform_device *migor_devices[] __initdata = {
&migor_ceu_device,
&migor_nor_flash_device,
&migor_nand_flash_device,
+ &sdcard_cn9_device,
};
static struct i2c_board_info migor_i2c_devices[] = {
@@ -422,6 +439,15 @@ static struct i2c_board_info migor_i2c_devices[] = {
},
};
+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)
{
/* Lit D11 LED */
@@ -544,6 +570,9 @@ static int __init migor_devices_setup(void)
i2c_register_board_info(0, 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));
}
__initcall(migor_devices_setup);