Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbdd9a70 authored by Magnus Damm's avatar Magnus Damm Committed by Paul Mundt
Browse files

sh: ap325rxa MMC support using spi_gpio and mmc_spi



This patch adds CN3 MMC support for ap325rxa using the mmc_spi
driver on top of the bitbanging spi_gpio driver.

Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 10f0fc17
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include <linux/i2c.h>
#include <linux/smsc911x.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>
@@ -317,6 +319,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 = {
	&smsc9118_device,
	&ap325rxa_nor_flash_device,
@@ -326,6 +342,7 @@ static struct platform_device *ap325rxa_devices[] __initdata = {
	&camera_device,
#endif
	&nand_flash_device,
	&sdcard_cn3_device,
};

static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
@@ -334,6 +351,15 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
	},
};

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 */
@@ -431,6 +457,9 @@ static int __init ap325rxa_devices_setup(void)
	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));
}