]> Pileus Git - ~andy/linux/blobdiff - arch/arm/mach-omap2/board-4430sdp.c
Merge branch 'fixes-gpio-to-irq' into fixes
[~andy/linux] / arch / arm / mach-omap2 / board-4430sdp.c
index 4e9071589bfb60ac3bfb5a222eefcfebc700bd03..a39fc4bbd2b8ffb9cb8bb06c1c91f1c40e120333 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/regulator/fixed.h>
 #include <linux/leds.h>
 #include <linux/leds_pwm.h>
+#include <linux/platform_data/omap4-keypad.h>
 
 #include <mach/hardware.h>
 #include <asm/hardware/gic.h>
@@ -41,6 +42,7 @@
 #include <video/omap-panel-nokia-dsi.h>
 #include <video/omap-panel-picodlp.h>
 #include <linux/wl12xx.h>
+#include <linux/platform_data/omap-abe-twl6040.h>
 
 #include "mux.h"
 #include "hsmmc.h"
@@ -322,7 +324,10 @@ static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
                .bus_num                = 1,
                .chip_select            = 0,
                .max_speed_hz           = 24000000,
-               .irq                    = ETH_KS8851_IRQ,
+               /*
+                * .irq is set to gpio_to_irq(ETH_KS8851_IRQ)
+                * in omap_4430sdp_init
+                */
        },
 };
 
@@ -378,12 +383,40 @@ static struct platform_device sdp4430_dmic_codec = {
        .id     = -1,
 };
 
+static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
+       .card_name = "SDP4430",
+       .has_hs         = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       .has_hf         = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       .has_ep         = 1,
+       .has_aux        = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+       .has_vibra      = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+       .has_dmic       = 1,
+       .has_hsmic      = 1,
+       .has_mainmic    = 1,
+       .has_submic     = 1,
+       .has_afm        = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
+
+       .jack_detection = 1,
+       /* MCLK input is 38.4MHz */
+       .mclk_freq      = 38400000,
+};
+
+static struct platform_device sdp4430_abe_audio = {
+       .name           = "omap-abe-twl6040",
+       .id             = -1,
+       .dev = {
+               .platform_data = &sdp4430_abe_audio_data,
+       },
+};
+
 static struct platform_device *sdp4430_devices[] __initdata = {
        &sdp4430_gpio_keys_device,
        &sdp4430_leds_gpio,
        &sdp4430_leds_pwm,
        &sdp4430_vbat,
        &sdp4430_dmic_codec,
+       &sdp4430_abe_audio,
 };
 
 static struct omap_musb_board_data musb_board_data = {
@@ -457,21 +490,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)
@@ -491,9 +525,9 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
 {
        struct omap2_hsmmc_info *c;
 
-       omap2_hsmmc_init(controllers);
+       omap_hsmmc_init(controllers);
        for (c = controllers; c->mmc; c++)
-               omap4_twl6030_hsmmc_set_late_init(c->dev);
+               omap4_twl6030_hsmmc_set_late_init(&c->pdev->dev);
 
        return 0;
 }
@@ -873,7 +907,6 @@ static void __init omap4_sdp4430_wifi_mux_init(void)
 }
 
 static struct wl12xx_platform_data omap4_sdp4430_wlan_data __initdata = {
-       .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ),
        .board_ref_clock = WL12XX_REFCLOCK_26,
        .board_tcxo_clock = WL12XX_TCXOCLOCK_26,
 };
@@ -883,6 +916,7 @@ static void __init omap4_sdp4430_wifi_init(void)
        int ret;
 
        omap4_sdp4430_wifi_mux_init();
+       omap4_sdp4430_wlan_data.irq = gpio_to_irq(GPIO_WIFI_IRQ);
        ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
        if (ret)
                pr_err("Error setting wl12xx data: %d\n", ret);