diff --git a/drivers/sensor/lis2dw12/Kconfig b/drivers/sensor/lis2dw12/Kconfig index 3b1b77d39e7..58d6330b29b 100644 --- a/drivers/sensor/lis2dw12/Kconfig +++ b/drivers/sensor/lis2dw12/Kconfig @@ -52,20 +52,6 @@ config LIS2DW12_THREAD_STACK_SIZE help Stack size of thread used by the driver to handle interrupts. -choice - prompt "Sensor INT pin number" - default LIS2DW12_INT_PIN_1 - help - The number of LIS2DW12 int pin used to generate interrupt to cpu. - Supported values are int1 or int2 - -config LIS2DW12_INT_PIN_1 - bool "int1" - -config LIS2DW12_INT_PIN_2 - bool "int2" -endchoice - menuconfig LIS2DW12_PULSE bool "Pulse detection" help diff --git a/drivers/sensor/lis2dw12/lis2dw12.c b/drivers/sensor/lis2dw12/lis2dw12.c index e4f506a4dd0..84f264e7cb5 100644 --- a/drivers/sensor/lis2dw12/lis2dw12.c +++ b/drivers/sensor/lis2dw12/lis2dw12.c @@ -381,11 +381,7 @@ const struct lis2dw12_device_config lis2dw12_cfg = { .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_LIS2DW12_INT_PIN_1) - .int_pin = 1, -#elif defined(CONFIG_LIS2DW12_INT_PIN_2) - .int_pin = 2, -#endif /* CONFIG_LIS2DW12_INT_PIN */ + .int_pin = DT_INST_PROP(0, int_pin), #ifdef CONFIG_LIS2DW12_PULSE #if defined(CONFIG_LIS2DW12_ONLY_SINGLE) diff --git a/drivers/sensor/lis2dw12/lis2dw12_trigger.c b/drivers/sensor/lis2dw12/lis2dw12_trigger.c index 81537d26372..d8e238cd3c9 100644 --- a/drivers/sensor/lis2dw12/lis2dw12_trigger.c +++ b/drivers/sensor/lis2dw12/lis2dw12_trigger.c @@ -244,6 +244,7 @@ int lis2dw12_init_interrupt(const struct device *dev) lis2dw12->dev = dev; + LOG_INF("%s: int-pin is on INT%d", dev->name, cfg->int_pin); #if defined(CONFIG_LIS2DW12_TRIGGER_OWN_THREAD) k_sem_init(&lis2dw12->gpio_sem, 0, K_SEM_MAX_LIMIT); diff --git a/dts/bindings/sensor/st,lis2dw12-common.yaml b/dts/bindings/sensor/st,lis2dw12-common.yaml index 5f3fd933d2a..a79fa43953b 100644 --- a/dts/bindings/sensor/st,lis2dw12-common.yaml +++ b/dts/bindings/sensor/st,lis2dw12-common.yaml @@ -11,3 +11,21 @@ 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 + - 2 + description: | + Select DRDY pin number (1 or 2). + + 1 # drdy is generated from INT1 + 2 # drdy is generated from INT2 + + 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. diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index ff82fbb1d9f..eb71db99ae2 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -539,7 +539,6 @@ UNDEF_KCONFIG_WHITELIST = { "FOO_LOG_LEVEL", "FOO_SETTING_1", "FOO_SETTING_2", - "LIS2DW12_INT_PIN", "LSM6DSO_INT_PIN", "MISSING", "MODULES",