summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Granata <egranata@chromium.org>2019-06-06 10:45:38 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-19 17:04:12 +0000
commit2fd0e5728a1665f582459918931a20de5758d7c7 (patch)
treed41b084a4e374915fa2ec459a2e7660b3c1fe1cb
parent7481d40cfcec3247a9bbd5a9b8eaa61d99b1a30b (diff)
downloadchrome-ec-2fd0e5728a1665f582459918931a20de5758d7c7.tar.gz
driver: set Kionix accel min frequency to 12.5Hz
The EC is running at 10Hz itself, so it won't be able to properly handle frequencies below that threshold, and data will end up being sent to the kernel at 10Hz. This is a source of CTS issues on some devices, as Android expects to be able to program the sensor to send data at 1Hz given the sensor's configuration parameters. Fix the issue by picking the closest frequency above 10Hz that the accelerometer supports, i.e. 12.5Hz Conflicts: MOTION_MAX_SENSOR_FREQUENCY not defined in the branch BUG=b:134422740 BRANCH=oak TEST=run CtsSensorTestCases, observe it pass Change-Id: I56772009817e3cbd452e96637c0a78f54f3854c7 Signed-off-by: Enrico Granata <egranata@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1647363 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1667524 Reviewed-by: Allan Sword <asword@google.com> Commit-Queue: Allan Sword <asword@google.com>
-rw-r--r--driver/accel_kx022.h2
-rw-r--r--driver/accel_kxcj9.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/driver/accel_kx022.h b/driver/accel_kx022.h
index ec043b40ba..9ea5af674b 100644
--- a/driver/accel_kx022.h
+++ b/driver/accel_kx022.h
@@ -124,7 +124,7 @@
#define KX022_INC2_XNWUE (1 << 5)
/* Min and Max sampling frequency in mHz */
-#define KX022_ACCEL_MIN_FREQ 781
+#define KX022_ACCEL_MIN_FREQ 12500
#define KX022_ACCEL_MAX_FREQ 1600000
#endif /* __CROS_EC_ACCEL_KX022_H */
diff --git a/driver/accel_kxcj9.h b/driver/accel_kxcj9.h
index b3702ea541..72778e7e53 100644
--- a/driver/accel_kxcj9.h
+++ b/driver/accel_kxcj9.h
@@ -104,4 +104,8 @@
#define KXCJ9_OSA_1600_HZ 7
#define KXCJ9_OSA_FIELD 0xf
+/* Min and Max sampling frequency in mHz */
+#define KXCJ9_ACCEL_MIN_FREQ 12500
+#define KXCJ9_ACCEL_MAX_FREQ 1600000
+
#endif /* __CROS_EC_ACCEL_KXCJ9_H */