Skip to content

Commit

Permalink
touchscreen: add AOSPA's dt2w support (whyred)
Browse files Browse the repository at this point in the history
Co-authored-by: orgesified <[email protected]>
Signed-off-by: negrroo <[email protected]>
  • Loading branch information
2 people authored and negrroo1 committed Feb 10, 2024
1 parent 59ca3f9 commit 1ae61c2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/input/touchscreen/nvt_touch_e7s/nt36xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ const uint16_t gesture_key_array[] = {
KEY_WAKEUP,
KEY_WAKEUP,
KEY_WAKEUP,
KEY_DOUBLE_TAP,
};

bool enable_gesture_mode = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1127,8 +1127,10 @@ static int synaptics_rmi4_f11_abs_report(struct synaptics_rmi4_data *rmi4_data,

if (detected_gestures) {
input_report_key(rmi4_data->input_dev, KEY_WAKEUP, 1);
input_report_key(rmi4_data->input_dev, KEY_DOUBLE_TAP, 1);
input_sync(rmi4_data->input_dev);
input_report_key(rmi4_data->input_dev, KEY_WAKEUP, 0);
input_report_key(rmi4_data->input_dev, KEY_DOUBLE_TAP, 0);
input_sync(rmi4_data->input_dev);
rmi4_data->suspend = false;
}
Expand Down Expand Up @@ -1297,8 +1299,10 @@ static int synaptics_rmi4_f12_abs_report(struct synaptics_rmi4_data *rmi4_data,

if (gesture_type && gesture_type != F12_UDG_DETECT) {
input_report_key(rmi4_data->input_dev, KEY_WAKEUP, 1);
input_report_key(rmi4_data->input_dev, KEY_DOUBLE_TAP, 1);
input_sync(rmi4_data->input_dev);
input_report_key(rmi4_data->input_dev, KEY_WAKEUP, 0);
input_report_key(rmi4_data->input_dev, KEY_DOUBLE_TAP, 0);
input_sync(rmi4_data->input_dev);

rmi4_data->suspend = false;
Expand Down Expand Up @@ -3482,7 +3486,9 @@ static void synaptics_rmi4_set_params(struct synaptics_rmi4_data *rmi4_data)

if (rmi4_data->f11_wakeup_gesture || rmi4_data->f12_wakeup_gesture) {
set_bit(KEY_WAKEUP, rmi4_data->input_dev->keybit);
set_bit(KEY_DOUBLE_TAP, rmi4_data->input_dev->keybit);
input_set_capability(rmi4_data->input_dev, EV_KEY, KEY_WAKEUP);
input_set_capability(rmi4_data->input_dev, EV_KEY, KEY_DOUBLE_TAP);
}

return;
Expand Down Expand Up @@ -4388,7 +4394,7 @@ static int synaptics_rmi4_probe(struct platform_device *pdev)
queue_work(rmi4_data->reset_workqueue, &rmi4_data->reset_work);
#endif
input_set_capability(rmi4_data->input_dev, EV_KEY, KEY_WAKEUP);

input_set_capability(rmi4_data->input_dev, EV_KEY, KEY_DOUBLE_TAP);
INIT_WORK(&rmi4_data->fb_notify_work, tp_fb_notifier_resume_work);

return retval;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1498,8 +1498,10 @@ static void udg_report(void)

if (udg->detection_status == DETECTION) {
input_report_key(udg->udg_dev, KEY_WAKEUP, 1);
input_report_key(udg->udg_dev, KEY_DOUBLE_TAP, 1);
input_sync(udg->udg_dev);
input_report_key(udg->udg_dev, KEY_WAKEUP, 0);
input_report_key(udg->udg_dev, KEY_DOUBLE_TAP, 0);
input_sync(udg->udg_dev);
rmi4_data->suspend = false;
}
Expand Down Expand Up @@ -2041,7 +2043,9 @@ static int synaptics_rmi4_udg_init(struct synaptics_rmi4_data *rmi4_data)

set_bit(EV_KEY, udg->udg_dev->evbit);
set_bit(KEY_WAKEUP, udg->udg_dev->keybit);
set_bit(KEY_DOUBLE_TAP, udg->udg_dev->keybit);
input_set_capability(udg->udg_dev, EV_KEY, KEY_WAKEUP);
input_set_capability(udg->udg_dev, EV_KEY, KEY_DOUBLE_TAP);

retval = input_register_device(udg->udg_dev);
if (retval) {
Expand Down
1 change: 1 addition & 0 deletions include/uapi/linux/input-event-codes.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
#define KEY_SETUP 141
#define KEY_SLEEP 142 /* SC System Sleep */
#define KEY_WAKEUP 143 /* System Wake Up */
#define KEY_DOUBLE_TAP 750 /* DT2W */
#define KEY_FILE 144 /* AL Local Machine Browser */
#define KEY_SENDFILE 145
#define KEY_DELETEFILE 146
Expand Down

0 comments on commit 1ae61c2

Please sign in to comment.