diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2018-11-30 16:23:40 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-02-08 06:03:50 -0800 |
commit | ab7fad125320bb719c7bfae952ffa9b8589113ee (patch) | |
tree | 97bd429eaf262bb8ff72ef36174ced1692a9cccf /include | |
parent | 0e23368429f931b8ead7abc1ac63aa0f96f51565 (diff) | |
download | chrome-ec-ab7fad125320bb719c7bfae952ffa9b8589113ee.tar.gz |
config: Add magnetometer definitions
Add all possible supported or soon-to-be supported configuration of
magnetometer behind accelerometers.
Use a more generic variable to indicate the i2c address of the secondary
device.
BUG=b:110143516,b:115587004
BRANCH=none
TEST=compile
Change-Id: Ic00c413f2ec5fa0e6bf1c98861daa02f00769a65
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1361989
Commit-Ready: Karthikeyan Ramasubramanian <kramasub@chromium.org>
Tested-by: Justin TerAvest <teravest@chromium.org>
Reviewed-by: Karthikeyan Ramasubramanian <kramasub@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 72 |
1 files changed, 63 insertions, 9 deletions
diff --git a/include/config.h b/include/config.h index f2cb596069..ec02b51c68 100644 --- a/include/config.h +++ b/include/config.h @@ -75,18 +75,46 @@ #undef CONFIG_ACCEL_LIS2DH #undef CONFIG_ACCEL_LIS2DE #undef CONFIG_ACCEL_LIS2D_COMMON -#undef CONFIG_ACCELGYRO_LSM6DS0 #undef CONFIG_ACCELGYRO_BMI160 +#undef CONFIG_ACCELGYRO_LSM6DS0 #undef CONFIG_ACCELGYRO_LSM6DSM -#undef CONFIG_MAG_LIS2MDL +/* Add sensorhub function for LSM6DSM, required if 2nd device attached. */ #undef CONFIG_SENSORHUB_LSM6DSM +/* Specify type of Magnetometer attached. */ +#undef CONFIG_MAG_LIS2MDL +#undef CONFIG_MAG_BMM150 + +/* Presence of a Bosh Sensortec BMM150 magnetometer behind a BMI160. */ +#undef CONFIG_MAG_BMI160_BMM150 + +/* Presence of a Bosh Sensortec BMM150 magnetometer behind a LSM6DSM. */ +#undef CONFIG_MAG_LSM6DSM_BMM150 + +/* Presence of a ST LIS2MDL magnetometer behind a BMI160. */ +#undef CONFIG_MAG_BMI160_LIS2MDL + +/* Presence of a ST LIS2MDL magnetometer behind a LSM6DSM. */ +#undef CONFIG_MAG_LSM6DSM_LIS2MDL + +/* Specify barometer attached */ +#undef CONFIG_BARO_BMP280 + +/* When set, it indicates a secondary sensor is attached behind a BMI160. */ +#undef CONFIG_BMI160_SEC_I2C + +/* When set, it indicates a secondary sensor is attached behind a LSM6DSM/L. */ +#undef CONFIG_LSM6DSM_SEC_I2C + /* Support for BMI160 hardware orientation sensor */ #undef CONFIG_BMI160_ORIENTATION_SENSOR /* Support for KIONIX KX022 hardware orientation sensor */ #undef CONFIG_KX022_ORIENTATION_SENSOR +/* Define the i2c address of the sensor behind the main sensor, if present. */ +#undef CONFIG_ACCELGYRO_SEC_ADDR + /* * Define if either CONFIG_BMI160_ORIENTATION_SUPPORT or * CONFIG_KX022_ORIENTATION_SUPPORT is set. @@ -96,9 +124,6 @@ /* Support the orientation gesture */ #undef CONFIG_GESTURE_ORIENTATION -/* Specify barometer attached */ -#undef CONFIG_BARO_BMP280 - /* * Use the old standard reference frame for accelerometers. The old * reference frame is: @@ -2440,9 +2465,6 @@ /* Include code to do online compass calibration */ #undef CONFIG_MAG_CALIBRATE -/* Presence of a Bosh Sensortec BMM150 magnetometer behind a BMI160. */ -#undef CONFIG_MAG_BMI160_BMM150 - /* Microchip LPC enable debug messages */ #undef CONFIG_MCHP_DEBUG_LPC @@ -4208,10 +4230,42 @@ #endif /* Enable BMI160 secondary port if needed. */ -#ifdef CONFIG_MAG_BMI160_BMM150 +#if defined(CONFIG_MAG_BMI160_BMM150) || \ + defined(CONFIG_MAG_BMI160_LIS2MDL) #define CONFIG_BMI160_SEC_I2C #endif +/* Enable LSM2MDL secondary port if needed. */ +#if defined(CONFIG_MAG_LSM6DSM_BMM150) || \ + defined(CONFIG_MAG_LSM6DSM_LIS2MDL) +#define CONFIG_LSM6DSM_SEC_I2C +#endif + +/* Load LIS2MDL driver if needed */ +#if defined(CONFIG_MAG_BMI160_LIS2MDL) || \ + defined(CONFIG_MAG_LSM6DSM_LIS2MDL) +#define CONFIG_MAG_LIS2MDL +#ifndef CONFIG_ACCELGYRO_SEC_ADDR +#error "The i2c address of the magnetometer is not set." +#endif +#endif + +/* Load BMM150 driver if needed */ +#if defined(CONFIG_MAG_BMI160_BMM150) || \ + defined(CONFIG_MAG_LSM6DSM_BMM150) +#define CONFIG_MAG_BMM150 +#ifndef CONFIG_ACCELGYRO_SEC_ADDR +#error "The i2c address of the magnetometer is not set." +#endif +#endif + +/* Verify sensorhub is enabled */ +#ifdef CONFIG_MAG_LSM6DSM_LIS2MDL +#ifndef CONFIG_SENSORHUB_LSM6DSM +#error "Enable SENSORHUB_LSM6DSM." +#endif +#endif + /* * TODO(crbug.com/888109): Makes sure RDP as PSTATE is only enabled where it * makes sense. |