Merge branch 'develop-3.0' of ssh://192.168.1.29/rk/kernel into develop-3.0
[firefly-linux-kernel-4.4.55.git] / drivers / input / touchscreen / xpt2046_ts_320X480.c
index 20079368df057d94e1a25f9a8c1f3b82da5230dc..e2628e211976d28b3e98ea973cc063e1c7234bdf 100755 (executable)
@@ -1,7 +1,7 @@
 /*
- * drivers/input/touchscreen/xpt2046_ts.c - driver for rk2818 spi xpt2046 device and console
+ * drivers/input/touchscreen/xpt2046_ts.c - driver for rk29 spi xpt2046 device and console
  *
- * Copyright (C) 2010 ROCKCHIP, Inc.
+ * Copyright (C) 2011 ROCKCHIP, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -201,22 +201,6 @@ struct dfr_req {
        struct spi_transfer     xfer[4];
 };
 
-static struct xpt2046_platform_data xpt2046_info = {
-       .model                  = 2046,
-       .keep_vref_on   = 1,
-       .swap_xy                = 0,
-       .x_min                  = 0,
-       .x_max                  = 320,
-       .y_min                  = 0,
-       .y_max                  = 480,
-       .debounce_max           = 7,
-       .debounce_rep           = DEBOUNCE_REPTIME,
-       .debounce_tol           = 20,
-       .gpio_pendown           = RK2818_PIN_PE1,//RK2818_PIN_PE3, //modify by zhao
-       .penirq_recheck_delay_usecs = 1,
-
-};
-
 //add by zhao
 #define LEN_TO_PIX(x)  (unsigned int)( 320 * (x) / 47 )
 #define KEY1_X                 6.3
@@ -250,7 +234,7 @@ static struct KeyInfo panel_key_info[]={
 {KEY1_LEFT, KEY1_RIGHT, KEY_HOME, 0},
 {KEY2_LEFT, KEY2_RIGHT, KEY_MENU, 0},
 {KEY3_LEFT, KEY3_RIGHT, KEY_BACK, 0},
-{KEY4_LEFT, KEY4_RIGHT, KEY_FIND, 0},
+{KEY4_LEFT, KEY4_RIGHT, KEY_SEARCH, 0},
 };
 //end by zhao
 
@@ -744,6 +728,15 @@ static int __devinit setup_pendown(struct spi_device *spi, struct xpt2046 *ts)
                return err;
        }
 
+    err = gpio_direction_input(pdata->gpio_pendown);
+    if (err) {
+               dev_err(&spi->dev, "failed to switch GPIO to input%d\n",
+                               pdata->gpio_pendown);
+               return err;
+    }
+    
+    gpio_pull_updown(pdata->gpio_pendown,GPIOPullUp);
+
        ts->gpio_pendown = pdata->gpio_pendown;
        return 0;
 }