drivers/sensor: lsm6dso: move int-pin in DTS binding

Take the int-pin information (i.e. what pin between INT1
and INT2 the drdy is attached to) directly from DT.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
This commit is contained in:
Armando Visconti 2021-03-20 16:41:27 +01:00 committed by Carles Cufí
commit 36eceba7e4
9 changed files with 18 additions and 23 deletions

View file

@ -53,20 +53,6 @@ config LSM6DSO_THREAD_STACK_SIZE
help
Stack size of thread used by the driver to handle interrupts.
choice LSM6DSO_INT_PIN
prompt "Sensor INT pin number"
default LSM6DSO_INT_PIN_1
help
The number of LSM6DSO int pin used to generate interrupt to cpu.
Supported values are int1 or int2
config LSM6DSO_INT_PIN_1
bool "int1"
config LSM6DSO_INT_PIN_2
bool "int2"
endchoice
endif # LSM6DSO_TRIGGER
config LSM6DSO_ENABLE_TEMP

View file

@ -782,12 +782,7 @@ static const struct lsm6dso_config lsm6dso_config = {
.int_gpio_port = DT_INST_GPIO_LABEL(0, irq_gpios),
.int_gpio_pin = DT_INST_GPIO_PIN(0, irq_gpios),
.int_gpio_flags = DT_INST_GPIO_FLAGS(0, irq_gpios),
#if defined(CONFIG_LSM6DSO_INT_PIN_1)
.int_pin = 1,
#elif defined(CONFIG_LSM6DSO_INT_PIN_2)
.int_pin = 2,
#endif /* CONFIG_LSM6DSO_INT_PIN */
.int_pin = DT_INST_PROP(0, int_pin),
#endif /* CONFIG_LSM6DSO_TRIGGER */
};