drivers/sensor: lis2dw12: Move power Kconfig property into dts

Move lis2dw12 power-mode option from Kconfigs to Device Tree.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
Armando Visconti 2021-05-31 16:42:40 +02:00 committed by Anas Nashif
commit a783a062f8
3 changed files with 23 additions and 14 deletions

View file

@ -288,7 +288,8 @@ static int lis2dw12_init(const struct device *dev)
}
/* set power mode */
if (lis2dw12_set_power_mode(lis2dw12, CONFIG_LIS2DW12_POWER_MODE)) {
LOG_DBG("power-mode is %d", cfg->pm);
if (lis2dw12_set_power_mode(lis2dw12, cfg->pm)) {
return -EIO;
}
@ -318,7 +319,7 @@ static int lis2dw12_init(const struct device *dev)
const struct lis2dw12_device_config lis2dw12_cfg = {
.bus_name = DT_INST_BUS_LABEL(0),
.pm = CONFIG_LIS2DW12_POWER_MODE,
.pm = DT_INST_PROP(0, power_mode),
#ifdef CONFIG_LIS2DW12_TRIGGER
.gpio_int = GPIO_DT_SPEC_INST_GET_OR(0, irq_gpios, {0}),
.int_pin = DT_INST_PROP(0, int_pin),