ct36x compatible ct363 and ct365
authorzyk <“zyk@rock-chips.com”>
Tue, 11 Mar 2014 07:59:26 +0000 (15:59 +0800)
committerzyk <“zyk@rock-chips.com”>
Tue, 11 Mar 2014 07:59:26 +0000 (15:59 +0800)
arch/arm/boot/dts/rk3188-tb.dts
drivers/input/touchscreen/Kconfig [changed mode: 0644->0755]
drivers/input/touchscreen/ct36x/core.c
drivers/input/touchscreen/ct36x/ct36x_priv.h
drivers/input/touchscreen/ct36x/ct36x_ts.c [changed mode: 0644->0755]

index a4cee92a20172a2b5698513c1a1834eb89e695af..d56767193131a641dd8f1c3e000684b675908b1a 100755 (executable)
        ts@01 {
                compatible = "ct,ct36x";
                reg = <0x01>;
-               ct-model = <363>;
+               ct-model = <365>;
                touch-gpio = <&gpio1 GPIO_B7 IRQ_TYPE_LEVEL_LOW>;
                reset-gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_HIGH>;
                max-x = <1280>;
old mode 100644 (file)
new mode 100755 (executable)
index 9d76f8d..7eb38c9
@@ -21,18 +21,6 @@ config TOUCHSCREEN_GT8XX
 
 config CT36X_TS
        tristate "CT36X touchscreens support"
-choice
-       prompt "ct36x chip select"
-       depends on CT36X_TS
-       default CT365_TS
-
-       config CT365_TS
-         bool "ct365"
-       config CT363_TS
-         bool "ct363"
-       config CT361_TS
-         bool "ct360"
-endchoice
          
 config TOUCHSCREEN_88PM860X
        tristate "Marvell 88PM860x touchscreen"
index b8a48b480539bad9d43dadae5f6e354950ca51f5..d2af589c7890f55eea6227d6c98487c587736c31 100755 (executable)
@@ -7,14 +7,15 @@
 #define CT36X_CHIP_FLASH_SECTOR_SIZE   128
 #define CT36X_CHIP_FLASH_SOURCE_SIZE   8
 
-static unsigned char binary_data[] = {
-#ifdef CONFIG_CT365_TS
+static unsigned char ct365_binary_data[] = {
 #include "RK_DPT101_CT365_01_V02_099E_140107.dat"
-#else
+};
+
+static unsigned char ct363_binary_data[] = {
 #include "wgj97112tsm01_CT363_01_V01_EA50_140224.dat"
-#endif
 };
 
+
 int ct36x_chip_set_idle(struct ct36x_data *ts)
 {
        int ret = 0;
@@ -86,7 +87,13 @@ static int ct36x_chip_set_code(unsigned short flash_addr, char *buf)
        buf[2] = (char)(flash_addr >> 8);
        buf[3] = (char)(flash_addr & 0xFF);
        buf[4] = 0x08;
-
+       unsigned char *binary_data;
+       
+       if(flag_ct36x_model ==365)
+               binary_data = ct365_binary_data;
+       else if(flag_ct36x_model ==363)
+               binary_data = ct363_binary_data;
+               
        // Fill firmware source data
        if ( flash_addr == (160) || flash_addr == (168) ) {
                buf[6] = ~binary_data[flash_addr + 0];
index efd56d39bba7b53dc59d9b47bc3af2cc59a90e2c..770a4d9720c5a04fd8fa6a30f5b31b6dcc64a78f 100755 (executable)
@@ -28,6 +28,8 @@
 //#else
 //#define ct36x_dbg(ts, format, arg...)
 //#endif
+int flag_ct36x_model;
+
 int ct36x_dbg_level = 0;
 module_param_named(dbg_level, ct36x_dbg_level, int, 0644);
 #if 1
old mode 100644 (file)
new mode 100755 (executable)
index 54671e0..5330f42
@@ -10,6 +10,7 @@ int inline ct36x_set_ops(struct ct36x_data *ts, int model)
        switch(model){
                case 360: ts->ops = &ct360_ops; break;
                case 363: ts->ops = &ct363_ops; break;
+               case 365: ts->ops = &ct363_ops; break;
                default: return -EINVAL;
        };
 
@@ -185,6 +186,7 @@ static int ct36x_ts_probe(struct i2c_client *client, const struct i2c_device_id
                return -EINVAL;
        }
        ts->model = val;//pdata->model;
+       flag_ct36x_model = ts->model;
        //ts->x_max = pdata->x_max;
        //ts->y_max = pdata->y_max;
        //ts->rst_io = pdata->rst_io;