drivers/sensor: iis2dlpc: Move power Kconfig property into dts
Move iis2dlpc power-mode option from Kconfigs to Device Tree. Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
parent
e9b93f99a5
commit
34a677d05a
3 changed files with 15 additions and 14 deletions
|
@ -156,16 +156,4 @@ endif # IIS2DLPC_PULSE
|
|||
|
||||
endif # IIS2DLPC_TRIGGER
|
||||
|
||||
config IIS2DLPC_POWER_MODE
|
||||
int "Sensor Power Modes"
|
||||
range 0 4
|
||||
default 0
|
||||
help
|
||||
Specify the sensor power mode
|
||||
0: Low Power M1
|
||||
1: Low Power M2
|
||||
2: Low Power M3
|
||||
3: Low Power M4
|
||||
4: High Performance
|
||||
|
||||
endif # IIS2DLPC
|
||||
|
|
|
@ -287,7 +287,8 @@ static int iis2dlpc_init(const struct device *dev)
|
|||
}
|
||||
|
||||
/* set power mode */
|
||||
if (iis2dlpc_set_power_mode(iis2dlpc, CONFIG_IIS2DLPC_POWER_MODE)) {
|
||||
LOG_INF("power-mode is %d", cfg->pm);
|
||||
if (iis2dlpc_set_power_mode(iis2dlpc, cfg->pm)) {
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
@ -373,7 +374,7 @@ static int iis2dlpc_init(const struct device *dev)
|
|||
|
||||
const struct iis2dlpc_device_config iis2dlpc_cfg = {
|
||||
.bus_name = DT_INST_BUS_LABEL(0),
|
||||
.pm = CONFIG_IIS2DLPC_POWER_MODE,
|
||||
.pm = DT_INST_PROP(0, power_mode),
|
||||
.range = DT_INST_PROP(0, range),
|
||||
#ifdef CONFIG_IIS2DLPC_TRIGGER
|
||||
.int_gpio_port = DT_INST_GPIO_LABEL(0, drdy_gpios),
|
||||
|
|
|
@ -21,3 +21,15 @@ properties:
|
|||
- 8 # 8g (0.976 mg/LSB)
|
||||
- 4 # 4g (0.488 mg/LSB)
|
||||
- 2 # 2g (0.244 mg/LSB)
|
||||
|
||||
power-mode:
|
||||
type: int
|
||||
required: false
|
||||
default: 0
|
||||
description: Specify the sensor power mode. Default is power-up configuration.
|
||||
enum:
|
||||
- 0 # Low Power M1
|
||||
- 1 # Low Power M2
|
||||
- 2 # Low Power M3
|
||||
- 3 # Low Power M4
|
||||
- 4 # High Performance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue