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);