全志 添加TP休眠触摸唤醒 Patch

简介: 全志 添加TP休眠触摸唤醒 Patch
add TP触摸屏唤醒
 
diff --git a/android/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/android/frameworks/base/packa
index 9829100..d8fece9 100755
--- a/android/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/android/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -18,7 +18,7 @@
 -->
 <resources>
     <bool name="def_dim_screen">true</bool>
-    <integer name="def_screen_off_timeout">-1</integer>
+    <integer name="def_screen_off_timeout">180000</integer>
     <integer name="def_sleep_timeout">-1</integer>
     <bool name="def_airplane_mode_on">false</bool>
     <bool name="def_theater_mode_on">false</bool>
diff --git a/lichee/linux-3.10/drivers/input/touchscreen/gt9xx_new/gt9xx.c b/lichee/linux-3.10/drivers/input/touchscre
index babdd7e..96ce48b 100755
--- a/lichee/linux-3.10/drivers/input/touchscreen/gt9xx_new/gt9xx.c
+++ b/lichee/linux-3.10/drivers/input/touchscreen/gt9xx_new/gt9xx.c
@@ -463,6 +463,7 @@ static void gtp_touch_down(struct goodix_ts_data* ts,s32 id,s32 x,s32 y,s32 w)
 
 }
 
