]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ARM: mach-shmobile: convert ag5evm to use the generic MMC GPIO hotplug helper
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Mon, 16 Apr 2012 21:09:19 +0000 (23:09 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Sat, 12 May 2012 20:13:01 +0000 (22:13 +0200)
This also fixes the following modular mmc build failure:

arch/arm/mach-shmobile/built-in.o: In function `mackerel_sdhi0_gpio_cd':
pfc-sh7372.c:(.text+0x1138): undefined reference to `mmc_detect_change'

on this platform by eliminating the use of an inline function, which
calls into the mmc core.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: Simon Horman <horms@verge.net.au>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
arch/arm/mach-shmobile/board-ag5evm.c

index cb224a344af0ccfa11a460297038a4a79ed151ce..0891ec6e27f502b8fe220a3bff3b97dfbbe44c69 100644 (file)
@@ -365,23 +365,13 @@ static struct platform_device mipidsi0_device = {
 };
 
 /* SDHI0 */
-static irqreturn_t ag5evm_sdhi0_gpio_cd(int irq, void *arg)
-{
-       struct device *dev = arg;
-       struct sh_mobile_sdhi_info *info = dev->platform_data;
-       struct tmio_mmc_data *pdata = info->pdata;
-
-       tmio_mmc_cd_wakeup(pdata);
-
-       return IRQ_HANDLED;
-}
-
 static struct sh_mobile_sdhi_info sdhi0_info = {
        .dma_slave_tx   = SHDMA_SLAVE_SDHI0_TX,
        .dma_slave_rx   = SHDMA_SLAVE_SDHI0_RX,
-       .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT,
+       .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
        .tmio_caps      = MMC_CAP_SD_HIGHSPEED,
        .tmio_ocr_mask  = MMC_VDD_27_28 | MMC_VDD_28_29,
+       .cd_gpio        = GPIO_PORT251,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -557,7 +547,6 @@ static void __init ag5evm_init(void)
        lcd_backlight_reset();
 
        /* enable SDHI0 on CN15 [SD I/F] */
-       gpio_request(GPIO_FN_SDHICD0, NULL);
        gpio_request(GPIO_FN_SDHIWP0, NULL);
        gpio_request(GPIO_FN_SDHICMD0, NULL);
        gpio_request(GPIO_FN_SDHICLK0, NULL);
@@ -566,13 +555,6 @@ static void __init ag5evm_init(void)
        gpio_request(GPIO_FN_SDHID0_1, NULL);
        gpio_request(GPIO_FN_SDHID0_0, NULL);
 
-       if (!request_irq(intcs_evt2irq(0x3c0), ag5evm_sdhi0_gpio_cd,
-                        IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
-                        "sdhi0 cd", &sdhi0_device.dev))
-               sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD;
-       else
-               pr_warn("Unable to setup SDHI0 GPIO IRQ\n");
-
        /* enable SDHI1 on CN4 [WLAN I/F] */
        gpio_request(GPIO_FN_SDHICLK1, NULL);
        gpio_request(GPIO_FN_SDHICMD1_PU, NULL);