summaryrefslogtreecommitdiff
path: root/touch_mf_mode.h
diff options
context:
space:
mode:
authorWendly Li <wendlyli@google.com>2022-03-01 19:40:37 +0000
committerWendly Li <wendlyli@google.com>2022-03-28 03:37:03 +0000
commit8e96b34084994ee6a085b7be916886ddcbe547b5 (patch)
tree4909adf10715b4c718a5ae6077349d3b24d07d8f /touch_mf_mode.h
parent9d66e88a3704ee82c67c617ec6e7c9cef2403dca (diff)
downloadgoodix_touch-8e96b34084994ee6a085b7be916886ddcbe547b5.tar.gz
Add motion filter mode
Bug: 214118990 Test: Check mf_mode works properly Change-Id: I4dca2a71a396e7cff1cd5b7cc4d728a15312b8a9 Signed-off-by: Wendly Li <wendlyli@google.com>
Diffstat (limited to 'touch_mf_mode.h')
-rw-r--r--touch_mf_mode.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/touch_mf_mode.h b/touch_mf_mode.h
new file mode 100644
index 0000000..ead3924
--- /dev/null
+++ b/touch_mf_mode.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Sysfs APIs for Google Pixel devices.
+ *
+ * Copyright 2022 Google LLC.
+ */
+
+#ifndef _TOUCH_MF_MODE_H_
+#define _TOUCH_MF_MODE_H_
+
+#include <linux/mutex.h>
+#include <linux/platform_device.h>
+#include <linux/time.h>
+
+enum touch_mf_state {
+ TOUCH_MF_STATE_UNFILTERED = 0,
+ TOUCH_MF_STATE_FILTERED,
+ TOUCH_MF_STATE_LOCKED,
+};
+
+enum touch_mf_mode {
+ TOUCH_MF_MODE_UNFILTERED = 0,
+ TOUCH_MF_MODE_DYNAMIC,
+ TOUCH_MF_MODE_FILTERED,
+ TOUCH_MF_MODE_AUTO_REPORT,
+};
+
+struct touch_mf {
+ struct platform_device *pdev;
+ enum touch_mf_mode mode;
+ enum touch_mf_state state;
+ struct mutex update_mutex;
+ ktime_t downtime;
+ int touches;
+
+ int (*set_continuously_report_enabled)(
+ struct device *dev, bool enabled);
+};
+
+extern int touch_mf_init(struct touch_mf *tmf);
+extern int touch_mf_set_mode(struct touch_mf *tmf, enum touch_mf_mode mode);
+extern int touch_mf_update_state(struct touch_mf *tmf, u8 touches);
+
+#endif