drivers/sensor: lis2dw12: Remove odr values from Kconfig
Remove all odr values from Kconfig and always init it
at 12.5Hz. It is responsibility of application to set
the rate to a different value using SENSOR_ATTR_SAMPLING_FREQUENCY.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
diff --git a/drivers/sensor/lis2dw12/Kconfig b/drivers/sensor/lis2dw12/Kconfig
index bc2275a..70de8a0 100644
--- a/drivers/sensor/lis2dw12/Kconfig
+++ b/drivers/sensor/lis2dw12/Kconfig
@@ -59,40 +59,4 @@
endif # LIS2DW12_TRIGGER
-choice
- prompt "Accelerometer sampling frequency (ODR)"
- default LIS2DW12_ODR_RUNTIME
-
-config LIS2DW12_ODR_RUNTIME
- bool "Set at runtime (Default 100 Hz)"
-
-config LIS2DW12_ODR_1_6
- bool "1.6 Hz"
-
-config LIS2DW12_ODR_12_5
- bool "12.5 Hz"
-
-config LIS2DW12_ODR_25
- bool "25 Hz"
-
-config LIS2DW12_ODR_50
- bool "50 Hz"
-
-config LIS2DW12_ODR_100
- bool "100 Hz"
-
-config LIS2DW12_ODR_200
- bool "200 Hz"
-
-config LIS2DW12_ODR_400
- bool "400 Hz"
-
-config LIS2DW12_ODR_800
- bool "800 Hz"
-
-config LIS2DW12_ODR_1600
- bool "1600 Hz"
-
-endchoice
-
endif # LIS2DW12
diff --git a/drivers/sensor/lis2dw12/lis2dw12.c b/drivers/sensor/lis2dw12/lis2dw12.c
index 076de7f..36d6a12 100644
--- a/drivers/sensor/lis2dw12/lis2dw12.c
+++ b/drivers/sensor/lis2dw12/lis2dw12.c
@@ -292,8 +292,9 @@
return -EIO;
}
- /* set default odr and full scale for acc */
- if (lis2dw12_data_rate_set(lis2dw12->ctx, LIS2DW12_DEFAULT_ODR) < 0) {
+ /* set default odr to 12.5Hz acc */
+ if (lis2dw12_set_odr(dev, 12) < 0) {
+ LOG_ERR("odr init error (12.5 Hz)");
return -EIO;
}
diff --git a/drivers/sensor/lis2dw12/lis2dw12.h b/drivers/sensor/lis2dw12/lis2dw12.h
index 7bad286..06ca2d5 100644
--- a/drivers/sensor/lis2dw12/lis2dw12.h
+++ b/drivers/sensor/lis2dw12/lis2dw12.h
@@ -17,27 +17,6 @@
#include <drivers/sensor.h>
#include "lis2dw12_reg.h"
-#if defined(CONFIG_LIS2DW12_ODR_1_6)
- #define LIS2DW12_DEFAULT_ODR LIS2DW12_XL_ODR_1Hz6_LP_ONLY
-#elif defined(CONFIG_LIS2DW12_ODR_12_5)
- #define LIS2DW12_DEFAULT_ODR LIS2DW12_XL_ODR_12Hz5
-#elif defined(CONFIG_LIS2DW12_ODR_25)
- #define LIS2DW12_DEFAULT_ODR LIS2DW12_XL_ODR_25Hz
-#elif defined(CONFIG_LIS2DW12_ODR_50)
- #define LIS2DW12_DEFAULT_ODR LIS2DW12_XL_ODR_50Hz
-#elif defined(CONFIG_LIS2DW12_ODR_100) || \
- defined(CONFIG_LIS2DW12_ODR_RUNTIME)
- #define LIS2DW12_DEFAULT_ODR LIS2DW12_XL_ODR_100Hz
-#elif defined(CONFIG_LIS2DW12_ODR_200)
- #define LIS2DW12_DEFAULT_ODR LIS2DW12_XL_ODR_200Hz
-#elif defined(CONFIG_LIS2DW12_ODR_400)
- #define LIS2DW12_DEFAULT_ODR LIS2DW12_XL_ODR_400Hz
-#elif defined(CONFIG_LIS2DW12_ODR_800)
- #define LIS2DW12_DEFAULT_ODR LIS2DW12_XL_ODR_800Hz
-#elif defined(CONFIG_LIS2DW12_ODR_1600)
- #define LIS2DW12_DEFAULT_ODR LIS2DW12_XL_ODR_1k6Hz
-#endif
-
/* Return ODR reg value based on data rate set */
#define LIS2DW12_ODR_TO_REG(_odr) \
((_odr <= 1) ? LIS2DW12_XL_ODR_1Hz6_LP_ONLY : \