rk30:add goodix touch screen support
authorlw <lw@rock-chips.com>
Tue, 6 Mar 2012 03:16:10 +0000 (11:16 +0800)
committerlw <lw@rock-chips.com>
Tue, 6 Mar 2012 03:16:10 +0000 (11:16 +0800)
arch/arm/mach-rk30/board-rk30-sdk.c
arch/arm/plat-rk/include/plat/board.h [changed mode: 0644->0755]
drivers/input/touchscreen/Kconfig [changed mode: 0644->0755]
drivers/input/touchscreen/rk29_i2c_goodix.c

index c87edce5d5755a89f651d228a29e7324cca420e1..f13505f054aecf2eb958b89f4299151b642d6b2e 100755 (executable)
 #define RK30_FB0_MEM_SIZE 8*SZ_1M
 
 
+#if defined(CONFIG_TOUCHSCREEN_GT8XX)
+#define TOUCH_RESET_PIN  RK30_PIN4_PD0
+#define TOUCH_PWR_PIN    INVALID_GPIO
+int goodix_init_platform_hw(void)
+{
+       int ret;
+       printk("goodix_init_platform_hw\n");
+       ret = gpio_request(TOUCH_PWR_PIN, "goodix power pin");
+       if(ret != 0){
+               gpio_free(TOUCH_PWR_PIN);
+               printk("goodix power error\n");
+               return -EIO;
+       }
+       gpio_direction_output(TOUCH_PWR_PIN, 0);
+       gpio_set_value(TOUCH_PWR_PIN,GPIO_LOW);
+       msleep(100);
+       ret = gpio_request(TOUCH_RESET_PIN, "goodix reset pin");
+       if(ret != 0){
+               gpio_free(TOUCH_RESET_PIN);
+               printk("goodix gpio_request error\n");
+               return -EIO;
+       }
+       gpio_direction_output(TOUCH_RESET_PIN, 0);
+       gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+       msleep(10);
+       gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+       msleep(500);
+       return 0;
+}
+
+struct goodix_platform_data goodix_info = {
+         .model= 8105,
+         .irq_pin = RK30_PIN4_PC2,
+         .rest_pin  = TOUCH_RESET_PIN,
+         .init_platform_hw = goodix_init_platform_hw,
+};
+#endif
+
+
 /*****************************************************************************************
  * xpt2046 touch panel
  * author: hhb@rock-chips.com
@@ -450,6 +489,16 @@ static struct i2c_board_info __initdata i2c1_info[] = {
 
 #ifdef CONFIG_I2C2_RK30
 static struct i2c_board_info __initdata i2c2_info[] = {
+#if defined (CONFIG_TOUCHSCREEN_GT8XX)
+                   {
+                               .type   = "Goodix-TS",
+                               .addr   = 0x55,
+                               .flags      =0,
+                               .irq            =RK30_PIN4_PC2,
+                               .platform_data = &goodix_info,
+                   },
+#endif
+
 };
 #endif
 
old mode 100644 (file)
new mode 100755 (executable)
index 7fca0a4..7e6aeb6
@@ -94,6 +94,17 @@ struct akm8975_platform_data {
        int gpio_DRDY;
 };
 
+struct goodix_platform_data {
+       int model ;
+       int rest_pin;
+       int irq_pin ;
+    int     (*get_pendown_state)(void);
+    int     (*init_platform_hw)(void);
+    int     (*platform_sleep)(void);
+    int     (*platform_wakeup)(void);
+    void    (*exit_platform_hw)(void);
+};
+
 
 
 #define BOOT_MODE_NORMAL               0
old mode 100644 (file)
new mode 100755 (executable)
index a3b870c..aaad0b0
@@ -116,7 +116,7 @@ config TOUCHSCREEN_ILI2102_IIC
 
          If unsure, say N (but it's safe to say "Y").
 config TOUCHSCREEN_GT8XX
-        tristate "Goodix touch screen gt8xx support for rk29"
+        tristate "Goodix touch screen gt8xx support"
         help
           Say Y here if you have a touchscreen interface using the
           goodix gt8xx  , and your board-specific initialization
index 40f649cde589bca2d96449ef23a50ba09c2f1aed..16a1c1f9f3dbac5ce5c7c6071e9f9431e8229776 100755 (executable)
@@ -804,7 +804,7 @@ static int rk_ts_probe(struct i2c_client *client, const struct i2c_device_id *id
                ret  = request_irq(ts->irq, rk_ts_irq_handler ,IRQ_TYPE_LEVEL_LOW,client->name, ts);\r
                if (ret != 0) {\r
                        printk(KERN_ALERT "Cannot allocate ts INT!ERRNO:%d\n", ret);\r
-                       gpio_free(INT_PORT);\r
+                       gpio_free(irq_to_gpio(ts->irq));\r
                        goto err_input_register_device_failed;\r
                }\r
        }\r
@@ -1383,13 +1383,13 @@ rewrite:
                        {\r
                                printk(KERN_INFO"Disable TS int!\n");\r
                                g_enter_isp = 1;\r
-                                       disable_irq(TS_INT);\r
+                               disable_irq(gpio_to_irq(ts->irq));\r
                        }\r
                        else if(cmd[1] == CMD_ENABLE_TP)\r
                        {\r
                                printk(KERN_INFO"Enable TS int!\n");\r
                                g_enter_isp = 0;\r
-                                       enable_irq(TS_INT);\r
+                               enable_irq(gpio_to_irq(ts->irq));\r
                        }\r
                        else if(cmd[1] == CMD_READ_VER)\r
                        {\r
@@ -1512,7 +1512,7 @@ static int goodix_update_read( char *page, char **start, off_t off, int count, i
        struct rk_ts_data *ts;\r
        int len = 0;\r
        char *version_info = NULL;\r
-       unsigned char read_data[1201] = {80, };\r
+       static unsigned char read_data[1201] = {80, };\r
 \r
        ts = i2c_get_clientdata(i2c_connect_client);\r
        if(ts==NULL)\r