From 883a4be12e5da170e1d85e6051d0e60b4ac5ca45 Mon Sep 17 00:00:00 2001 From: kalathik Date: Wed, 19 Aug 2020 19:49:21 +0530 Subject: [PATCH] misc: ets_fps: Replace wakeup_source API with macro Use common mmi_wake_lock macros instead directly using kernel API, which is version specific. Change-Id: I7d5d13f150e8f1474fab980109ee9baaa8baa647 Signed-off-by: Kanagarathina Kalathi Reviewed-on: https://gerrit.mot.com/1727590 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Vijayakumar Gn Reviewed-by: Konstantin Makariev Submit-Approved: Jira Key --- drivers/input/misc/ets_fps_mmi/ets_fps.c | 15 +++++---------- drivers/input/misc/ets_fps_mmi/ets_fps.h | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/input/misc/ets_fps_mmi/ets_fps.c b/drivers/input/misc/ets_fps_mmi/ets_fps.c index 4588541e4a86..c2aae9386d33 100644 --- a/drivers/input/misc/ets_fps_mmi/ets_fps.c +++ b/drivers/input/misc/ets_fps_mmi/ets_fps.c @@ -260,7 +260,7 @@ static irqreturn_t fp_eint_func(int irq, void *dev_id) #ifdef CONFIG_HAS_WAKELOCK wake_lock_timeout(&ets_wake_lock, msecs_to_jiffies(1500)); #else - __pm_wakeup_event(ets_wake_lock, 1500); + PM_WAKEUP_EVENT(ets_wake_lock, 1500); #endif #ifdef CONFIG_EGIS_DISPLAY_SPEED_UP if (is_auth_ready) @@ -283,7 +283,7 @@ static irqreturn_t fp_eint_func_ll(int irq, void *dev_id) #ifdef CONFIG_HAS_WAKELOCK wake_lock_timeout(&ets_wake_lock, msecs_to_jiffies(1500)); #else - __pm_wakeup_event(ets_wake_lock, 1500); + PM_WAKEUP_EVENT(ets_wake_lock, 1500); #endif return IRQ_RETVAL(IRQ_HANDLED); } @@ -977,7 +977,7 @@ static int etspi_remove(struct platform_device *pdev) #ifdef CONFIG_HAS_WAKELOCK wake_lock_destroy(&ets_wake_lock); #else - wakeup_source_unregister(ets_wake_lock); + PM_WAKEUP_UNREGISTER(ets_wake_lock); #endif del_timer_sync(&fps_ints.timer); etspi_create_device(etspi, false); @@ -1059,12 +1059,7 @@ static int etspi_probe(struct platform_device *pdev) #ifdef CONFIG_HAS_WAKELOCK wake_lock_init(&ets_wake_lock, WAKE_LOCK_SUSPEND, "ets_wake_lock"); #else -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 110) || \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 163) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0))) - ets_wake_lock = wakeup_source_register(dev, "ets_wake_lock"); -#else - ets_wake_lock = wakeup_source_register("ets_wake_lock"); -#endif + PM_WAKEUP_REGISTER(dev, ets_wake_lock, "ets_wake_lock"); if (!ets_wake_lock) { pr_err("%s : failed to allocate wakeup source\n", __func__); status = -ENOMEM; @@ -1095,7 +1090,7 @@ etspi_create_group_failed: #ifdef CONFIG_HAS_WAKELOCK wake_lock_destroy(&ets_wake_lock); #else - wakeup_source_unregister(ets_wake_lock); + PM_WAKEUP_UNREGISTER(ets_wake_lock); #endif #ifndef CONFIG_HAS_WAKELOCK etspi_register_wake_lock_failed: diff --git a/drivers/input/misc/ets_fps_mmi/ets_fps.h b/drivers/input/misc/ets_fps_mmi/ets_fps.h index 5b1cd1343104..3acc60848770 100644 --- a/drivers/input/misc/ets_fps_mmi/ets_fps.h +++ b/drivers/input/misc/ets_fps_mmi/ets_fps.h @@ -25,7 +25,7 @@ #include #include #include - +#include #ifdef FP_SPI_DEBUG #define DEBUG_PRINT(fmt, args...) pr_err(fmt, ## args)