Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303485
b: refs/heads/master
c: 49c0111
h: refs/heads/master
i:
  303483: 7db7d5f
v: v3
  • Loading branch information
Kuninori Morimoto authored and Rafael J. Wysocki committed May 12, 2012
1 parent aaeb5ba commit c5b2162
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1c96293e9f8b8ec9620201bcf7f776f0e0f89edb
refs/heads/master: 49c01112d6afdb679276c172ffcd4f1205c1ff97
71 changes: 71 additions & 0 deletions trunk/arch/arm/mach-shmobile/board-armadillo800eva.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#include <linux/sh_eth.h>
#include <linux/videodev2.h>
#include <linux/usb/renesas_usbhs.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/mmc/sh_mobile_sdhi.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <asm/page.h>
Expand Down Expand Up @@ -402,6 +405,55 @@ static struct platform_device gpio_keys_device = {
},
};

/* SDHI0 */
/*
* FIXME
*
* It use polling mode here, since
* CD (= Card Detect) pin is not connected to SDHI0_CD.
* We can use IRQ31 as card detect irq,
* but it needs chattering removal operation
*/
#define IRQ31 evt2irq(0x33E0)
static struct sh_mobile_sdhi_info sdhi0_info = {
.tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |\
MMC_CAP_NEEDS_POLL,
.tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
};

static struct resource sdhi0_resources[] = {
{
.name = "SDHI0",
.start = 0xe6850000,
.end = 0xe6850100 - 1,
.flags = IORESOURCE_MEM,
},
/*
* no SH_MOBILE_SDHI_IRQ_CARD_DETECT here
*/
{
.name = SH_MOBILE_SDHI_IRQ_SDCARD,
.start = evt2irq(0x0E20),
.flags = IORESOURCE_IRQ,
},
{
.name = SH_MOBILE_SDHI_IRQ_SDIO,
.start = evt2irq(0x0E40),
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device sdhi0_device = {
.name = "sh_mobile_sdhi",
.id = 0,
.dev = {
.platform_data = &sdhi0_info,
},
.num_resources = ARRAY_SIZE(sdhi0_resources),
.resource = sdhi0_resources,
};

/* I2C */
static struct i2c_board_info i2c0_devices[] = {
{
Expand All @@ -417,6 +469,7 @@ static struct platform_device *eva_devices[] __initdata = {
&lcdc0_device,
&gpio_keys_device,
&sh_eth_device,
&sdhi0_device,
};

static void __init eva_clock_init(void)
Expand Down Expand Up @@ -539,6 +592,24 @@ static void __init eva_init(void)
platform_device_register(&usbhsf_device);
}

/* SDHI0 */
gpio_request(GPIO_FN_SDHI0_CMD, NULL);
gpio_request(GPIO_FN_SDHI0_CLK, NULL);
gpio_request(GPIO_FN_SDHI0_D0, NULL);
gpio_request(GPIO_FN_SDHI0_D1, NULL);
gpio_request(GPIO_FN_SDHI0_D2, NULL);
gpio_request(GPIO_FN_SDHI0_D3, NULL);
gpio_request(GPIO_FN_SDHI0_WP, NULL);

gpio_request(GPIO_PORT17, NULL); /* SDHI0_18/33_B */
gpio_request(GPIO_PORT74, NULL); /* SDHI0_PON */
gpio_request(GPIO_PORT75, NULL); /* SDSLOT1_PON */
gpio_direction_output(GPIO_PORT17, 0);
gpio_direction_output(GPIO_PORT74, 1);
gpio_direction_output(GPIO_PORT75, 1);

/* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */

/*
* CAUTION
*
Expand Down

0 comments on commit c5b2162

Please sign in to comment.