fix driver bug : muti-touch & td8801
author张昊 <zhanghao@rock-chips.com>
Thu, 24 Nov 2011 03:42:39 +0000 (11:42 +0800)
committer张昊 <zhanghao@rock-chips.com>
Thu, 24 Nov 2011 03:42:39 +0000 (11:42 +0800)
drivers/input/touchscreen/gt818_ts.c
drivers/input/touchscreen/pixcir_i2c_ts.c
drivers/misc/mtk23d.c
drivers/misc/tdsc8800.c
include/linux/mtk23d.h

index 4a447f7d4750a1a6d88851134b4d8ce2ac4ef997..8dd6b5d20f94279ae9d52c8c1bd7d88d066821b9 100644 (file)
@@ -350,8 +350,9 @@ static void goodix_ts_work_func(struct work_struct *work)
                        syn_flag = 1;\r
                }\r
 \r
-               input_sync(ts->input_dev);\r
-       }\r
+}\r
+input_sync(ts->input_dev);\r
+\r
 \r
 \r
 #ifdef HAVE_TOUCH_KEY\r
index 03464b4281bfbddf88003adf11d4014718985269..cdd5c83f34a86f363b5c476d11518074bd0fbd78 100644 (file)
@@ -259,7 +259,7 @@ static void pixcir_ts_poscheck(struct pixcir_i2c_ts_data *data)
                                input_report_abs(tsdata->input, ABS_MT_POSITION_X, point[i].posy);
                                input_report_abs(tsdata->input, ABS_MT_POSITION_Y, point[i].posx);
 
-                               input_sync(tsdata->input);
+                               //input_sync(tsdata->input);
 
                                DBG("brn%d=%2d id%d=%1d x=%5d y=%5d \n",
                                        i,point[i].brn,i,point[i].id,point[i].posy,point[i].posx);
@@ -286,17 +286,17 @@ static void pixcir_ts_work_func(struct work_struct *work)
                        DBG("%s:  >>>>>touch release\n\n",__FUNCTION__);
                        enable_irq(tsdata->client->irq);
                        //input_report_key(tsdata->input, BTN_TOUCH, 0);
-                       input_report_abs(tsdata->input, ABS_MT_TOUCH_MAJOR, 0);
+                       //input_report_abs(tsdata->input, ABS_MT_TOUCH_MAJOR, 0);
                        input_mt_slot(tsdata->input, 0);
                        input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, false);
                        //input_report_key(tsdata->input, ABS_MT_WIDTH_MAJOR,0);
-                       input_sync(tsdata->input);
                        break;
                }
 
                msleep(1);
        }
 
+       input_sync(tsdata->input);
        return;
 }
 
index a0fe107d3e46bb71410403a82f55202fa87cea43..8f8dae6233953a2afaa3b875b538688cd75e8f22 100755 (executable)
@@ -291,9 +291,9 @@ int modem_poweron_off(int on_off)
 static int power_on =1;
 static int mtk23d_open(struct inode *inode, struct file *file)
 {
-       struct rk2818_23d_data *pdata = gpdata;
+       //struct rk2818_23d_data *pdata = gpdata;
        //struct rk2818_23d_data *pdata = gpdata = pdev->dev.platform_data;
-       struct platform_data *pdev = container_of(pdata, struct device, platform_data);
+       //struct platform_data *pdev = container_of(pdata, struct device, platform_data);
 
        MODEMDBG("modem_open\n");
 
@@ -303,7 +303,7 @@ static int mtk23d_open(struct inode *inode, struct file *file)
                power_on = 0;
                modem_poweron_off(1);
        }
-       device_init_wakeup(&pdev, 1);
+       device_init_wakeup(&pdev->dev, 1);
 
        return 0;
 }
@@ -424,6 +424,7 @@ static int mtk23d_probe(struct platform_device *pdev)
        MODEMDBG("mtk23d_probe\n");
 
        //pdata->io_init();
