public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] sh: Migo-R MMC support using spi_gpio and mmc_spi
Date: Tue, 21 Oct 2008 12:32:31 +0000	[thread overview]
Message-ID: <20081021123231.27894.26150.sendpatchset@rx1.opensource.se> (raw)

From: Magnus Damm <damm@igel.co.jp>

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>
---

 Needs the header from the not-yet-merged spi_gpio driver.

 arch/sh/boards/mach-migor/setup.c |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

--- 0002/arch/sh/boards/mach-migor/setup.c
+++ work/arch/sh/boards/mach-migor/setup.c	2008-10-21 20:03:36.000000000 +0900
@@ -18,6 +18,8 @@
 #include <linux/delay.h>
 #include <linux/clk.h>
 #include <linux/gpio.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_gpio.h>
 #include <media/soc_camera_platform.h>
 #include <media/sh_mobile_ceu.h>
 #include <video/sh_mobile_lcdc.h>
@@ -436,6 +438,20 @@ static struct platform_device migor_ceu_
 	},
 };
 
+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,
@@ -446,6 +462,7 @@ static struct platform_device *migor_dev
 #endif
 	&migor_nor_flash_device,
 	&migor_nand_flash_device,
+	&sdcard_cn9_device,
 };
 
 static struct i2c_board_info migor_i2c_devices[] = {
@@ -458,6 +475,15 @@ static struct i2c_board_info migor_i2c_d
 	},
 };
 
+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 */
@@ -583,6 +609,9 @@ static int __init migor_devices_setup(vo
 	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);

                 reply	other threads:[~2008-10-21 12:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081021123231.27894.26150.sendpatchset@rx1.opensource.se \
    --to=magnus.damm@gmail.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox