From 578ac982ce1d66cb52b71ce3cf0c4d776609cd92 Mon Sep 17 00:00:00 2001 From: haojl2 Date: Tue, 28 Apr 2020 14:48:32 +0800 Subject: [PATCH] touchscreen_mmi: Add macro to get touch status When touch start enter suspend, touch_stop will set to 1. When touch resumed totally, pm_mode will be TS_MMI_PM_ACTIVE Add two macro to get touch state. Change-Id: I20ddb852f277ec6c0ffd38d33851416af4d2d06e Signed-off-by: haojl2 Reviewed-on: https://gerrit.mot.com/1543989 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- include/linux/touchscreen_mmi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/touchscreen_mmi.h b/include/linux/touchscreen_mmi.h index 6335c8ed45c2..09c88757a43d 100644 --- a/include/linux/touchscreen_mmi.h +++ b/include/linux/touchscreen_mmi.h @@ -232,7 +232,8 @@ do { \ ret = touch_cdev->mdata->get_##_method(DEV_TS, ##__VA_ARGS__); \ } \ } while (0) - +#define is_touch_stopped (atomic_read(&touch_cdev->touch_stopped) == 1) +#define is_touch_active (touch_cdev->pm_mode == TS_MMI_PM_ACTIVE) extern int ts_mmi_notifiers_register(struct ts_mmi_dev *touch_cdev); extern void ts_mmi_notifiers_unregister(struct ts_mmi_dev *touch_cdev);