aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2011-10-12 03:21:50 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-11-04 12:03:23 -0400
commit3087b905c4050afeb1847fb0fcf89b3e09f6ffee (patch)
tree9611d9042d03e3ab30aadafb1217a746f2e93e7a /arch/arm/mach-shmobile
parenta1993055efcc14fd6d213b936d28a41ea52e1d3d (diff)
ARM: mach-shmobile: SDHI0 GPIO hotplug for AG5EVM
Implement GPIO hotplugging via TMIO_MMC_HAS_COLD_CD for AG5EVM SDHI0. This is possible now when INTCA is used for IRQ triggering on sh73a0. Without INTCA IRQ support we are left with the GIC hardware block that does not support dealing with active low interrupt sources. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 475342bcc95c..d6e461710524 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -339,6 +339,18 @@ static struct platform_device mipidsi0_device = {
339 }, 339 },
340}; 340};
341 341
342/* SDHI0 */
343static irqreturn_t ag5evm_sdhi0_gpio_cd(int irq, void *arg)
344{
345 struct device *dev = arg;
346 struct sh_mobile_sdhi_info *info = dev->platform_data;
347 struct tmio_mmc_data *pdata = info->pdata;
348
349 tmio_mmc_cd_wakeup(pdata);
350
351 return IRQ_HANDLED;
352}
353
342static struct sh_mobile_sdhi_info sdhi0_info = { 354static struct sh_mobile_sdhi_info sdhi0_info = {
343 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 355 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
344 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 356 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
@@ -570,6 +582,13 @@ static void __init ag5evm_init(void)
570 gpio_request(GPIO_FN_SDHID0_1, NULL); 582 gpio_request(GPIO_FN_SDHID0_1, NULL);
571 gpio_request(GPIO_FN_SDHID0_0, NULL); 583 gpio_request(GPIO_FN_SDHID0_0, NULL);
572 584
585 if (!request_irq(intcs_evt2irq(0x3c0), ag5evm_sdhi0_gpio_cd,
586 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
587 "sdhi0 cd", &sdhi0_device.dev))
588 sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD;
589 else
590 pr_warn("Unable to setup SDHI0 GPIO IRQ\n");
591
573 /* enable SDHI1 on CN4 [WLAN I/F] */ 592 /* enable SDHI1 on CN4 [WLAN I/F] */
574 gpio_request(GPIO_FN_SDHICLK1, NULL); 593 gpio_request(GPIO_FN_SDHICLK1, NULL);
575 gpio_request(GPIO_FN_SDHICMD1_PU, NULL); 594 gpio_request(GPIO_FN_SDHICMD1_PU, NULL);