summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Bhanagay <amitbhanagay@google.com>2023-05-05 03:57:26 +0000
committerAndrew Evans <andrewevans@google.com>2023-05-09 21:52:02 +0000
commit5ac2049aa768726fedaa90ba00244b3cb05f2e40 (patch)
treea81b770f8501046793e23748ccf3fa4db195ed5a
parentfadb4e03772b23137f339bfeba8987c1a25ef042 (diff)
downloadrotary-encoders-android-msm-eos-5.15-tm-wear-kr3-dr-eos.tar.gz
pat9126: Lower sampling frequency in sleep modeandroid-wear-13.0.0_r0.3android-msm-eos-5.15-tm-wear-kr3-dr-eos
Given the high sensitivity of the RSB, set sampling frequency in sleep mode to 1024ms thereby delaying the occurance of the wake IRQ. Bug: 278747973 Change-Id: I95f21d6b941a37cb174067b659f343e77b4d64b1 Signed-off-by: Amit Bhanagay <amitbhanagay@google.com>
-rw-r--r--ots_pat9126/pat9126.c7
-rw-r--r--ots_pat9126/pat9126.h1
2 files changed, 4 insertions, 4 deletions
diff --git a/ots_pat9126/pat9126.c b/ots_pat9126/pat9126.c
index 0fff993..2ded0fb 100644
--- a/ots_pat9126/pat9126.c
+++ b/ots_pat9126/pat9126.c
@@ -363,13 +363,12 @@ int pat9126_disable_mot_write_protected(struct i2c_client *client) {
int result;
pat9126_write_verified(client, PIXART_PAT9126_WRITE_PROTECT_REG,
- PIXART_PAT9126_DISABLE_WRITE_PROTECT);
+ PIXART_PAT9126_DISABLE_WRITE_PROTECT);
- result = pat9126_disable_mot(client,
- PIXART_PAT9126_SLEEP_MODE_DETECT_FREQ_DEFAULT);
+ result = pat9126_disable_mot(client, PIXART_PAT9126_SLEEP_MODE_FREQ_1024MS);
pat9126_write_verified(client, PIXART_PAT9126_WRITE_PROTECT_REG,
- PIXART_PAT9126_ENABLE_WRITE_PROTECT);
+ PIXART_PAT9126_ENABLE_WRITE_PROTECT);
if (result) {
pr_err("[PAT9126] %s: failed to disable sensor\n", __func__);
diff --git a/ots_pat9126/pat9126.h b/ots_pat9126/pat9126.h
index 1b6b7d8..386d3ea 100644
--- a/ots_pat9126/pat9126.h
+++ b/ots_pat9126/pat9126.h
@@ -72,6 +72,7 @@
#define PIXART_PAT9126_SLEEP2_MODE_DIS 0xB0
#define PIXART_PAT9126_FORCE_ENTER_SLEEP2_MODE 0xBC
#define PIXART_PAT9126_SLEEP_MODE_DETECT_FREQ_DEFAULT 0x10
+#define PIXART_PAT9126_SLEEP_MODE_FREQ_1024MS 0xF0
#define PIXART_PAT9126_SLEEP_MODE_DETECT_FREQ 0xF0
#define PIXART_PAT9126_SELECT_BANK_VAL1 0x00
#define PIXART_PAT9126_SELECT_BANK_VAL2 0x01