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 <kalath(CR)@motorola.com>
Reviewed-on: https://gerrit.mot.com/1727590
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Vijayakumar Gn <vijaygn@motorola.com>
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
kalathik 2020-08-19 19:49:21 +05:30 • committed by Kanagarathina Kalathi
commit 883a4be12e
2 changed files with 6 additions and 11 deletions

View file

@ -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:

View file

@ -25,7 +25,7 @@
#include <linux/module.h>
#include <linux/spi/spi.h>
#include <linux/version.h>
#include <linux/mmi_wake_lock.h>
#ifdef FP_SPI_DEBUG
#define DEBUG_PRINT(fmt, args...) pr_err(fmt, ## args)