From b959d792d4a080ec43f6ec7b8bcafa3223efc188 Mon Sep 17 00:00:00 2001 From: Tiago Ganselli Date: Fri, 22 Jan 2021 09:32:30 -0300 Subject: [PATCH] Fix deprecated function call on ilitek_0flash_mmi Qcom ported a patch to kernel 4.19 which removes the unused function wakeup_source_init. Fix ilitek_0flash_mmi module to use wakeup source macros instead. Change-Id: I737205699d192e357f96ff5a95f8fb06401547fd Signed-off-by: Tiago Ganselli Reviewed-on: https://gerrit.mot.com/1859417 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Rafael Ortolan Reviewed-by: Zhenxin Xi Submit-Approved: Jira Key --- drivers/input/touchscreen/ilitek_0flash_mmi/ilitek.h | 2 +- .../input/touchscreen/ilitek_0flash_mmi/ilitek_qcom.c | 10 +++++++++- .../input/touchscreen/ilitek_0flash_mmi/ilitek_touch.c | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek.h b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek.h index 8376aedb1b05..d800098d9f20 100644 --- a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek.h +++ b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek.h @@ -924,7 +924,7 @@ struct ilitek_ts_data { #ifdef CONFIG_HAS_WAKELOCK struct wake_lock gesture_wakelock; #else - struct wakeup_source gesture_wakelock; + struct wakeup_source *gesture_wakelock; #endif #endif diff --git a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_qcom.c b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_qcom.c index 418043e073b8..0983fdc52619 100644 --- a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_qcom.c +++ b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_qcom.c @@ -987,7 +987,11 @@ static int ilitek_plat_probe(void) #ifdef CONFIG_HAS_WAKELOCK wake_lock_init(&(ilits->gesture_wakelock), WAKE_LOCK_SUSPEND, "dt-wake-lock"); #else - wakeup_source_init(&(ilits->gesture_wakelock), "dt-wake-lock"); + PM_WAKEUP_REGISTER(ilits->dev, ilits->gesture_wakelock, "dt-wake-lock"); + if (!ilits->gesture_wakelock) { + ILI_ERR("ILITEK Driver failed to load. wakeup_source_init failed."); + return -ENOMEM; + } #endif if (!ili_sensor_init(ilits)) initialized_sensor = true; @@ -1016,6 +1020,10 @@ static int ilitek_tp_pm_resume(struct device *dev) static int ilitek_plat_remove(void) { ILI_INFO("remove plat dev\n"); +#ifndef CONFIG_HAS_WAKELOCK + if(ilits->gesture_wakelock) + PM_WAKEUP_UNREGISTER(ilits->gesture_wakelock); +#endif ili_dev_remove(); return 0; } diff --git a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_touch.c b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_touch.c index 515805c78c36..be725e4dcfd6 100644 --- a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_touch.c +++ b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_touch.c @@ -1159,7 +1159,7 @@ void ili_report_gesture_mode(u8 *buf, int len) #ifdef CONFIG_HAS_WAKELOCK wake_lock_timeout(&(ilits->gesture_wakelock), msecs_to_jiffies(5000)); #else - __pm_wakeup_event(&(ilits->gesture_wakelock), 5000); + PM_WAKEUP_EVENT(ilits->gesture_wakelock, 5000); #endif #else input_report_key(input, KEY_GESTURE_POWER, 1);