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:
parent
56ce558094
commit
a783a062f8
3 changed files with 23 additions and 14 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue