summaryrefslogtreecommitdiff
path: root/board/phaser/board.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2018-11-30 17:06:39 -0800
committerJustin TerAvest <teravest@chromium.org>2019-02-08 21:38:48 +0000
commit30dd007291e625fe42897d2f2f2f5bd3d2569900 (patch)
treee0f8731d67dd572090eaf5a46255a1d976dae6e0 /board/phaser/board.c
parent6776b585f17b1112b80086f8623eeb37d303747f (diff)
downloadchrome-ec-30dd007291e625fe42897d2f2f2f5bd3d2569900.tar.gz
driver: lsm6dsm: Integrate LIS2MDL behind LSM6DSM
- Cros set_rate and normalize between LIS2MDL and LSM6DSM - Remove unused sensor hub function. - Remove parent field, use macro instead (magnetometer is just after the gyroscope). BUG=b:110143516,b:115587004 BRANCH=none TEST=On meep, check the magnetometer is returning data with shell/python script. Check calibration quick in. Check with AIDA64, compass and sensor app the magnetometer is seen. Change-Id: I2efef99eda095e33b6a0555b1cbc4ac8fdbfab5d Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1361992 Reviewed-by: Justin TerAvest <teravest@chromium.org> Trybot-Ready: Justin TerAvest <teravest@chromium.org> Tested-by: Justin TerAvest <teravest@chromium.org>
Diffstat (limited to 'board/phaser/board.c')
-rw-r--r--board/phaser/board.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/board/phaser/board.c b/board/phaser/board.c
index 671d4705f6..3ced43da7e 100644
--- a/board/phaser/board.c
+++ b/board/phaser/board.c
@@ -106,8 +106,7 @@ const mat33_fp_t standard_rot_ref = {
/* sensor private data */
static struct stprivate_data g_lis2dh_data;
-static struct lsm6dsm_data lsm6dsm_g_data;
-static struct lsm6dsm_data lsm6dsm_a_data;
+static struct lsm6dsm_data lsm6dsm_data;
/* Drivers */
struct motion_sensor_t motion_sensors[] = {
@@ -147,7 +146,8 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_BASE,
.drv = &lsm6dsm_drv,
.mutex = &g_base_mutex,
- .drv_data = &lsm6dsm_a_data,
+ .drv_data = LSM6DSM_ST_DATA(lsm6dsm_data,
+ MOTIONSENSE_TYPE_ACCEL),
.port = I2C_PORT_SENSOR,
.addr = LSM6DSM_ADDR0,
.rot_standard_ref = &standard_rot_ref,
@@ -176,7 +176,8 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_BASE,
.drv = &lsm6dsm_drv,
.mutex = &g_base_mutex,
- .drv_data = &lsm6dsm_g_data,
+ .drv_data = LSM6DSM_ST_DATA(lsm6dsm_data,
+ MOTIONSENSE_TYPE_GYRO),
.port = I2C_PORT_SENSOR,
.addr = LSM6DSM_ADDR0,
.default_range = 1000 | ROUND_UP_FLAG, /* dps */