sh: SDHI platform data to the AP325RXA board
Convert the AP325 board to use sh_mobile_sdhi for the SD Card connected to CN3 instead of mmc_spi. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
parent
2e3fc56c8d
commit
17f81473d1
|
@ -20,8 +20,6 @@
|
||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
#include <linux/smsc911x.h>
|
#include <linux/smsc911x.h>
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <linux/spi/spi.h>
|
|
||||||
#include <linux/spi/spi_gpio.h>
|
|
||||||
#include <media/ov772x.h>
|
#include <media/ov772x.h>
|
||||||
#include <media/soc_camera.h>
|
#include <media/soc_camera.h>
|
||||||
#include <media/soc_camera_platform.h>
|
#include <media/soc_camera_platform.h>
|
||||||
|
@ -409,17 +407,25 @@ static struct platform_device ceu_device = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
struct spi_gpio_platform_data sdcard_cn3_platform_data = {
|
static struct resource sdhi0_cn3_resources[] = {
|
||||||
.sck = GPIO_PTD0,
|
[0] = {
|
||||||
.mosi = GPIO_PTD1,
|
.name = "SDHI0",
|
||||||
.miso = GPIO_PTD2,
|
.start = 0x04ce0000,
|
||||||
.num_chipselect = 1,
|
.end = 0x04ce01ff,
|
||||||
|
.flags = IORESOURCE_MEM,
|
||||||
|
},
|
||||||
|
[1] = {
|
||||||
|
.start = 101,
|
||||||
|
.flags = IORESOURCE_IRQ,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device sdcard_cn3_device = {
|
static struct platform_device sdhi0_cn3_device = {
|
||||||
.name = "spi_gpio",
|
.name = "sh_mobile_sdhi",
|
||||||
.dev = {
|
.num_resources = ARRAY_SIZE(sdhi0_cn3_resources),
|
||||||
.platform_data = &sdcard_cn3_platform_data,
|
.resource = sdhi0_cn3_resources,
|
||||||
|
.archdata = {
|
||||||
|
.hwblk_id = HWBLK_SDHI0,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -470,20 +476,11 @@ static struct platform_device *ap325rxa_devices[] __initdata = {
|
||||||
&lcdc_device,
|
&lcdc_device,
|
||||||
&ceu_device,
|
&ceu_device,
|
||||||
&nand_flash_device,
|
&nand_flash_device,
|
||||||
&sdcard_cn3_device,
|
&sdhi0_cn3_device,
|
||||||
&ap325rxa_camera[0],
|
&ap325rxa_camera[0],
|
||||||
&ap325rxa_camera[1],
|
&ap325rxa_camera[1],
|
||||||
};
|
};
|
||||||
|
|
||||||
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)
|
static int __init ap325rxa_devices_setup(void)
|
||||||
{
|
{
|
||||||
/* LD3 and LD4 LEDs */
|
/* LD3 and LD4 LEDs */
|
||||||
|
@ -578,12 +575,19 @@ static int __init ap325rxa_devices_setup(void)
|
||||||
|
|
||||||
platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
|
platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
|
||||||
|
|
||||||
|
/* SDHI0 */
|
||||||
|
gpio_request(GPIO_FN_SDHI0CD_PTD, NULL);
|
||||||
|
gpio_request(GPIO_FN_SDHI0WP_PTD, NULL);
|
||||||
|
gpio_request(GPIO_FN_SDHI0D3_PTD, NULL);
|
||||||
|
gpio_request(GPIO_FN_SDHI0D2_PTD, NULL);
|
||||||
|
gpio_request(GPIO_FN_SDHI0D1_PTD, NULL);
|
||||||
|
gpio_request(GPIO_FN_SDHI0D0_PTD, NULL);
|
||||||
|
gpio_request(GPIO_FN_SDHI0CMD_PTD, NULL);
|
||||||
|
gpio_request(GPIO_FN_SDHI0CLK_PTD, NULL);
|
||||||
|
|
||||||
i2c_register_board_info(0, ap325rxa_i2c_devices,
|
i2c_register_board_info(0, ap325rxa_i2c_devices,
|
||||||
ARRAY_SIZE(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,
|
return platform_add_devices(ap325rxa_devices,
|
||||||
ARRAY_SIZE(ap325rxa_devices));
|
ARRAY_SIZE(ap325rxa_devices));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue