diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2020-12-10 21:38:48 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-09 00:34:17 +0000 |
commit | 1d3c523e1345fcee45863557ab754ebbe06a625c (patch) | |
tree | 13f7f909f413766459d76a541ea73ead003e9ded | |
parent | 358216f3ff1a13f08037f7763a8e855ea4fb7d83 (diff) | |
download | chrome-ec-firmware-glados-7820.B.tar.gz |
kohaku: Set base light sensor information correctlyfirmware-glados-7820.B
BH1370 light sensor only support 10Hz frequency.
Set parameters properly. Sensor only used on kohaku.
BUG=b:172343923
BRANCH=hatch
TEST=Check on Kohaku the light parameters are correct.
Conflicts:
board/kohaku/board.c: Make change in caroline board.
Change-Id: Ibb9b2699e414cf80730d290aba981dcd4898f84f
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2586069
Reviewed-by: Scott Collyer <scollyer@chromium.org>
(cherry picked from commit e2882f20fa28810e735e1a8f0750674e7940eb2d)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200806
Reviewed-by: Stefan Reinauer <reinauer@google.com>
-rw-r--r-- | board/caroline/board.c | 6 | ||||
-rw-r--r-- | driver/als_bh1730.h | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/board/caroline/board.c b/board/caroline/board.c index 27f5989250..ccc3e7cf28 100644 --- a/board/caroline/board.c +++ b/board/caroline/board.c @@ -589,11 +589,11 @@ struct motion_sensor_t motion_sensors[] = { .addr = BH1730_I2C_ADDR, .rot_standard_ref = NULL, .default_range = 65535, - .min_frequency = 10, - .max_frequency = 10, + .min_frequency = BH1730_MIN_FREQ, + .max_frequency = BH1730_MAX_FREQ, .config = { [SENSOR_CONFIG_EC_S0] = { - .odr = 100000, + .odr = BH1730_10000_MHZ, .ec_rate = 0, }, }, diff --git a/driver/als_bh1730.h b/driver/als_bh1730.h index 3cd8757822..0847062afb 100644 --- a/driver/als_bh1730.h +++ b/driver/als_bh1730.h @@ -58,6 +58,12 @@ /* default Itime is about 10Hz */ #define BH1730_10000_MHZ (10*1000) +#define BH1730_MAX_FREQ BH1730_10000_MHZ +/* + * 10Hz is too fast for the AP: allow the AP query data less often, the EC will + * downsample. + */ +#define BH1730_MIN_FREQ (BH1730_MAX_FREQ / 100) /* * Use default lux calculation formula parameters if board specific @@ -88,4 +94,3 @@ struct bh1730_drv_data_t { extern const struct accelgyro_drv bh1730_drv; #endif /* __CROS_EC_ALS_BH1730_H */ - |