From e5320809ae393184f8ff3c120232f42fe714f616 Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Thu, 9 Jan 2020 10:19:59 -0800 Subject: driver: lis2mdl: Define LIS2MDL_CAL even when CONFIG_MAG_CALIBRATE is not mag_cal_t holds offset information for the sensor, even when online calibration is not defined. Allow driver to work with online calibration disabled (it could be set from the host). BUG=none BRANCH=none TEST=using nucleo-f072rb_iks01a2, check magnetometer is working with or without CONFIG_MAG_CALIBRATE enabled. Change-Id: I2e259f53c620c593b516a12d6dff47dfbadb26c8 Signed-off-by: Gwendal Grignou Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1993584 Reviewed-by: Yuval Peress --- driver/mag_lis2mdl.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'driver/mag_lis2mdl.h') diff --git a/driver/mag_lis2mdl.h b/driver/mag_lis2mdl.h index 6be0d70e54..fb50b9712a 100644 --- a/driver/mag_lis2mdl.h +++ b/driver/mag_lis2mdl.h @@ -71,11 +71,9 @@ struct lis2mdl_private_data { #ifndef CONFIG_LSM6DSM_SEC_I2C #define LIS2MDL_ST_DATA(g) (&((g).data)) -#ifdef CONFIG_MAG_CALIBRATE #define LIS2MDL_CAL(_s) \ (&(DOWNCAST(s->drv_data, struct lis2mdl_private_data, data)->cal)) #endif -#endif #define LIS2MDL_ODR_MIN_VAL 10000 -- cgit v1.2.1