]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
tsc2301 - Remove OMAP gpio from ts & kb driver
authorKlaus Pedersen <klaus.k.pedersen@nokia.com>
Fri, 15 Feb 2008 21:31:43 +0000 (23:31 +0200)
committerTony Lindgren <tony@atomide.com>
Thu, 21 Feb 2008 00:20:33 +0000 (16:20 -0800)
Still need to find a solution to tsc2301-core.c....

Signed-off-by: Klaus Pedersen <klaus.k.pedersen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-n800.c
drivers/input/keyboard/tsc2301_kp.c
drivers/input/touchscreen/tsc2301_ts.c
include/linux/spi/tsc2301.h

index 878efc11210e067939959248443341e322ee0fe1..2682acbf68cd5750fc2414f35b793eaa4a40da8f 100644 (file)
@@ -45,6 +45,8 @@
 #define N800_BLIZZARD_POWERDOWN_GPIO   15
 #define N800_STI_GPIO                  62
 #define N800_KEYB_IRQ_GPIO             109
+#define N800_DAV_IRQ_GPIO              103
+#define N800_TSC2301_RESET_GPIO                118
 
 void __init nokia_n800_init_irq(void)
 {
@@ -210,8 +212,7 @@ static struct omap_board_config_kernel n800_config[] __initdata = {
 };
 
 static struct tsc2301_platform_data tsc2301_config = {
-       .reset_gpio     = 118,
-       .dav_gpio       = 103,
+       .reset_gpio     = N800_TSC2301_RESET_GPIO,
        .keymap = {
                -1,             /* Event for bit 0 */
                KEY_UP,         /* Event for bit 1 (up) */
@@ -235,14 +236,25 @@ static struct tsc2301_platform_data tsc2301_config = {
 
 static void tsc2301_dev_init(void)
 {
+       int r;
        int gpio = N800_KEYB_IRQ_GPIO;
 
-       if (omap_request_gpio(gpio) < 0) {
-               printk(KERN_ERR "can't get KBIRQ GPIO\n");
-               return;
+       r = gpio_request(gpio, "tsc2301 KBD IRQ");
+       if (r >= 0) {
+               gpio_direction_input(gpio);
+               tsc2301_config.keyb_int = OMAP_GPIO_IRQ(gpio);
+       } else {
+               printk(KERN_ERR "unable to get KBD GPIO");
+       }
+
+       gpio = N800_DAV_IRQ_GPIO;
+       r = gpio_request(gpio, "tsc2301 DAV IRQ");
+       if (r >= 0) {
+               gpio_direction_input(gpio);
+               tsc2301_config.dav_int = OMAP_GPIO_IRQ(gpio);
+       } else {
+               printk(KERN_ERR "unable to get DAV GPIO");
        }
-       omap_set_gpio_direction(gpio, 1);
-       tsc2301_config.keyb_int = OMAP_GPIO_IRQ(gpio);
 }
 
 static struct omap2_mcspi_device_config tsc2301_mcspi_config = {
index 3703cd5489beeb081eb4134cb6028e4d9a3c9d9e..6308ee51507cd3b57fe504880a9ba2befb71ba20 100644 (file)
 #include <linux/delay.h>
 #include <linux/spi/spi.h>
 
-#ifdef CONFIG_ARCH_OMAP
-#include <asm/arch/gpio.h>
-#endif
-
 #include <linux/spi/tsc2301.h>
 
 #define TSC2301_KEYBOARD_PRODUCT_ID      0x0051
index 03c1317ccd0a95f56078e3e166b73b841f326408..ad8603c28e864f925f57ff82bf1fd5187f26aae6 100644 (file)
 #include <linux/delay.h>
 #include <linux/spi/spi.h>
 
-#ifdef CONFIG_ARCH_OMAP
-#include <asm/arch/gpio.h>
-#endif
-
 #include <linux/spi/tsc2301.h>
 
 /**
@@ -143,8 +139,6 @@ struct tsc2301_ts {
        u8                      disable_depth;
 
        int                     hw_flags;
-
-       s16                     dav_gpio;
        int                     irq;
 };
 
@@ -550,31 +544,22 @@ int __devinit tsc2301_ts_init(struct tsc2301 *tsc,
 {
        struct tsc2301_ts *ts;
        struct input_dev *idev;
-       int dav_gpio, r;
+       int r;
        int x_max, y_max;
        int x_fudge, y_fudge, p_fudge;
 
-       if (pdata->dav_gpio < 0) {
-               dev_err(&tsc->spi->dev, "need DAV GPIO");
+       if (pdata->dav_int <= 0) {
+               dev_err(&tsc->spi->dev, "need DAV IRQ");
                return -EINVAL;
        }
-       dav_gpio = pdata->dav_gpio;
 
        ts = kzalloc(sizeof(*ts), GFP_KERNEL);
        if (ts == NULL)
                return -ENOMEM;
        tsc->ts = ts;
 
-       ts->dav_gpio = dav_gpio;
-#ifdef CONFIG_ARCH_OMAP
-       r = omap_request_gpio(dav_gpio);
-       if (r < 0) {
-               dev_err(&tsc->spi->dev, "unable to get DAV GPIO");
-               goto err1;
-       }
-       omap_set_gpio_direction(dav_gpio, 1);
-       ts->irq = OMAP_GPIO_IRQ(dav_gpio);
-#endif
+       ts->irq = pdata->dav_int;
+
        init_timer(&ts->penup_timer);
        setup_timer(&ts->penup_timer, tsc2301_ts_timer_handler,
                        (unsigned long)tsc);
@@ -654,10 +639,6 @@ err3:
        tsc2301_ts_stop_scan(tsc);
        input_free_device(idev);
 err2:
-#ifdef CONFIG_ARCH_OMAP
-       omap_free_gpio(dav_gpio);
-#endif
-err1:
        kfree(ts);
        return r;
 }
@@ -674,9 +655,6 @@ void __devexit tsc2301_ts_exit(struct tsc2301 *tsc)
        free_irq(ts->irq, tsc);
        input_unregister_device(ts->idev);
 
-#ifdef CONFIG_ARCH_OMAP
-       omap_free_gpio(ts->dav_gpio);
-#endif
        kfree(ts);
 }
 MODULE_AUTHOR("Jarkko Oikarinen <jarkko.oikarinen@nokia.com>");
index e30d01ddee330dcd49396a7db130d2c3d99127c1..d2c9ddada515fcbf85c1bf55199b81eac2314079 100644 (file)
@@ -16,7 +16,7 @@ struct tsc2301_platform_data {
        /*
         * Touchscreen
         */
-       s16     dav_gpio;
+       s16     dav_int;
        u16     ts_x_plate_ohm;
        u32     ts_stab_time;   /* voltage settling time */
        u8      ts_hw_avg;      /* HW assiseted averaging. Can be