summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2020-04-27 10:51:04 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-04 18:11:58 +0000
commit21086c67e6549b89e902f55b59a91fa51c0ebaa3 (patch)
tree68ae34ead106d6da33a176a9e735c997ec5ddf1e
parent126fbe338f50f6ca40492ccab1590c1aae4dd6fa (diff)
downloadchrome-ec-21086c67e6549b89e902f55b59a91fa51c0ebaa3.tar.gz
common: sensors: add extra sensor attributes - fix merge
Fixes: b0911b436 ("common: sensors: add extra sensor attributes") Add changes to driver/als_opt3001.h as well. Use MAX_FIFO_EVENT_COUNT instead of SENSOR_MAX_FIFO_EVENT_COUNT. BRANCH=firmware-glados-7820.B BUG=chromium:615059 TEST=Check further patches for light apply cleanly. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I92b4a8cad593a4bcdd4dcfb0fa6e5c4feedb5494 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2168895 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--common/motion_sense.c5
-rw-r--r--driver/als_opt3001.h4
-rw-r--r--include/motion_sense.h4
3 files changed, 8 insertions, 5 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index eed5b4d188..95ee799bdf 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -978,12 +978,11 @@ static int host_cmd_motion_sense(struct host_cmd_handler_args *args)
/*
* Make sure reported max frequency for this sensor
* doesn't exceed the max sensor frequency the EC is
- * capable of supporting.
+ * capable of supporting
*/
out->info_3.max_frequency = MIN(sensor->max_frequency,
CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ);
- out->info_3.fifo_max_event_count =
- SENSOR_MAX_FIFO_EVENT_COUNT;
+ out->info_3.fifo_max_event_count = MAX_FIFO_EVENT_COUNT;
args->response_size = sizeof(out->info_3);
} else {
args->response_size = sizeof(out->info);
diff --git a/driver/als_opt3001.h b/driver/als_opt3001.h
index 9a64dbfa81..305fa97aff 100644
--- a/driver/als_opt3001.h
+++ b/driver/als_opt3001.h
@@ -36,6 +36,10 @@ enum opt3001_mode {
#define OPT3001_MANUFACTURER_ID 0x5449
#define OPT3001_DEVICE_ID 0x3001
+/* Min and Max sampling frequency in mHz */
+#define OPT3001_LIGHT_MIN_FREQ 1250
+#define OPT3001_LIGHT_MAX_FREQ 10000
+
#ifdef HAS_TASK_ALS
int opt3001_init(void);
int opt3001_read_lux(int *lux, int af);
diff --git a/include/motion_sense.h b/include/motion_sense.h
index 74e9b2c93a..b0dc136974 100644
--- a/include/motion_sense.h
+++ b/include/motion_sense.h
@@ -46,9 +46,9 @@ enum sensor_config {
#define BASE_ODR(_odr) ((_odr) & ~ROUND_UP_FLAG)
#ifdef CONFIG_ACCEL_FIFO
-#define SENSOR_MAX_FIFO_EVENT_COUNT CONFIG_ACCEL_FIFO
+#define MAX_FIFO_EVENT_COUNT CONFIG_ACCEL_FIFO
#else
-#define SENSOR_MAX_FIFO_EVENT_COUNT 0
+#define MAX_FIFO_EVENT_COUNT 0
#endif
struct motion_data_t {