From 36be8862f9cbb3e3e439337f75e908df6bdd3c47 Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Sat, 16 Mar 2024 14:37:45 +0800 Subject: [PATCH] input: touchscreen: gt1x: Don't add pm ops when enable early suspend Fix underflow of vcc3v3_lcd0_n regulator enable count. Signed-off-by: Finley Xiao Change-Id: Ie5383504b29c3efa8f98df76d32feb5721ee22c2 --- drivers/input/touchscreen/gt1x/gt1x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/gt1x/gt1x.c b/drivers/input/touchscreen/gt1x/gt1x.c index a1e829836d5f..81b5046aa6c2 100644 --- a/drivers/input/touchscreen/gt1x/gt1x.c +++ b/drivers/input/touchscreen/gt1x/gt1x.c @@ -730,9 +730,7 @@ static struct early_suspend gt1x_early_suspend = { .suspend = gt1x_ts_early_suspend, .resume = gt1x_ts_late_resume, }; -#endif - -#ifdef CONFIG_PM +#elif defined(CONFIG_PM) /** * gt1x_ts_suspend - i2c suspend callback function. * @dev: i2c device. @@ -805,7 +803,7 @@ static struct i2c_driver gt1x_ts_driver = { #ifdef GTP_CONFIG_OF .of_match_table = gt1x_match_table, #endif -#if !defined(CONFIG_FB) && defined(CONFIG_PM) +#if !defined(CONFIG_FB) && !defined(CONFIG_HAS_EARLYSUSPEND) && defined(CONFIG_PM) .pm = >1x_ts_pm_ops, #endif .probe_type = PROBE_PREFER_ASYNCHRONOUS,