drivers/sensor: lis2dw12: Move range Kconfig property into dts
Converts lis2dw12 range options (2g, 4g, 8g, 16g) from Kconfigs to Device Tree. Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
parent
a783a062f8
commit
344e06025d
4 changed files with 27 additions and 42 deletions
|
@ -47,17 +47,6 @@
|
|||
/* FS reg value from Full Scale */
|
||||
#define LIS2DW12_FS_TO_REG(_fs) (30 - __builtin_clz(_fs))
|
||||
|
||||
#if defined(CONFIG_LIS2DW12_ACCEL_RANGE_RUNTIME) || \
|
||||
defined(CONFIG_LIS2DW12_ACCEL_RANGE_2G)
|
||||
#define LIS2DW12_ACC_FS LIS2DW12_2g
|
||||
#elif defined(CONFIG_LIS2DW12_ACCEL_RANGE_4G)
|
||||
#define LIS2DW12_ACC_FS LIS2DW12_4g
|
||||
#elif defined(CONFIG_LIS2DW12_ACCEL_RANGE_8G)
|
||||
#define LIS2DW12_ACC_FS LIS2DW12_8g
|
||||
#elif defined(CONFIG_LIS2DW12_ACCEL_RANGE_16G)
|
||||
#define LIS2DW12_ACC_FS LIS2DW12_16g
|
||||
#endif
|
||||
|
||||
/* Acc Gain value in ug/LSB in High Perf mode */
|
||||
#define LIS2DW12_FS_2G_GAIN 244
|
||||
#define LIS2DW12_FS_4G_GAIN 488
|
||||
|
@ -82,6 +71,7 @@
|
|||
struct lis2dw12_device_config {
|
||||
const char *bus_name;
|
||||
lis2dw12_mode_t pm;
|
||||
uint8_t range;
|
||||
#ifdef CONFIG_LIS2DW12_TRIGGER
|
||||
struct gpio_dt_spec gpio_int;
|
||||
uint8_t int_pin;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue