himax_mmi: Fix wakelock compile issue

Wakelock is not supported by default.
If it is not supported, use wakeup_source instead.

Change-Id: Iae27c6fc6c8f3fd6c0129f0869ae734cec59c067
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1366919
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
haojl2 2019-06-01 15:31:01 +08:00 • committed by Jialei Hao
commit bb299fa0a5
2 changed files with 24 additions and 0 deletions

View file

@ -2024,7 +2024,11 @@ int himax_report_data(struct himax_ts_data *ts, int ts_path, int ts_status)
#endif
#ifdef HX_SMART_WAKEUP
} else if (ts_path == HX_REPORT_SMWP_EVENT) {
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_timeout(&ts->ts_SMWP_wake_lock, TS_WAKE_LOCK_TIMEOUT);
#else
__pm_wakeup_event(&ts->ts_SMWP_wake_lock, TS_WAKE_LOCK_TIMEOUT);
#endif
himax_wake_event_report();
#endif
} else {
@ -2684,7 +2688,11 @@ FW_force_upgrade:
#ifdef HX_SMART_WAKEUP
ts->SMWP_enable = 0;
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_init(&ts->ts_SMWP_wake_lock, WAKE_LOCK_SUSPEND, HIMAX_common_NAME);
#else
wakeup_source_init(&ts->ts_SMWP_wake_lock, HIMAX_common_NAME);
#endif
#endif
#ifdef HX_HIGH_SENSE
ts->HSEN_enable = 0;
@ -2750,7 +2758,11 @@ err_sysfs:
err_creat_proc_file_failed:
err_report_data_init_failed:
#ifdef HX_SMART_WAKEUP
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_destroy(&ts->ts_SMWP_wake_lock);
#else
wakeup_source_trash(&ts->ts_SMWP_wake_lock);
#endif
#endif
#ifdef CONFIG_FB
cancel_delayed_work_sync(&ts->work_att);
@ -2819,7 +2831,11 @@ void himax_chip_common_deinit(void)
}
#ifdef HX_SMART_WAKEUP
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_destroy(&ts->ts_SMWP_wake_lock);
#else
wakeup_source_trash(&ts->ts_SMWP_wake_lock);
#endif
#endif
#ifdef CONFIG_FB
if (fb_unregister_client(&ts->fb_notif))

View file

@ -34,7 +34,11 @@
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/buffer_head.h>
#ifdef CONFIG_HAS_WAKELOCK
#include <linux/wakelock.h>
#else
#include <linux/pm_wakeup.h>
#endif
#include <linux/seq_file.h>
#include <linux/proc_fs.h>
#include "himax_platform.h"
@ -357,7 +361,11 @@ struct himax_ts_data {
#ifdef HX_SMART_WAKEUP
uint8_t SMWP_enable;
uint8_t gesture_cust_en[26];
#ifdef CONFIG_HAS_WAKELOCK
struct wake_lock ts_SMWP_wake_lock;
#else
struct wakeup_source ts_SMWP_wake_lock;
#endif
#endif
#ifdef HX_EDGE_LIMIT