+       pdata->dev = &pdev->dev;
 
        mt6223d_data = kzalloc(sizeof(struct modem_dev), GFP_KERNEL);
        if(NULL == mt6223d_data)
index d4ffb891cac31d8c01b746d7b00fdb6c3a84a32e..d30d82ccb17ac9f4b7483c9b4cd3878ec13f1950 100755 (executable)
@@ -31,7 +31,6 @@ MODULE_LICENSE("GPL");
 #define MODEMDBG(fmt,argss...)
 #endif
 
-static bool wakelock_inited;
 #define SLEEP 1
 #define READY 0
 struct rk2818_23d_data *gpdata = NULL;
@@ -40,7 +39,6 @@ struct rk2818_23d_data *gpdata = NULL;
 int modem_poweron_off(int on_off)
 {
        struct rk2818_23d_data *pdata = gpdata;
-       int result, error = 0, irq = 0; 
        
        if(on_off)
        {
@@ -53,18 +51,12 @@ int modem_poweron_off(int on_off)
                printk("tdsc8800_poweroff\n");
                gpio_set_value(pdata->bp_power, pdata->bp_power_active_low? GPIO_LOW:GPIO_HIGH);
        }
+       return 0;
 }
 static int tdsc8800_open(struct inode *inode, struct file *file)
 {
-       struct rk2818_23d_data *pdata = gpdata;
-       //struct rk2818_23d_data *pdata = gpdata = pdev->dev.platform_data;
-       struct platform_data *pdev = container_of(pdata, struct device, platform_data);
-
-       MODEMDBG("tdsc8800_open\n");
-
-       int ret = 0;
        modem_poweron_off(1);
-       device_init_wakeup(&pdev, 1);
+       device_init_wakeup(gpdata->dev, 1);
 
        return 0;
 }
@@ -75,7 +67,7 @@ static int tdsc8800_release(struct inode *inode, struct file *file)
 
        return 0;
 }
-static int tdsc8800_ioctl(struct inode *inode,struct file *file, unsigned int cmd, unsigned long arg)
+static long  tdsc8800_ioctl(struct file *file, unsigned int a, unsigned long b)
 {
        return 0;
 }
@@ -97,12 +89,13 @@ static int tdsc8800_probe(struct platform_device *pdev)
 {
        struct rk2818_23d_data *pdata = gpdata = pdev->dev.platform_data;
        struct modem_dev *tdsc8800_data = NULL;
-       int result, error = 0, irq = 0; 
+       int result = 0; 
        
        MODEMDBG("tdsc8800_probe\n");
 
        //pdata->io_init();
 
+       pdata->dev = &pdev->dev;
        tdsc8800_data = kzalloc(sizeof(struct modem_dev), GFP_KERNEL);
        if(NULL == tdsc8800_data)
        {
@@ -133,7 +126,6 @@ err1:
        gpio_free(pdata->bp_power);
 err6:
        kfree(tdsc8800_data);
-ret:
        return result;
 }
 
@@ -172,8 +164,9 @@ static struct platform_driver tdsc8800_driver = {
 
 static int __init tdsc8800_init(void)
 {
-       MODEMDBG("tdsc8800_init ret=%d\n");
-       return platform_driver_register(&tdsc8800_driver);
+       int ret = platform_driver_register(&tdsc8800_driver);
+       MODEMDBG("tdsc8800_init ret=%d\n",ret);
+       return ret;
 }
 
 static void __exit tdsc8800_exit(void)
index 9c5f11a819d54bba93660e87afe55cb20b4fdb56..28facec4e825cc975401ec4272790abce3ef8745 100755 (executable)
@@ -11,6 +11,7 @@ struct modem_dev
 
 /* è\80³æ\9cºæ\95°æ\8d®ç»\93æ\9e\84ä½?*/
 struct rk2818_23d_data {
+       struct device *dev;
        int (*io_init)(void);
        int (*io_deinit)(void);
        unsigned int bp_power;