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 / ili2102_ts.c
index dbd723b95d3f7624f96e62ef0232e694406e8a77..ff3775d646be6f6eb0e7e262f1ff158ead935f37 100755 (executable)
@@ -151,7 +151,7 @@ static ssize_t ilitek_file_write(struct file *filp, const char *buf, size_t coun
        msg[0].scl_rate = 400*1000;
        msg[0].udelay = 80;
 
-       printk("%s:count=0x%x\n",__FUNCTION__,count);
+       DBG("%s:count=0x%x\n",__FUNCTION__,count);
        
        // before sending data to touch device, we need to check whether the device is working or not
        if(g_ts->valid_i2c_register == 0){
@@ -266,7 +266,7 @@ static int ilitek_file_ioctl(struct inode *inode, struct file *filp, unsigned in
                return -1;
        }
        
-       printk("%s:cmd=0x%x\n",__FUNCTION__,cmd);
+       DBG("%s:cmd=0x%x\n",__FUNCTION__,cmd);
        
        return 0;
 }
@@ -298,11 +298,13 @@ static int verify_coord(struct ili2102_ts_data *ts,unsigned int *x,unsigned int
 {
 
        //DBG("%s:(%d/%d)\n",__FUNCTION__,*x, *y);
+       #ifndef CONFIG_MACH_RK29_TD8801_V2
        if((*x< ts->x_min) || (*x > ts->x_max))
                return -1;
 
        if((*y< ts->y_min) || (*y > ts->y_max))
                return -1;
+    #endif
 
        /*android do not support min and max value*/
        if(*x == ts->x_min)
@@ -344,14 +346,14 @@ static void ili2102_ts_work_func(struct work_struct *work)
        msg[0].flags = ts->client->flags;
        msg[0].len = 1;
        msg[0].buf = &start_reg;
-       msg[0].scl_rate = 400*1000;
-       msg[0].udelay = 250;
+       msg[0].scl_rate = 200*1000;
+       msg[0].udelay = 200;
        
        msg[1].addr = ts->client->addr;
        msg[1].flags = ts->client->flags | I2C_M_RD;
        msg[1].len = 9; 
        msg[1].buf = buf;
-       msg[1].scl_rate = 400*1000;
+       msg[1].scl_rate = 200*1000;
        msg[1].udelay = 0;
        
        ret = i2c_transfer(ts->client->adapter, msg, 2); 
@@ -398,7 +400,10 @@ static void ili2102_ts_work_func(struct work_struct *work)
                                        x = g_x[i];
                                        y = g_y[i];
                                }
-
+                               #ifdef CONFIG_MACH_RK29_TD8801_V2
+                               if( y >=80 ) y-=80;
+                               if( x >= 50 ) x-=50;
+                               #endif
                                g_x[i] = x;
                                g_y[i] = y;                     
                                input_event(ts->input_dev, EV_ABS, ABS_MT_TRACKING_ID, i);
@@ -419,7 +424,7 @@ static void ili2102_ts_work_func(struct work_struct *work)
        if(syn_flag)
        input_sync(ts->input_dev);
 out:   
-#if 1
+#if 0
        if(ts->pendown)
        {
                schedule_delayed_work(&ts->work, msecs_to_jiffies(12));