From 621b2b8500e1439b37f05533fa58739960299e24 Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Sun, 8 Dec 2019 00:28:48 -0800 Subject: board: Set min/max frequency attributes On some boards, min_/max_frequency attributes were not set, esp. for kx022 acceleometers. BUG=b:145799480 BRANCH=octopus,coral TEST=compile Change-Id: I6d32926541505f02f183539ca3ad9f70c1ae7a6b Signed-off-by: Gwendal Grignou Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1957374 Reviewed-by: Justin TerAvest Tested-by: Justin TerAvest (cherry picked from commit 6f96b488deffa19f7fc0075ed586410c32f3a379) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3193836 Tested-by: Rong Chang Auto-Submit: Rong Chang Commit-Queue: Rong Chang --- board/ampton/board.c | 2 ++ board/bloog/board.c | 2 ++ board/bobba/board.c | 2 ++ board/coral/board.c | 6 ++++++ board/dood/board.c | 2 ++ board/garg/board.c | 2 ++ board/meep/board.c | 2 ++ board/nucleo-f411re/board.c | 6 ++++-- board/yorp/board.c | 2 ++ 9 files changed, 24 insertions(+), 2 deletions(-) diff --git a/board/ampton/board.c b/board/ampton/board.c index 0025ae2567..588a1d5e58 100644 --- a/board/ampton/board.c +++ b/board/ampton/board.c @@ -191,6 +191,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, .rot_standard_ref = &lid_standard_ref, .default_range = 4, /* g */ + .min_frequency = KX022_ACCEL_MIN_FREQ, + .max_frequency = KX022_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { diff --git a/board/bloog/board.c b/board/bloog/board.c index 42049d0ef7..a17db4288c 100644 --- a/board/bloog/board.c +++ b/board/bloog/board.c @@ -141,6 +141,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, .rot_standard_ref = &lid_standrd_ref, .default_range = 2, /* g */ + .min_frequency = KX022_ACCEL_MIN_FREQ, + .max_frequency = KX022_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { diff --git a/board/bobba/board.c b/board/bobba/board.c index 61503cce4d..9bbedbcb07 100644 --- a/board/bobba/board.c +++ b/board/bobba/board.c @@ -171,6 +171,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, .rot_standard_ref = NULL, /* Identity matrix. */ .default_range = 4, /* g */ + .min_frequency = KX022_ACCEL_MIN_FREQ, + .max_frequency = KX022_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { diff --git a/board/coral/board.c b/board/coral/board.c index 91df786a1a..5e359c4051 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -726,6 +726,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, .rot_standard_ref = NULL, /* Identity matrix. */ .default_range = 2, /* g, enough for laptop. */ + .min_frequency = KX022_ACCEL_MIN_FREQ, + .max_frequency = KX022_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -751,6 +753,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, enough for laptop. */ + .min_frequency = BMI160_ACCEL_MIN_FREQ, + .max_frequency = BMI160_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -778,6 +782,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = &base_standard_ref, + .min_frequency = BMI160_GYRO_MIN_FREQ, + .max_frequency = BMI160_GYRO_MAX_FREQ, }, }; unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/dood/board.c b/board/dood/board.c index b246b83e1d..5c64fc60b5 100644 --- a/board/dood/board.c +++ b/board/dood/board.c @@ -154,6 +154,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, .rot_standard_ref = NULL, /* Identity matrix. */ .default_range = 4, /* g */ + .min_frequency = KX022_ACCEL_MIN_FREQ, + .max_frequency = KX022_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { diff --git a/board/garg/board.c b/board/garg/board.c index 8da97ef1c8..66c065700d 100644 --- a/board/garg/board.c +++ b/board/garg/board.c @@ -149,6 +149,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, .rot_standard_ref = NULL, /* Identity matrix. */ .default_range = 4, /* g */ + .min_frequency = KX022_ACCEL_MIN_FREQ, + .max_frequency = KX022_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { diff --git a/board/meep/board.c b/board/meep/board.c index 200909dca0..6029a77ab7 100644 --- a/board/meep/board.c +++ b/board/meep/board.c @@ -141,6 +141,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, .rot_standard_ref = &lid_standrd_ref, .default_range = 2, /* g */ + .min_frequency = KX022_ACCEL_MIN_FREQ, + .max_frequency = KX022_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { diff --git a/board/nucleo-f411re/board.c b/board/nucleo-f411re/board.c index adaed9e3de..d5a4a67a40 100644 --- a/board/nucleo-f411re/board.c +++ b/board/nucleo-f411re/board.c @@ -76,8 +76,9 @@ struct motion_sensor_t motion_sensors[] = { .drv_data = &g_bmi160_data, .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, - .rot_standard_ref = NULL, .default_range = 2, /* g, enough for laptop. */ + .min_frequency = BMI160_ACCEL_MIN_FREQ, + .max_frequency = BMI160_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { @@ -104,7 +105,8 @@ struct motion_sensor_t motion_sensors[] = { .port = I2C_PORT_ACCEL, .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ - .rot_standard_ref = NULL, + .min_frequency = BMI160_GYRO_MIN_FREQ, + .max_frequency = BMI160_GYRO_MAX_FREQ, }, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); diff --git a/board/yorp/board.c b/board/yorp/board.c index 89dee7fb41..fefebe3f07 100644 --- a/board/yorp/board.c +++ b/board/yorp/board.c @@ -122,6 +122,8 @@ struct motion_sensor_t motion_sensors[] = { .i2c_spi_addr_flags = KX022_ADDR1_FLAGS, .rot_standard_ref = NULL, /* Identity matrix. */ .default_range = 4, /* g */ + .min_frequency = KX022_ACCEL_MIN_FREQ, + .max_frequency = KX022_ACCEL_MAX_FREQ, .config = { /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { -- cgit v1.2.1