+extern int get_sleep_state(void);
 /*******************************************************
 Function:
        Touch up report function.
@@ -484,6 +485,12 @@ static void gtp_touch_up(struct goodix_ts_data* ts, s32 id)
         input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0);
         input_mt_sync(ts->input_dev);
 #endif
+#if GTP_WAKEUP_SLEEP_ENABLE == 1
+       if(get_sleep_state()) {
+               input_report_key(ts->input_dev, KEY_POWER, 1); 
+               input_report_key(ts->input_dev, KEY_POWER, 0);          
+       }
+#endif
 }
 
 /*******************************************************
@@ -998,7 +1005,9 @@ static s8 gtp_request_input_dev(struct goodix_ts_data *ts)
                 input_set_capability(ts->input_dev,EV_KEY,touch_key_array[index]);     
         }
 #endif
-
+#if GTP_WAKEUP_SLEEP_ENABLE == 1
+                input_set_capability(ts->input_dev,EV_KEY,KEY_POWER);
+#endif          
 //#if GTP_CHANGE_X2Y
 //        GTP_SWAP(ts->abs_x_max, ts->abs_y_max);
 //#endif
@@ -1214,7 +1223,7 @@ static void goodix_ts_early_suspend(struct early_suspend *h)
         struct goodix_ts_data *ts;
         s8 ret = -1;   
         ts = container_of(h, struct goodix_ts_data, early_suspend);
-
+ printk(" goodix_ts_early_suspend\n");
 #if GTP_ESD_PROTECT
         ts->gtp_is_suspend = 1;
         cancel_delayed_work_sync(&gtp_esd_check_work);
@@ -1248,7 +1257,7 @@ static void goodix_ts_late_resume(struct early_suspend *h)
 {
         struct goodix_ts_data *ts;
         ts = container_of(h, struct goodix_ts_data, early_suspend);
-       
+        printk(" goodix_ts_late_resume\n");
         queue_work(goodix_resume_wq, &goodix_resume_work);//gandy
 
 #if GTP_ESD_PROTECT
diff --git a/lichee/linux-3.10/drivers/input/touchscreen/gt9xx_new/gt9xx_ts.h b/lichee/linux-3.10/drivers/input/touchs
index a766d62..fccb141 100755
--- a/lichee/linux-3.10/drivers/input/touchscreen/gt9xx_new/gt9xx_ts.h
+++ b/lichee/linux-3.10/drivers/input/touchscreen/gt9xx_new/gt9xx_ts.h
@@ -106,7 +106,7 @@ extern struct ctp_config_info config_info;
 #define GTP_DEBUG_ON          0
 #define GTP_DEBUG_ARRAY_ON    0
 #define GTP_DEBUG_FUNC_ON     0
-
+#define GTP_WAKEUP_SLEEP_ENABLE      1
 //***************************PART2:TODO define**********************************
 //STEP_1(REQUIRED):Change config table.
 /*TODO: puts the config info corresponded to your TP here, the following is just 
diff --git a/lichee/linux-3.10/drivers/video/sunxi/disp2/disp/dev_disp.c b/lichee/linux-3.10/drivers/video/sunxi/disp2
index 2c6fc65..b7a95bb 100755
--- a/lichee/linux-3.10/drivers/video/sunxi/disp2/disp/dev_disp.c
+++ b/lichee/linux-3.10/drivers/video/sunxi/disp2/disp/dev_disp.c
@@ -36,6 +36,14 @@ static struct device *display_dev;
 static unsigned int g_disp = 0, g_enhance_mode = 0, g_cvbs_enhance_mode = 0;
 static u32 DISP_print = 0xffff;   //print cmd which eq DISP_print
 static bool g_pm_runtime_enable = 0; //when open the CONFIG_PM_RUNTIME,this bool can also control if use the PM_RUNTI
+
+static int g_sleep_flag_for_tp = 0;
+
+int get_sleep_state(void)
+{
+       return g_sleep_flag_for_tp;
+}
+EXPORT_SYMBOL(get_sleep_state);
 #ifndef CONFIG_OF
 static struct sunxi_disp_mod disp_mod[] = {
        {DISP_MOD_DE      ,    "de"   },
@@ -1437,7 +1445,7 @@ static int disp_runtime_suspend(struct device *dev)
        struct list_head* disp_list= NULL;
 
        pr_info("%s\n", __func__);
-
+       
        if (!g_pm_runtime_enable)
                return 0;
 
@@ -1481,7 +1489,7 @@ static int disp_runtime_resume(struct device *dev)
        struct list_head* disp_list= NULL;
 
        pr_info("%s\n", __func__);
-
+       g_sleep_flag_for_tp = 0;
        if (!g_pm_runtime_enable)
                return 0;
 
@@ -1531,7 +1539,7 @@ static int disp_runtime_resume(struct device *dev)
 static int disp_runtime_idle(struct device *dev)
 {
        pr_info("%s\n", __func__);
-
+       g_sleep_flag_for_tp = 1;
        if (g_disp_drv.dev) {
                pm_runtime_mark_last_busy(g_disp_drv.dev);
                pm_request_autosuspend(g_disp_drv.dev);
相关文章
|
6月前
MCS接口技术----定时/计数,中断
MCS接口技术----定时/计数,中断
68 0
|
6月前
|
Android开发
Android 12修改usb tp触摸唤醒
Android 12修改usb tp触摸唤醒
119 0
|
6月前
|
XML 存储 Android开发
Android系统 添加动态控制USB TP触摸方向、触摸唤醒
Android系统 添加动态控制USB TP触摸方向、触摸唤醒
196 0
|
6月前
|
调度
FreeRTOS深入教程(空闲任务和Tick中断深入分析)
FreeRTOS深入教程(空闲任务和Tick中断深入分析)
261 0
Linux驱动中断与时间篇——低分辨率定时器
Linux驱动中断与时间篇——低分辨率定时器
|
调度
按键演示休眠与唤醒场景--基于IMX6ULL
按键演示休眠与唤醒场景--基于IMX6ULL
145 0
按键演示休眠与唤醒场景--基于IMX6ULL
|
安全 网络协议 JavaScript
【玩转RT-Thread】 RT-Thread Studio使用(1)(按键控制电机正反转、蜂鸣器)
【玩转RT-Thread】 RT-Thread Studio使用(1)(按键控制电机正反转、蜂鸣器)
346 0
|
Linux 异构计算 Windows
如何expanded time来观察信号到来的先后顺序?(仿真工具使用技巧)【Modesim/Questasim】
如何expanded time来观察信号到来的先后顺序?(仿真工具使用技巧)【Modesim/Questasim】
如何expanded time来观察信号到来的先后顺序?(仿真工具使用技巧)【Modesim/Questasim】
|
安全 网络协议 JavaScript
【玩转 RT-Thread】 RT-Thread Studio —— 按键控制电机正反转、蜂鸣器
【玩转 RT-Thread】 RT-Thread Studio —— 按键控制电机正反转、蜂鸣器
447 0
【玩转 RT-Thread】 RT-Thread Studio —— 按键控制电机正反转、蜂鸣器