From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] sh: ap325rxa MMC support using spi_gpio and mmc_spi
Date: Wed, 22 Oct 2008 09:27:57 +0000 [thread overview]
Message-ID: <20081022092757.1075.26284.sendpatchset@rx1.opensource.se> (raw)
From: Magnus Damm <damm@igel.co.jp>
This patch adds CN3 MMC support for ap325rxa using the mmc_spi driver on
top of the bitbanging spi_gpio driver.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
arch/sh/boards/board-ap325rxa.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
--- 0001/arch/sh/boards/board-ap325rxa.c
+++ work/arch/sh/boards/board-ap325rxa.c 2008-10-22 17:41:50.000000000 +0900
@@ -20,6 +20,8 @@
#include <linux/i2c.h>
#include <linux/smc911x.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>
@@ -310,6 +312,20 @@ static struct platform_device ceu_device
},
};
+struct spi_gpio_platform_data sdcard_cn3_platform_data = {
+ .sck = GPIO_PTD0,
+ .mosi = GPIO_PTD1,
+ .miso = GPIO_PTD2,
+ .num_chipselect = 1,
+};
+
+static struct platform_device sdcard_cn3_device = {
+ .name = "spi_gpio",
+ .dev = {
+ .platform_data = &sdcard_cn3_platform_data,
+ },
+};
+
static struct platform_device *ap325rxa_devices[] __initdata = {
&smc9118_device,
&ap325rxa_nor_flash_device,
@@ -319,6 +335,7 @@ static struct platform_device *ap325rxa_
&camera_device,
#endif
&nand_flash_device,
+ &sdcard_cn3_device,
};
static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
@@ -327,6 +344,15 @@ static struct i2c_board_info __initdata
},
};
+static struct spi_board_info ap325rxa_spi_devices[] = {
+ {
+ .modalias = "mmc_spi",
+ .max_speed_hz = 5000000,
+ .chip_select = 0,
+ .controller_data = (void *) GPIO_PTD5,
+ },
+};
+
static int __init ap325rxa_devices_setup(void)
{
/* LD3 and LD4 LEDs */
@@ -426,6 +452,9 @@ static int __init ap325rxa_devices_setup
i2c_register_board_info(0, ap325rxa_i2c_devices,
ARRAY_SIZE(ap325rxa_i2c_devices));
+ spi_register_board_info(ap325rxa_spi_devices,
+ ARRAY_SIZE(ap325rxa_spi_devices));
+
return platform_add_devices(ap325rxa_devices,
ARRAY_SIZE(ap325rxa_devices));
}
reply other threads:[~2008-10-22 9:27 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=20081022092757.1075.26284.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