]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/arm/mach-omap2/board-rx51-peripherals.c
Merge branch 'fixes-gpio-to-irq' into fixes
[mirror_ubuntu-artful-kernel.git] / arch / arm / mach-omap2 / board-rx51-peripherals.c
index 2b6db67291be52b3bc19bbd4929e085281d6c929..d87ee0612098fb82ba350d591adb9281e588097a 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/gpio_keys.h>
 #include <linux/mmc/host.h>
 #include <linux/power/isp1704_charger.h>
+#include <asm/system_info.h>
 
 #include <plat/mcspi.h>
 #include <plat/board.h>
@@ -1101,6 +1102,11 @@ static struct tsc2005_platform_data tsc2005_pdata = {
        .esd_timeout_ms         = 8000,
 };
 
+static struct gpio rx51_tsc2005_gpios[] __initdata = {
+       { RX51_TSC2005_IRQ_GPIO,   GPIOF_IN,            "tsc2005 IRQ"   },
+       { RX51_TSC2005_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "tsc2005 reset" },
+};
+
 static void rx51_tsc2005_set_reset(bool enable)
 {
        gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
@@ -1110,22 +1116,20 @@ static void __init rx51_init_tsc2005(void)
 {
        int r;
 
-       r = gpio_request_one(RX51_TSC2005_IRQ_GPIO, GPIOF_IN, "tsc2005 IRQ");
-       if (r < 0) {
-               printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 IRQ");
-               rx51_peripherals_spi_board_info[RX51_SPI_TSC2005].irq = 0;
-       }
+       omap_mux_init_gpio(RX51_TSC2005_RESET_GPIO, OMAP_PIN_OUTPUT);
+       omap_mux_init_gpio(RX51_TSC2005_IRQ_GPIO, OMAP_PIN_INPUT_PULLUP);
 
-       r = gpio_request_one(RX51_TSC2005_RESET_GPIO, GPIOF_OUT_INIT_HIGH,
-               "tsc2005 reset");
-       if (r >= 0) {
-               tsc2005_pdata.set_reset = rx51_tsc2005_set_reset;
-               rx51_peripherals_spi_board_info[RX51_SPI_TSC2005].irq =
-                                       gpio_to_irq(RX51_TSC2005_IRQ_GPIO);
-       } else {
-               printk(KERN_ERR "unable to get %s GPIO\n", "tsc2005 reset");
+       r = gpio_request_array(rx51_tsc2005_gpios,
+                              ARRAY_SIZE(rx51_tsc2005_gpios));
+       if (r < 0) {
+               printk(KERN_ERR "tsc2005 board initialization failed\n");
                tsc2005_pdata.esd_timeout_ms = 0;
+               return;
        }
+
+       tsc2005_pdata.set_reset = rx51_tsc2005_set_reset;
+       rx51_peripherals_spi_board_info[RX51_SPI_TSC2005].irq =
+                               gpio_to_irq(RX51_TSC2005_IRQ_GPIO);
 }
 
 void __init rx51_peripherals_init(void)
@@ -1143,7 +1147,7 @@ void __init rx51_peripherals_init(void)
 
        partition = omap_mux_get("core");
        if (partition)
-               omap2_hsmmc_init(mmc);
+               omap_hsmmc_init(mmc);
 
        rx51_charger_init();
 }