ARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files
authorBenoit Cousson <b-cousson@ti.com>
Fri, 2 Mar 2012 15:20:01 +0000 (16:20 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 22 Mar 2012 12:02:51 +0000 (13:02 +0100)
With the introduction of dynamically allocated IRQ in the twl6030 driver,
the board files can no longer rely of static IRQ defines like before.

Retrieve the value dynamically allocated from the mmc -> twl6030 init
callback.

Note: The Panda board does not seems to use the card detect IRQ.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-omap4panda.c

index 4e9071589bfb60ac3bfb5a222eefcfebc700bd03..79c4ebab7516da1df926fdded97a60b221483550 100644 (file)
@@ -457,21 +457,22 @@ static struct platform_device omap_vwlan_device = {
 
 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
 {
-       int ret = 0;
+       int irq = 0;
        struct platform_device *pdev = container_of(dev,
                                struct platform_device, dev);
        struct omap_mmc_platform_data *pdata = dev->platform_data;
 
        /* Setting MMC1 Card detect Irq */
        if (pdev->id == 0) {
-               ret = twl6030_mmc_card_detect_config();
-               if (ret)
+               irq = twl6030_mmc_card_detect_config();
+               if (irq < 0) {
                        pr_err("Failed configuring MMC1 card detect\n");
-               pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE +
-                                               MMCDETECT_INTR_OFFSET;
+                       return irq;
+               }
+               pdata->slots[0].card_detect_irq = irq;
                pdata->slots[0].card_detect = twl6030_mmc_card_detect;
        }
-       return ret;
+       return 0;
 }
 
 static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
index 28fc271f70316510b5268c2a212adcac3718fce1..297f30bc842b3a4c0dd04380cb6849d6c0e0e482 100644 (file)
@@ -206,7 +206,7 @@ struct wl12xx_platform_data omap_panda_wlan_data  __initdata = {
 
 static int omap4_twl6030_hsmmc_late_init(struct device *dev)
 {
-       int ret = 0;
+       int irq = 0;
        struct platform_device *pdev = container_of(dev,
                                struct platform_device, dev);
        struct omap_mmc_platform_data *pdata = dev->platform_data;
@@ -217,14 +217,15 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)
        }
        /* Setting MMC1 Card detect Irq */
        if (pdev->id == 0) {
-               ret = twl6030_mmc_card_detect_config();
-                if (ret)
+               irq = twl6030_mmc_card_detect_config();
+               if (irq < 0) {
                        dev_err(dev, "%s: Error card detect config(%d)\n",
-                               __func__, ret);
-                else
-                       pdata->slots[0].card_detect = twl6030_mmc_card_detect;
+                               __func__, irq);
+                       return irq;
+               }
+               pdata->slots[0].card_detect = twl6030_mmc_card_detect;
        }
-       return ret;
+       return 0;
 }
 
 static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)