summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/caroline/board.c6
-rw-r--r--driver/als_bh1730.h7
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 */
-