思路是:在tp驱动中添加,休眠后触摸模拟上报powerkey 的功能,即可实现。
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(>p_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);
原文链接:https://blog.csdn.net/SHH_1064994894/article/details/119641066