From f12d67042fa3fd21e64ea25bfebb138201f36b16 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Wed, 20 Sep 2023 14:40:14 +0800 Subject: [PATCH] Input: gt1x - Enable async suspend/resume on fb blank On rk3588-evb1-lp4-v10: Before: [ 101.214271][ T1989] PM: suspend exit [ 101.772978][ T412] dw-mipi-dsi2 fde20000.dsi: [drm:dw_mipi_dsi2_encoder_atomic_enable] final DSI-Link bandwidth: 880000 x 4 Kbps total: 0.558707 After: [ 266.604393][ T1971] PM: suspend exit [ 266.792421][ T410] dw-mipi-dsi2 fde20000.dsi: [drm:dw_mipi_dsi2_encoder_atomic_enable] final DSI-Link bandwidth: 880000 x 4 Kbps total: 0.188028, save about 0.37s. Signed-off-by: Tao Huang Change-Id: I7310b11e2897c79ce8b0c61d8b98760a4f8699f3 --- drivers/input/touchscreen/gt1x/gt1x.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/gt1x/gt1x.c b/drivers/input/touchscreen/gt1x/gt1x.c index 5871d5d556ef..8c8e06d6e96d 100644 --- a/drivers/input/touchscreen/gt1x/gt1x.c +++ b/drivers/input/touchscreen/gt1x/gt1x.c @@ -656,6 +656,18 @@ static int gt1x_ts_remove(struct i2c_client *client) } #if defined(CONFIG_FB) +#include + +static void gt1x_resume_async(void *data, async_cookie_t cookie) +{ + gt1x_resume(); +} + +static void gt1x_suspend_async(void *data, async_cookie_t cookie) +{ + gt1x_suspend(); +} + /* frame buffer notifier block control the suspend/resume procedure */ static struct notifier_block gt1x_fb_notifier; static int tp_status; @@ -686,7 +698,7 @@ static int gtp_fb_notifier_callback(struct notifier_block *noti, unsigned long e if (*blank == FB_BLANK_UNBLANK) { tp_status = *blank; GTP_DEBUG("Resume by fb notifier."); - gt1x_resume(); + async_schedule(gt1x_resume_async, NULL); } } #endif @@ -697,7 +709,7 @@ static int gtp_fb_notifier_callback(struct notifier_block *noti, unsigned long e if (*blank == FB_BLANK_POWERDOWN) { tp_status = *blank; GTP_DEBUG("Suspend by fb notifier."); - gt1x_suspend(); + async_schedule(gt1x_suspend_async, NULL); } }