From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: SENEMOS patch gate Date: Mon, 31 Aug 2026 13:05:41 +0300 Subject: [PATCH 12/23] nabu: port DT2W stable refresh switching and charging to 6.18 --- drivers/input/touchscreen/nt36523/nt36xxx.c | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/input/touchscreen/nt36523/nt36xxx.c b/drivers/input/touchscreen/nt36523/nt36xxx.c index 3d31d2268..d743c7676 100644 --- a/drivers/input/touchscreen/nt36523/nt36xxx.c +++ b/drivers/input/touchscreen/nt36523/nt36xxx.c @@ -1038,6 +1038,30 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data) goto XFER_ERROR; } + /* + * In low-power gesture mode the first report byte carries the gesture + * identifier rather than a finger slot. Nabu firmware reports double + * tap either directly as ID 15 or through protocol page 1. + */ + if (!bTouchIsAwake && ts->db_wakeup) { + uint8_t gesture_id = point_data[1] >> 3; + + if (gesture_id == DATA_PROTOCOL && + point_data[2] == FUNCPAGE_GESTURE) + gesture_id = point_data[3]; + + if (gesture_id == GESTURE_DOUBLE_CLICK) { + NVT_LOG("Gesture: double tap wakeup\n"); + pm_wakeup_event(&ts->client->dev, 5000); + input_report_key(ts->input_dev, KEY_WAKEUP, 1); + input_sync(ts->input_dev); + input_report_key(ts->input_dev, KEY_WAKEUP, 0); + input_sync(ts->input_dev); + } + + goto XFER_ERROR; + } + finger_cnt = 0; for (i = 0; i < ts->max_touch_num; i++) {