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

@ -113,6 +113,7 @@
reg = <1>;
irq-gpios = <&gpioa 2 GPIO_ACTIVE_HIGH>;
label = "LSM6DSO";
int-pin = <1>;
};
iis3dhhc@2 {

View file

@ -45,5 +45,6 @@
reg = <0x6b>;
irq-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 */
label = "LSM6DSO";
int-pin = <2>;
};
};

View file

@ -18,5 +18,6 @@
reg = <0x6b>;
irq-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 */
label = "LSM6DSO";
int-pin = <2>;
};
};

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 */
};

View file

@ -10,3 +10,17 @@ properties:
This pin defaults to active high when produced by the sensor.
The property value should ensure the flags properly describe
the signal that is presented to the driver.
int-pin:
type: int
required: false
default: 1
enum:
- 1 # drdy is generated from INT1
- 2 # drdy is generated from INT2
description: Select DRDY pin number (1 or 2).
This number represents which of the two interrupt pins
(INT1 or INT2) the drdy line is attached to. This property is not
mandatory and if not present it defaults to 1 which is the
configuration at power-up.

View file

@ -16,7 +16,6 @@ CONFIG_LIS2DW12_TRIGGER_OWN_THREAD=y
CONFIG_LSM6DSO=y
CONFIG_LSM6DSO_TRIGGER_OWN_THREAD=y
CONFIG_LSM6DSO_ENABLE_TEMP=n
CONFIG_LSM6DSO_INT_PIN_1=y
CONFIG_STTS751=y
CONFIG_STTS751_TRIGGER_NONE=y
CONFIG_IIS3DHHC=y

View file

@ -7,7 +7,6 @@ CONFIG_LIS2DW12=y
CONFIG_LIS2DW12_TRIGGER_NONE=y
CONFIG_LSM6DSO=y
CONFIG_LSM6DSO_ENABLE_TEMP=n
CONFIG_LSM6DSO_INT_PIN_2=y
CONFIG_LSM6DSO_TRIGGER_OWN_THREAD=y
CONFIG_LSM6DSO_SENSORHUB=y
CONFIG_LSM6DSO_EXT_LIS2MDL=y

View file

@ -15,6 +15,5 @@ CONFIG_LIS2DW12=y
CONFIG_LIS2DW12_TRIGGER_OWN_THREAD=y
CONFIG_LSM6DSO=y
CONFIG_LSM6DSO_ENABLE_TEMP=n
CONFIG_LSM6DSO_INT_PIN_2=y
CONFIG_LSM6DSO_TRIGGER_OWN_THREAD=y
CONFIG_CBPRINTF_FP_SUPPORT=y