Support goodix single tap to wake the device

TP:
Support goodix single tap to wake the device.

Change-Id: I038edf7655f6944653d22e13c3ec056baca77084
Reviewed-on: https://gerrit.mot.com/2105483
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 2021-11-02 14:52:34 +08:00 • committed by litong
commit 70be896a4a
6 changed files with 35 additions and 2 deletions

View file

@ -237,7 +237,7 @@ int brl_resume(struct goodix_ts_core *cd)
return cd->hw_ops->reset(cd, GOODIX_NORMAL_RESET_DELAY_MS);
}
#define GOODIX_GESTURE_CMD 0x12
#define GOODIX_GESTURE_CMD 0xA6
int brl_gesture(struct goodix_ts_core *cd, int gesture_type)
{
struct goodix_ts_cmd cmd;
@ -311,7 +311,7 @@ static int brl_irq_enbale(struct goodix_ts_core *cd, bool enable)
ts_debug("Irq disabled");
return 0;
}
ts_info("warnning: irq deepth inbalance!");
ts_debug("warnning: irq deepth inbalance!");
return 0;
}

View file

@ -2303,6 +2303,14 @@ static int goodix_ts_probe(struct platform_device *pdev)
goto err_out;
}
PM_WAKEUP_REGISTER(bus_interface->dev, core_data->gesture_wakelock,
"goodix_gesture_wakelock");
if (!core_data->gesture_wakelock) {
ts_info("allocate gesture wakeup source err!\n");
ret = -ENOMEM;
goto err_register_gesture_wakelock;
}
/* debug node init */
goodix_tools_init();
@ -2313,6 +2321,8 @@ static int goodix_ts_probe(struct platform_device *pdev)
ts_info("goodix_ts_core probe success");
return 0;
err_register_gesture_wakelock:
PM_WAKEUP_UNREGISTER(core_data->gesture_wakelock);
err_out:
core_data->init_stage = CORE_INIT_FAIL;
core_module_prob_sate = CORE_MODULE_PROB_FAILED;

View file

@ -473,6 +473,7 @@ struct goodix_ts_core {
/* when this flag is true, driver should not clean the sync flag */
bool tools_ctrl_sync;
struct wakeup_source *gesture_wakelock;
struct notifier_block ts_notifier;
struct goodix_ts_esd ts_esd;

View file

@ -26,6 +26,7 @@
#include <linux/delay.h>
#include <linux/atomic.h>
#include "goodix_ts_core.h"
#include "goodix_ts_mmi.h"
#define QUERYBIT(longlong, bit) (!!(longlong[bit/8] & (1 << bit%8)))
@ -245,6 +246,20 @@ static int gsx_gesture_ist(struct goodix_ts_core *cd,
if (QUERYBIT(gsx_gesture->gesture_type,
gs_event.gesture_type)) {
gsx_gesture->gesture_data = gs_event.gesture_type;
#if defined(CONFIG_INPUT_TOUCHSCREEN_MMI)
if (cd->imports && cd->imports->report_gesture) {
struct gesture_event_data mmi_event;
ts_info("invoke imported report gesture function\n");
mmi_event.evcode = 1;
/* call class method */
ret = cd->imports->report_gesture(&mmi_event);
if (!ret)
PM_WAKEUP_EVENT(cd->gesture_wakelock, 3000);
goto gesture_ist_exit;
}
#endif
/* do resume routine */
ts_info("got valid gesture type 0x%x",
gs_event.gesture_type);
@ -353,6 +368,9 @@ int gesture_module_init(void)
}
module_initialized = true;
goodix_gesture_enable(1);
ts_info("gesture module init success");
return 0;

View file

@ -360,6 +360,9 @@ static int goodix_ts_mmi_panel_state(struct device *dev,
core_data->gesture_enabled = false;
break;
case TS_MMI_PM_ACTIVE:
if (hw_ops->resume)
hw_ops->resume(core_data);
core_data->gesture_enabled = false;
break;
default:
ts_err("Invalid power state parameter %d.\n", to);

View file

@ -15,6 +15,7 @@
#include <linux/platform_device.h>
#include <linux/touchscreen_mmi.h>
#include <linux/mmi_wake_lock.h>
#ifdef CONFIG_INPUT_TOUCHSCREEN_MMI
int goodix_ts_mmi_dev_register(struct platform_device *ts_device);