tp: vtl fix init warning
authorzyk <“zyk@rock-chips.com”>
Wed, 30 Apr 2014 09:53:01 +0000 (17:53 +0800)
committerzyk <“zyk@rock-chips.com”>
Wed, 30 Apr 2014 09:53:01 +0000 (17:53 +0800)
drivers/input/touchscreen/vtl_ts/vtl_ts.c

index 8047f78a968f6531f2ad3fabf40dbeeb4a8abf19..4a2bfab23ece9de6ccbdc74897c36f12562f55d6 100755 (executable)
@@ -54,7 +54,7 @@ static volatile unsigned char thread_running_flag =0;
 // Globel or static variables\r
 // ****************************************************************************\r
 static struct ts_driver        g_driver;\r
-\r
+static int vtl_first_init_flag = 1;\r
 struct ts_info g_ts = {\r
        .driver = &g_driver,\r
        .debug  = DEBUG_ENABLE,\r
@@ -317,10 +317,10 @@ int vtl_ts_suspend(struct i2c_client *client, pm_message_t mesg)
        struct ts_info *ts;     \r
        unsigned char i;\r
        ts =pg_ts;\r
-\r
        DEBUG();\r
        if(ts->config_info.ctp_used)\r
        {\r
+               vtl_first_init_flag = 0;\r
                disable_irq(ts->config_info.irq_number);\r
                chip_enter_sleep_mode();\r
        \r
@@ -354,8 +354,8 @@ int vtl_ts_resume(struct i2c_client *client)
                        //input_mt_report_slot_state(ts->driver->input_dev, MT_TOOL_FINGER, false);\r
                }\r
                input_sync(ts->driver->input_dev);\r
-\r
-               enable_irq(ts->config_info.irq_number);\r
+               if(vtl_first_init_flag==0)\r
+                       enable_irq(ts->config_info.irq_number);\r
        }\r
        return 0;\r
 }\r
@@ -374,7 +374,6 @@ static void vtl_ts_early_resume(struct early_suspend *handler)
 {\r
        struct ts_info *ts;     \r
        ts =pg_ts;\r
-\r
        DEBUG();\r
 \r
        vtl_ts_resume(ts->driver->client);\r
@@ -531,9 +530,7 @@ static int vtl_ts_handler(void *data)
        //ts->driver->early_suspend.suspend = vtl_ts_early_suspend;\r
        //ts->driver->early_suspend.resume = vtl_ts_early_resume;\r
        //register_early_suspend(&ts->driver->early_suspend);\r
-       ts->tp.tp_resume = vtl_ts_early_resume;\r
-    ts->tp.tp_suspend = vtl_ts_early_suspend;\r
-    tp_register_fb(&ts->tp);\r
+       \r
        \r
 //#endif\r
 \r
@@ -543,8 +540,13 @@ static int vtl_ts_handler(void *data)
                dev_err(dev, "Unable to request irq for device %s.\n", DRIVER_NAME);\r
                goto ERR_IRQ_REQ;\r
        }\r
-\r
+       //disable_irq(pg_ts->config_info.irq_number);\r
        ts->config_info.ctp_used =1;\r
+       \r
+       ts->tp.tp_resume = vtl_ts_early_resume;\r
+    ts->tp.tp_suspend = vtl_ts_early_suspend;\r
+    tp_register_fb(&ts->tp);\r
+       \r
        while (!kthread_should_stop())//while(1)\r
        {\r
                //set_current_state(TASK_INTERRUPTIBLE);        \r
@@ -564,7 +566,7 @@ static int vtl_ts_handler(void *data)
                // Enable ts interrupt\r
                enable_irq(pg_ts->config_info.irq_number);\r
        }\r
-       disable_irq(pg_ts->config_info.irq_number);\r
+       \r
        printk("vtl_ts_Kthread exit,%s(%d)\n",__func__,__LINE__);\r
        return 0;\r
 \r