summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2020-12-02 20:22:59 -0800
committerCommit Bot <commit-bot@chromium.org>2020-12-08 18:14:51 +0000
commitb46ecc1d668dcda230ba69ca6193f1f44d5d6740 (patch)
treef55acdd7c4f69e93efd5bdc9e6d0359f9a41190e
parent62aa03af1d35c540c09e70785ffb1c9d0d3f5dcc (diff)
downloadchrome-ec-b46ecc1d668dcda230ba69ca6193f1f44d5d6740.tar.gz
driver: tcs3400: Report ODR for RGB sensor
To be able to send data to the host, the oversampling ratio must be non-zero. It implies: - the host send a set frequency request for the RGB sensor - the EC use the frequency from the clear sensor to calculate the RGB sensor oversampling ratio BUG=b:172343923 BRANCH=kukui,hatch,volteer TEST=On Volteer, in calibration mode, check we get samples from the RGB sensor. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I70eb62287cae983800cdadaee4cfe00b2f22b734 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570825 Reviewed-by: Nick Vaccaro <nvaccaro@google.com> (cherry picked from commit 4761e94ef6690c47a25351d024705197674720bd) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2579707
-rw-r--r--driver/als_tcs3400.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/driver/als_tcs3400.c b/driver/als_tcs3400.c
index 80bf837ad7..43be21ba85 100644
--- a/driver/als_tcs3400.c
+++ b/driver/als_tcs3400.c
@@ -571,11 +571,6 @@ static int tcs3400_rgb_set_offset(const struct motion_sensor_t *s,
return EC_SUCCESS;
}
-static int tcs3400_rgb_get_data_rate(const struct motion_sensor_t *s)
-{
- return 0;
-}
-
static int tcs3400_rgb_set_data_rate(const struct motion_sensor_t *s,
int rate,
int rnd)
@@ -649,6 +644,11 @@ static int tcs3400_get_data_rate(const struct motion_sensor_t *s)
return TCS3400_DRV_DATA(s)->rate;
}
+static int tcs3400_rgb_get_data_rate(const struct motion_sensor_t *s)
+{
+ return tcs3400_get_data_rate(s - 1);
+}
+
static int tcs3400_set_data_rate(const struct motion_sensor_t *s,
int rate,
int rnd)