mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
input: touchscreen: chipone_tddi_v2_mmi: Disable dt-gesture sensor when using dt2w control
Use KEY_WAKEUP when CONFIG_BOARD_USES_DOUBLE_TAP_CTRL is set and send it through the touchscreen input device instead of the sensor so the event actually reaches userspace. Change-Id: Iad715a9bbc8b12b7302a4088750f0093432b9333
This commit is contained in:
parent
559c39db38
commit
fae4566d40
4 changed files with 36 additions and 12 deletions
|
|
@ -112,6 +112,25 @@
|
|||
|
||||
#define CFG_CTS_NUM_GESTURE (14u)
|
||||
#define CFG_CTS_GESTURE_REPORT_KEY
|
||||
#ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
#define CFG_CTS_GESTURE_KEYMAP \
|
||||
{ \
|
||||
{ GESTURE_C, KEY_C,}, \
|
||||
{ GESTURE_W, KEY_W,}, \
|
||||
{ GESTURE_V, KEY_V,}, \
|
||||
{ GESTURE_D_TAP, KEY_WAKEUP,}, \
|
||||
{ GESTURE_Z, KEY_Z,}, \
|
||||
{ GESTURE_M, KEY_M,}, \
|
||||
{ GESTURE_O, KEY_O,}, \
|
||||
{ GESTURE_E, KEY_E,}, \
|
||||
{ GESTURE_S, KEY_S,}, \
|
||||
{ GESTURE_UP, KEY_UP,}, \
|
||||
{ GESTURE_DOWN, KEY_DOWN,}, \
|
||||
{ GESTURE_LEFT, KEY_LEFT,}, \
|
||||
{ GESTURE_RIGHT, KEY_RIGHT,}, \
|
||||
{ GESTURE_TAP, BTN_TRIGGER_HAPPY3,}, \
|
||||
}
|
||||
#else
|
||||
#define CFG_CTS_GESTURE_KEYMAP \
|
||||
{ \
|
||||
{ GESTURE_C, KEY_C,}, \
|
||||
|
|
@ -129,6 +148,7 @@
|
|||
{ GESTURE_RIGHT, KEY_RIGHT,}, \
|
||||
{ GESTURE_TAP, BTN_TRIGGER_HAPPY3,}, \
|
||||
}
|
||||
#endif
|
||||
#define CFG_CTS_GESTURE_REPORT_TRACE 0
|
||||
#endif /* CFG_CTS_GESTURE */
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "cts_config.h"
|
||||
#include <linux/mmi_wake_lock.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#ifdef CHIPONE_SENSOR_EN
|
||||
#if defined(CHIPONE_SENSOR_EN) && !defined(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL)
|
||||
#include <linux/sensors.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -401,7 +401,7 @@ enum touch_panel_id {
|
|||
TOUCH_PANEL_MAX_IDX,
|
||||
};
|
||||
|
||||
#ifdef CHIPONE_SENSOR_EN
|
||||
#if defined(CHIPONE_SENSOR_EN) && !defined(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL)
|
||||
struct chipone_sensor_platform_data {
|
||||
struct input_dev *input_sensor_dev;
|
||||
struct sensors_classdev ps_cdev;
|
||||
|
|
@ -452,7 +452,7 @@ struct chipone_ts_data {
|
|||
bool wakeable;
|
||||
bool should_enable_gesture;
|
||||
bool gesture_enabled;
|
||||
uint32_t report_gesture_key;
|
||||
#ifndef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
struct chipone_sensor_platform_data *sensor_pdata;
|
||||
#ifdef CONFIG_HAS_WAKELOCK
|
||||
struct wake_lock gesture_wakelock;
|
||||
|
|
@ -460,6 +460,7 @@ struct chipone_ts_data {
|
|||
struct wakeup_source *gesture_wakelock;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GTP_LAST_TIME
|
||||
ktime_t last_event_time;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ MODULE_PARM_DESC(debug_log, "Show debug log control");
|
|||
|
||||
struct chipone_ts_data *g_cts_data;
|
||||
|
||||
#ifdef CHIPONE_SENSOR_EN
|
||||
#if defined(CHIPONE_SENSOR_EN) && !defined(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL)
|
||||
extern int __attribute__ ((weak)) sensors_classdev_register(struct device *parent, struct sensors_classdev *sensors_cdev);
|
||||
extern void __attribute__ ((weak)) sensors_classdev_unregister(struct sensors_classdev *sensors_cdev);
|
||||
#endif
|
||||
|
|
@ -498,8 +498,7 @@ static int cts_get_panel(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CHIPONE_SENSOR_EN
|
||||
#if defined(CHIPONE_SENSOR_EN) && !defined(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL)
|
||||
static struct sensors_classdev __maybe_unused sensors_touch_cdev = {
|
||||
|
||||
.name = "dt-gesture",
|
||||
|
|
@ -558,9 +557,6 @@ static int chipone_sensor_init(struct chipone_ts_data *data)
|
|||
|
||||
__set_bit(EV_KEY, sensor_input_dev->evbit);
|
||||
__set_bit(BTN_TRIGGER_HAPPY3, sensor_input_dev->keybit);
|
||||
#ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
__set_bit(BTN_TRIGGER_HAPPY6, sensor_input_dev->keybit);
|
||||
#endif
|
||||
__set_bit(EV_SYN, sensor_input_dev->evbit);
|
||||
|
||||
sensor_input_dev->name = "double-tap";
|
||||
|
|
@ -652,7 +648,7 @@ static int cts_driver_probe(struct spi_device *client)
|
|||
struct chipone_ts_data *cts_data = NULL;
|
||||
int ret = 0;
|
||||
|
||||
#ifdef CHIPONE_SENSOR_EN
|
||||
#if defined(CHIPONE_SENSOR_EN) && !defined(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL)
|
||||
static bool initialized_sensor;
|
||||
#endif
|
||||
|
||||
|
|
@ -864,7 +860,7 @@ static int cts_driver_probe(struct spi_device *client)
|
|||
|
||||
INIT_WORK(&cts_data->ts_resume_work, cts_resume_work_func);
|
||||
|
||||
#ifdef CHIPONE_SENSOR_EN
|
||||
#if defined(CHIPONE_SENSOR_EN) && !defined(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL)
|
||||
if (!initialized_sensor) {
|
||||
#ifdef CONFIG_HAS_WAKELOCK
|
||||
wake_lock_init(&(cts_data->gesture_wakelock), WAKE_LOCK_SUSPEND, "dt-wake-lock");
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@
|
|||
#include "cts_sysfs.h"
|
||||
#include "cts_tcs.h"
|
||||
extern struct chipone_ts_data *g_cts_data;
|
||||
#ifndef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
static struct wakeup_source *gesture_wakelock;
|
||||
#endif
|
||||
|
||||
#ifdef CFG_CTS_FW_LOG_REDIRECT
|
||||
size_t cts_plat_get_max_fw_log_size(struct cts_platform_data *pdata)
|
||||
|
|
@ -516,7 +518,9 @@ static irqreturn_t cts_plat_irq_handler(int irq, void *dev_id)
|
|||
if ((cts_data->cts_dev.rtdata.suspended) &&
|
||||
(cts_data->cts_dev.rtdata.gesture_wakeup_enabled)) {
|
||||
if (pdata->gesture_wait_pm) {
|
||||
#ifndef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
PM_WAKEUP_EVENT(cts_data->gesture_wakelock, 3000);
|
||||
#endif
|
||||
/* Waiting for pm resume completed */
|
||||
ret = wait_event_interruptible_timeout(cts_data->pm_wq, atomic_read(&cts_data->pm_resume), msecs_to_jiffies(700));
|
||||
if (!ret) {
|
||||
|
|
@ -770,6 +774,9 @@ int cts_init_platform_data(struct cts_platform_data *pdata,
|
|||
#endif /* CONFIG_CTS_SLOTPROTOCOL */
|
||||
__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
|
||||
__set_bit(EV_ABS, input_dev->evbit);
|
||||
#ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
__set_bit(KEY_WAKEUP, input_dev->keybit);
|
||||
#endif
|
||||
input_set_drvdata(input_dev, pdata);
|
||||
ret = input_register_device(input_dev);
|
||||
if (ret) {
|
||||
|
|
@ -1338,7 +1345,7 @@ int cts_plat_process_gesture_info(struct cts_platform_data *pdata,
|
|||
for (i = 0; i < CFG_CTS_NUM_GESTURE; i++) {
|
||||
if (gesture_info->gesture_id == pdata->gesture_keymap[i][0]) {
|
||||
cts_info("Report key[%u]", pdata->gesture_keymap[i][1]);
|
||||
#ifdef CHIPONE_SENSOR_EN
|
||||
#if defined(CHIPONE_SENSOR_EN) && !defined(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL)
|
||||
PM_WAKEUP_EVENT(gesture_wakelock, 5000);
|
||||
input_report_key(g_cts_data->sensor_pdata->input_sensor_dev, pdata->gesture_keymap[i][1], 1);
|
||||
input_sync(g_cts_data->sensor_pdata->input_sensor_dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue