Merge cherrypicks of ['partner-android-review.googlesource.com/2772115'] into android13-msm-pixelwatch-5.15-p11-release. Change-Id: Ie423b63a584f58053e219aee7915a1b1871a2d77 Signed-off-by: Coastguard Worker <android-build-coastguard-worker@google.com>
diff --git a/tma525c/pt_core.c b/tma525c/pt_core.c index 41dc908..466a946 100644 --- a/tma525c/pt_core.c +++ b/tma525c/pt_core.c
@@ -41,6 +41,7 @@ #endif /* PT_PTSBC_SUPPORT */ #define PT_CORE_STARTUP_RETRY_COUNT 3 +#define PT_REPORT_TOUCH_EVENT_DELAY_TIME_MS 80 MODULE_FIRMWARE(PT_FW_FILE_NAME); @@ -48,6 +49,7 @@ static const char *pt_driver_core_version = PT_DRIVER_VERSION; static const char *pt_driver_core_date = PT_DRIVER_DATE; struct pt_input_event touch_event_list_head; +struct workqueue_struct *pt_touch_event_delay_wq; struct pt_hid_field { int report_count; @@ -13409,7 +13411,7 @@ } } -void pt_release_queued_input_event(void) +void pt_release_queued_input_event(struct work_struct *work) { struct pt_input_event *event; struct pt_input_event *next_event; @@ -17270,7 +17272,9 @@ switch (notification->notif_type) { case DRM_PANEL_EVENT_UNBLANK: if (!notification->notif_data.early_trigger) { - pt_release_queued_input_event(); + queue_delayed_work(pt_touch_event_delay_wq, + &core_data->delay_touch_event_work, + msecs_to_jiffies(PT_REPORT_TOUCH_EVENT_DELAY_TIME_MS)); pt_touch_display_resume(core_data); } break; @@ -22618,6 +22622,9 @@ nanohub_touch_register_listener(on_mcu_display_state_change, NANOHUB_TOUCH_COMMAND_LISTEN_ON_DISPLAY_STATE); pt_add_core(cd->dev); + INIT_DELAYED_WORK(&cd->delay_touch_event_work, pt_release_queued_input_event); + pt_touch_event_delay_wq = + alloc_workqueue("pt_touch_event_delay_wq", WQ_UNBOUND | WQ_MEM_RECLAIM, 1); #ifdef PT_PTSBC_SUPPORT /* * For the PtSBC, on the first bring up, I2C/SPI will not be ready
diff --git a/tma525c/pt_regs.h b/tma525c/pt_regs.h index d0b54a1..14afe93 100644 --- a/tma525c/pt_regs.h +++ b/tma525c/pt_regs.h
@@ -1911,6 +1911,7 @@ bool hw_detect_enabled; #endif ktime_t timestamp; /* time that the event was first received from the touch IC */ + struct delayed_work delay_touch_event_work; }; struct gd_sensor {