* [PATCH v3 1/4] dt-bindings: iio: update unreachable maintainer entries
2026-08-21 18:07 [PATCH v3 0/4] iio: accel: adxl367: add INT2 interrupt pin support Antoniu Miclaus
@ 2026-08-21 18:07 ` Antoniu Miclaus
2026-08-23 18:45 ` Jonathan Cameron
2026-08-24 12:00 ` Marcelo Schmitt
2026-08-21 18:07 ` [PATCH v3 2/4] dt-bindings: iio: accel: adi,adxl367: add interrupt-names Antoniu Miclaus
` (2 subsequent siblings)
3 siblings, 2 replies; 10+ messages in thread
From: Antoniu Miclaus @ 2026-08-21 18:07 UTC (permalink / raw)
To: Marcelo Schmitt, Antoniu Miclaus, Nuno Sá, Michael Hennerich,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-iio, linux, devicetree, linux-kernel
Cosmin's Analog Devices address is no longer valid, leaving the ADXL367,
AD4130, AD74115 and AD74413R bindings without a reachable maintainer.
Take over maintainership of those bindings and add myself to the
corresponding MAINTAINERS entries alongside Marcelo.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
---
Changes in v3:
- No changes.
Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml | 2 +-
Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml | 3 ++-
Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml | 3 ++-
Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml | 3 ++-
MAINTAINERS | 4 ++++
5 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml
index f10d98d34cb8..29689bc38b90 100644
--- a/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml
+++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices ADXL367 3-Axis Digital Accelerometer
maintainers:
- - Cosmin Tanislav <cosmin.tanislav@analog.com>
+ - Antoniu Miclaus <antoniu.miclaus@analog.com>
description: |
The ADXL367 is an ultralow power, 3-axis MEMS accelerometer.
diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
index cc38617bb829..a4ab6adef1c6 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
@@ -8,7 +8,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices AD4130 family ADCs
maintainers:
- - Cosmin Tanislav <cosmin.tanislav@analog.com>
+ - Marcelo Schmitt <marcelo.schmitt@analog.com>
+ - Antoniu Miclaus <antoniu.miclaus@analog.com>
description: |
Bindings for the Analog Devices AD4130 family ADCs.
diff --git a/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml b/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
index 2a04906531fb..6aa86cb56032 100644
--- a/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
+++ b/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices AD74115H device
maintainers:
- - Cosmin Tanislav <cosmin.tanislav@analog.com>
+ - Marcelo Schmitt <marcelo.schmitt@analog.com>
+ - Antoniu Miclaus <antoniu.miclaus@analog.com>
description: |
The AD74115H is a single-channel software configurable input/output
diff --git a/Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml b/Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml
index 590ea7936ad7..5318a00e7669 100644
--- a/Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml
+++ b/Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml
@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices AD74412R/AD74413R device
maintainers:
- - Cosmin Tanislav <cosmin.tanislav@analog.com>
+ - Marcelo Schmitt <marcelo.schmitt@analog.com>
+ - Antoniu Miclaus <antoniu.miclaus@analog.com>
description: |
The AD74412R and AD74413R are quad-channel software configurable input/output
diff --git a/MAINTAINERS b/MAINTAINERS
index 04fa5322d9f7..ade07e6637bc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -641,6 +641,7 @@ F: drivers/iio/accel/adxl355_spi.c
ADXL367 THREE-AXIS DIGITAL ACCELEROMETER DRIVER
M: Marcelo Schmitt <marcelo.schmitt@analog.com>
+M: Antoniu Miclaus <antoniu.miclaus@analog.com>
L: linux-iio@vger.kernel.org
S: Supported
W: https://ez.analog.com/linux-software-drivers
@@ -1493,6 +1494,7 @@ F: drivers/iio/adc/ad4080.c
ANALOG DEVICES INC AD4130 DRIVER
M: Marcelo Schmitt <marcelo.schmitt@analog.com>
+M: Antoniu Miclaus <antoniu.miclaus@analog.com>
L: linux-iio@vger.kernel.org
S: Supported
W: https://ez.analog.com/linux-software-drivers
@@ -1598,6 +1600,7 @@ F: drivers/iio/dac/ad7293.c
ANALOG DEVICES INC AD74115 DRIVER
M: Marcelo Schmitt <marcelo.schmitt@analog.com>
+M: Antoniu Miclaus <antoniu.miclaus@analog.com>
L: linux-iio@vger.kernel.org
S: Supported
W: https://ez.analog.com/linux-software-drivers
@@ -1606,6 +1609,7 @@ F: drivers/iio/addac/ad74115.c
ANALOG DEVICES INC AD74413R DRIVER
M: Marcelo Schmitt <marcelo.schmitt@analog.com>
+M: Antoniu Miclaus <antoniu.miclaus@analog.com>
L: linux-iio@vger.kernel.org
S: Supported
W: https://ez.analog.com/linux-software-drivers
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH v3 1/4] dt-bindings: iio: update unreachable maintainer entries
2026-08-21 18:07 ` [PATCH v3 1/4] dt-bindings: iio: update unreachable maintainer entries Antoniu Miclaus
@ 2026-08-23 18:45 ` Jonathan Cameron
2026-08-24 12:00 ` Marcelo Schmitt
1 sibling, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2026-08-23 18:45 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Marcelo Schmitt, Nuno Sá, Michael Hennerich, David Lechner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-iio, linux,
devicetree, linux-kernel
On Fri, 21 Aug 2026 21:07:50 +0300
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> Cosmin's Analog Devices address is no longer valid, leaving the ADXL367,
> AD4130, AD74115 and AD74413R bindings without a reachable maintainer.
> Take over maintainership of those bindings and add myself to the
> corresponding MAINTAINERS entries alongside Marcelo.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Looking for an Ack from Marcello.
Jonathan
> ---
> Changes in v3:
> - No changes.
>
> Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml | 2 +-
> Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml | 3 ++-
> Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml | 3 ++-
> Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml | 3 ++-
> MAINTAINERS | 4 ++++
> 5 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml
> index f10d98d34cb8..29689bc38b90 100644
> --- a/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml
> +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml
> @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
> title: Analog Devices ADXL367 3-Axis Digital Accelerometer
>
> maintainers:
> - - Cosmin Tanislav <cosmin.tanislav@analog.com>
> + - Antoniu Miclaus <antoniu.miclaus@analog.com>
>
> description: |
> The ADXL367 is an ultralow power, 3-axis MEMS accelerometer.
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
> index cc38617bb829..a4ab6adef1c6 100644
> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
> @@ -8,7 +8,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
> title: Analog Devices AD4130 family ADCs
>
> maintainers:
> - - Cosmin Tanislav <cosmin.tanislav@analog.com>
> + - Marcelo Schmitt <marcelo.schmitt@analog.com>
> + - Antoniu Miclaus <antoniu.miclaus@analog.com>
>
> description: |
> Bindings for the Analog Devices AD4130 family ADCs.
> diff --git a/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml b/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
> index 2a04906531fb..6aa86cb56032 100644
> --- a/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
> +++ b/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
> @@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
> title: Analog Devices AD74115H device
>
> maintainers:
> - - Cosmin Tanislav <cosmin.tanislav@analog.com>
> + - Marcelo Schmitt <marcelo.schmitt@analog.com>
> + - Antoniu Miclaus <antoniu.miclaus@analog.com>
>
> description: |
> The AD74115H is a single-channel software configurable input/output
> diff --git a/Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml b/Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml
> index 590ea7936ad7..5318a00e7669 100644
> --- a/Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml
> +++ b/Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml
> @@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
> title: Analog Devices AD74412R/AD74413R device
>
> maintainers:
> - - Cosmin Tanislav <cosmin.tanislav@analog.com>
> + - Marcelo Schmitt <marcelo.schmitt@analog.com>
> + - Antoniu Miclaus <antoniu.miclaus@analog.com>
>
> description: |
> The AD74412R and AD74413R are quad-channel software configurable input/output
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 04fa5322d9f7..ade07e6637bc 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -641,6 +641,7 @@ F: drivers/iio/accel/adxl355_spi.c
>
> ADXL367 THREE-AXIS DIGITAL ACCELEROMETER DRIVER
> M: Marcelo Schmitt <marcelo.schmitt@analog.com>
> +M: Antoniu Miclaus <antoniu.miclaus@analog.com>
> L: linux-iio@vger.kernel.org
> S: Supported
> W: https://ez.analog.com/linux-software-drivers
> @@ -1493,6 +1494,7 @@ F: drivers/iio/adc/ad4080.c
>
> ANALOG DEVICES INC AD4130 DRIVER
> M: Marcelo Schmitt <marcelo.schmitt@analog.com>
> +M: Antoniu Miclaus <antoniu.miclaus@analog.com>
> L: linux-iio@vger.kernel.org
> S: Supported
> W: https://ez.analog.com/linux-software-drivers
> @@ -1598,6 +1600,7 @@ F: drivers/iio/dac/ad7293.c
>
> ANALOG DEVICES INC AD74115 DRIVER
> M: Marcelo Schmitt <marcelo.schmitt@analog.com>
> +M: Antoniu Miclaus <antoniu.miclaus@analog.com>
> L: linux-iio@vger.kernel.org
> S: Supported
> W: https://ez.analog.com/linux-software-drivers
> @@ -1606,6 +1609,7 @@ F: drivers/iio/addac/ad74115.c
>
> ANALOG DEVICES INC AD74413R DRIVER
> M: Marcelo Schmitt <marcelo.schmitt@analog.com>
> +M: Antoniu Miclaus <antoniu.miclaus@analog.com>
> L: linux-iio@vger.kernel.org
> S: Supported
> W: https://ez.analog.com/linux-software-drivers
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: iio: update unreachable maintainer entries
2026-08-21 18:07 ` [PATCH v3 1/4] dt-bindings: iio: update unreachable maintainer entries Antoniu Miclaus
2026-08-23 18:45 ` Jonathan Cameron
@ 2026-08-24 12:00 ` Marcelo Schmitt
1 sibling, 0 replies; 10+ messages in thread
From: Marcelo Schmitt @ 2026-08-24 12:00 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Marcelo Schmitt, Nuno Sá, Michael Hennerich,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-iio, linux, devicetree, linux-kernel
On 08/21, Antoniu Miclaus wrote:
> Cosmin's Analog Devices address is no longer valid, leaving the ADXL367,
> AD4130, AD74115 and AD74413R bindings without a reachable maintainer.
> Take over maintainership of those bindings and add myself to the
> corresponding MAINTAINERS entries alongside Marcelo.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>
> ---
Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Thanks
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 2/4] dt-bindings: iio: accel: adi,adxl367: add interrupt-names
2026-08-21 18:07 [PATCH v3 0/4] iio: accel: adxl367: add INT2 interrupt pin support Antoniu Miclaus
2026-08-21 18:07 ` [PATCH v3 1/4] dt-bindings: iio: update unreachable maintainer entries Antoniu Miclaus
@ 2026-08-21 18:07 ` Antoniu Miclaus
2026-08-21 18:07 ` [PATCH v3 3/4] iio: accel: adxl367: use regmap_assign_bits() Antoniu Miclaus
2026-08-21 18:07 ` [PATCH v3 4/4] iio: accel: adxl367: add support for INT2 interrupt pin Antoniu Miclaus
3 siblings, 0 replies; 10+ messages in thread
From: Antoniu Miclaus @ 2026-08-21 18:07 UTC (permalink / raw)
To: Marcelo Schmitt, Antoniu Miclaus, Nuno Sá, Michael Hennerich,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-iio, linux, devicetree, linux-kernel
The ADXL367 has two independent interrupt output pins, INT1 and INT2,
either of which may be wired to the host. Allow the interrupt line that
is connected to be described by adding an optional interrupt-names
property accepting "INT1" and/or "INT2", and permit a second interrupt
entry. interrupt-names is kept optional so existing device trees that
only specify a bare interrupts property remain valid.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
Changes in v3:
- No changes.
.../devicetree/bindings/iio/accel/adi,adxl367.yaml | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml
index 29689bc38b90..115170eac058 100644
--- a/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml
+++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl367.yaml
@@ -33,7 +33,14 @@ properties:
maxItems: 1
interrupts:
- maxItems: 1
+ minItems: 1
+ maxItems: 2
+
+ interrupt-names:
+ minItems: 1
+ items:
+ - enum: [INT1, INT2]
+ - const: INT2
vdd-supply: true
vddio-supply: true
@@ -61,6 +68,7 @@ examples:
reg = <0x53>;
interrupt-parent = <&gpio>;
interrupts = <25 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "INT1";
};
};
- |
@@ -76,5 +84,6 @@ examples:
spi-max-frequency = <1000000>;
interrupt-parent = <&gpio>;
interrupts = <25 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "INT1";
};
};
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH v3 3/4] iio: accel: adxl367: use regmap_assign_bits()
2026-08-21 18:07 [PATCH v3 0/4] iio: accel: adxl367: add INT2 interrupt pin support Antoniu Miclaus
2026-08-21 18:07 ` [PATCH v3 1/4] dt-bindings: iio: update unreachable maintainer entries Antoniu Miclaus
2026-08-21 18:07 ` [PATCH v3 2/4] dt-bindings: iio: accel: adi,adxl367: add interrupt-names Antoniu Miclaus
@ 2026-08-21 18:07 ` Antoniu Miclaus
2026-08-24 12:19 ` Marcelo Schmitt
2026-08-21 18:07 ` [PATCH v3 4/4] iio: accel: adxl367: add support for INT2 interrupt pin Antoniu Miclaus
3 siblings, 1 reply; 10+ messages in thread
From: Antoniu Miclaus @ 2026-08-21 18:07 UTC (permalink / raw)
To: Marcelo Schmitt, Antoniu Miclaus, Nuno Sá, Michael Hennerich,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-iio, linux, devicetree, linux-kernel
Several helpers set or clear a fixed set of bits based on a boolean using
the regmap_update_bits(reg, mask, en ? mask : 0) idiom. Replace these with
regmap_assign_bits(), which expresses the same intent more concisely.
No functional change intended.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
Changes in v3:
- New patch, splitting out the regmap_assign_bits() conversion suggested
during review of the INT2 patch.
drivers/iio/accel/adxl367.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
index 4ff1c7a0988b..54c4d1226790 100644
--- a/drivers/iio/accel/adxl367.c
+++ b/drivers/iio/accel/adxl367.c
@@ -366,8 +366,7 @@ static int adxl367_set_act_interrupt_en(struct adxl367_state *st,
{
unsigned int mask = adxl367_act_int_mask_tbl[act];
- return regmap_update_bits(st->regmap, ADXL367_REG_INT1_MAP,
- mask, en ? mask : 0);
+ return regmap_assign_bits(st->regmap, ADXL367_REG_INT1_MAP, mask, en);
}
static int adxl367_get_act_interrupt_en(struct adxl367_state *st,
@@ -401,9 +400,8 @@ static int adxl367_set_act_en(struct adxl367_state *st,
static int adxl367_set_fifo_watermark_interrupt_en(struct adxl367_state *st,
bool en)
{
- return regmap_update_bits(st->regmap, ADXL367_REG_INT1_MAP,
- ADXL367_INT_FIFO_WATERMARK_MASK,
- en ? ADXL367_INT_FIFO_WATERMARK_MASK : 0);
+ return regmap_assign_bits(st->regmap, ADXL367_REG_INT1_MAP,
+ ADXL367_INT_FIFO_WATERMARK_MASK, en);
}
static int adxl367_get_fifo_mode(struct adxl367_state *st,
@@ -631,8 +629,7 @@ static int adxl367_set_odr(struct iio_dev *indio_dev, enum adxl367_odr odr)
static int adxl367_set_temp_adc_en(struct adxl367_state *st, unsigned int reg,
bool en)
{
- return regmap_update_bits(st->regmap, reg, ADXL367_ADC_EN_MASK,
- en ? ADXL367_ADC_EN_MASK : 0);
+ return regmap_assign_bits(st->regmap, reg, ADXL367_ADC_EN_MASK, en);
}
static int adxl367_set_temp_adc_reg_en(struct adxl367_state *st,
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH v3 3/4] iio: accel: adxl367: use regmap_assign_bits()
2026-08-21 18:07 ` [PATCH v3 3/4] iio: accel: adxl367: use regmap_assign_bits() Antoniu Miclaus
@ 2026-08-24 12:19 ` Marcelo Schmitt
0 siblings, 0 replies; 10+ messages in thread
From: Marcelo Schmitt @ 2026-08-24 12:19 UTC (permalink / raw)
To: Antoniu Miclaus
Cc: Marcelo Schmitt, Nuno Sá, Michael Hennerich,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-iio, linux, devicetree, linux-kernel
On 08/21, Antoniu Miclaus wrote:
> Several helpers set or clear a fixed set of bits based on a boolean using
> the regmap_update_bits(reg, mask, en ? mask : 0) idiom. Replace these with
> regmap_assign_bits(), which expresses the same intent more concisely.
>
> No functional change intended.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 4/4] iio: accel: adxl367: add support for INT2 interrupt pin
2026-08-21 18:07 [PATCH v3 0/4] iio: accel: adxl367: add INT2 interrupt pin support Antoniu Miclaus
` (2 preceding siblings ...)
2026-08-21 18:07 ` [PATCH v3 3/4] iio: accel: adxl367: use regmap_assign_bits() Antoniu Miclaus
@ 2026-08-21 18:07 ` Antoniu Miclaus
2026-08-22 19:07 ` David Lechner
3 siblings, 1 reply; 10+ messages in thread
From: Antoniu Miclaus @ 2026-08-21 18:07 UTC (permalink / raw)
To: Marcelo Schmitt, Antoniu Miclaus, Nuno Sá, Michael Hennerich,
Jonathan Cameron, David Lechner, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-iio, linux, devicetree, linux-kernel
The ADXL367 provides two independent interrupt output pins, INT1 and
INT2, each with its own event mapping register (INTMAP1_LOWER at 0x2A
and INTMAP2_LOWER at 0x2B) sharing an identical bit layout. Until now
the driver hardcoded INT1 for all interrupt mappings, so a board that
routes only INT2 to the host could never receive activity, inactivity
or FIFO watermark interrupts.
Determine the connected pin from the interrupt-names device tree
property using fwnode_irq_get_byname(), and route the interrupt
mappings to the matching register. Use the interrupt number returned by
the lookup for devm_request_threaded_irq() so the requested line always
matches the routed INTMAP register, regardless of the order in which the
interrupts are listed. When no interrupt-names are present, default to
INT1 and the bus-provided interrupt to preserve the existing behaviour.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
Changes in v3:
- Use the interrupt number returned by fwnode_irq_get_byname() for
devm_request_threaded_irq() so the requested line always matches the
routed INTMAP register, regardless of the interrupt-names order.
- Access the interrupt map register via regmap_assign_bits() following
the new precursor patch.
drivers/iio/accel/adxl367.c | 40 ++++++++++++++++++++++++++++++++++---
1 file changed, 37 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
index 54c4d1226790..f5808980b639 100644
--- a/drivers/iio/accel/adxl367.c
+++ b/drivers/iio/accel/adxl367.c
@@ -13,6 +13,7 @@
#include <linux/iio/sysfs.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/unaligned.h>
@@ -81,6 +82,7 @@
#define ADXL367_SAMPLES_L_MASK GENMASK(7, 0)
#define ADXL367_REG_INT1_MAP 0x2A
+#define ADXL367_REG_INT2_MAP 0x2B
#define ADXL367_INT_INACT_MASK BIT(5)
#define ADXL367_INT_ACT_MASK BIT(4)
#define ADXL367_INT_FIFO_WATERMARK_MASK BIT(2)
@@ -168,6 +170,8 @@ struct adxl367_state {
enum adxl367_odr odr;
enum adxl367_range range;
+ u8 int_map_reg;
+
unsigned int act_threshold;
unsigned int act_time_ms;
unsigned int inact_threshold;
@@ -366,7 +370,7 @@ static int adxl367_set_act_interrupt_en(struct adxl367_state *st,
{
unsigned int mask = adxl367_act_int_mask_tbl[act];
- return regmap_assign_bits(st->regmap, ADXL367_REG_INT1_MAP, mask, en);
+ return regmap_assign_bits(st->regmap, st->int_map_reg, mask, en);
}
static int adxl367_get_act_interrupt_en(struct adxl367_state *st,
@@ -377,7 +381,7 @@ static int adxl367_get_act_interrupt_en(struct adxl367_state *st,
unsigned int val;
int ret;
- ret = regmap_read(st->regmap, ADXL367_REG_INT1_MAP, &val);
+ ret = regmap_read(st->regmap, st->int_map_reg, &val);
if (ret)
return ret;
@@ -400,7 +404,7 @@ static int adxl367_set_act_en(struct adxl367_state *st,
static int adxl367_set_fifo_watermark_interrupt_en(struct adxl367_state *st,
bool en)
{
- return regmap_assign_bits(st->regmap, ADXL367_REG_INT1_MAP,
+ return regmap_assign_bits(st->regmap, st->int_map_reg,
ADXL367_INT_FIFO_WATERMARK_MASK, en);
}
@@ -1423,6 +1427,31 @@ static int adxl367_setup(struct adxl367_state *st)
return adxl367_set_measure_en(st, true);
}
+static int adxl367_set_int_map_reg(struct adxl367_state *st, int irq)
+{
+ int ret;
+
+ ret = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1");
+ if (ret == -EPROBE_DEFER)
+ return ret;
+ if (ret > 0) {
+ st->int_map_reg = ADXL367_REG_INT1_MAP;
+ return ret;
+ }
+
+ ret = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT2");
+ if (ret == -EPROBE_DEFER)
+ return ret;
+ if (ret > 0) {
+ st->int_map_reg = ADXL367_REG_INT2_MAP;
+ return ret;
+ }
+
+ /* No interrupt-names: default to INT1 for backwards compatibility. */
+ st->int_map_reg = ADXL367_REG_INT1_MAP;
+ return irq;
+}
+
int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
void *context, struct regmap *regmap, int irq)
{
@@ -1479,6 +1508,11 @@ int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
if (ret)
return ret;
+ ret = adxl367_set_int_map_reg(st, irq);
+ if (ret < 0)
+ return dev_err_probe(st->dev, ret, "Failed to get interrupt\n");
+ irq = ret;
+
ret = devm_request_threaded_irq(st->dev, irq, NULL,
adxl367_irq_handler, IRQF_ONESHOT,
indio_dev->name, indio_dev);
--
2.43.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH v3 4/4] iio: accel: adxl367: add support for INT2 interrupt pin
2026-08-21 18:07 ` [PATCH v3 4/4] iio: accel: adxl367: add support for INT2 interrupt pin Antoniu Miclaus
@ 2026-08-22 19:07 ` David Lechner
2026-08-23 18:43 ` Jonathan Cameron
0 siblings, 1 reply; 10+ messages in thread
From: David Lechner @ 2026-08-22 19:07 UTC (permalink / raw)
To: Antoniu Miclaus, Marcelo Schmitt, Nuno Sá, Michael Hennerich,
Jonathan Cameron, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
linux-iio, linux, devicetree, linux-kernel
On 8/21/26 1:07 PM, Antoniu Miclaus wrote:
> The ADXL367 provides two independent interrupt output pins, INT1 and
> INT2, each with its own event mapping register (INTMAP1_LOWER at 0x2A
> and INTMAP2_LOWER at 0x2B) sharing an identical bit layout. Until now
> the driver hardcoded INT1 for all interrupt mappings, so a board that
> routes only INT2 to the host could never receive activity, inactivity
> or FIFO watermark interrupts.
>
> Determine the connected pin from the interrupt-names device tree
> property using fwnode_irq_get_byname(), and route the interrupt
> mappings to the matching register. Use the interrupt number returned by
> the lookup for devm_request_threaded_irq() so the requested line always
> matches the routed INTMAP register, regardless of the order in which the
> interrupts are listed. When no interrupt-names are present, default to
> INT1 and the bus-provided interrupt to preserve the existing behaviour.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
> Changes in v3:
> - Use the interrupt number returned by fwnode_irq_get_byname() for
> devm_request_threaded_irq() so the requested line always matches the
> routed INTMAP register, regardless of the interrupt-names order.
> - Access the interrupt map register via regmap_assign_bits() following
> the new precursor patch.
>
> drivers/iio/accel/adxl367.c | 40 ++++++++++++++++++++++++++++++++++---
> 1 file changed, 37 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
> index 54c4d1226790..f5808980b639 100644
> --- a/drivers/iio/accel/adxl367.c
> +++ b/drivers/iio/accel/adxl367.c
> @@ -13,6 +13,7 @@
> #include <linux/iio/sysfs.h>
> #include <linux/interrupt.h>
> #include <linux/irq.h>
> +#include <linux/property.h>
> #include <linux/regmap.h>
> #include <linux/regulator/consumer.h>
> #include <linux/unaligned.h>
> @@ -81,6 +82,7 @@
> #define ADXL367_SAMPLES_L_MASK GENMASK(7, 0)
>
> #define ADXL367_REG_INT1_MAP 0x2A
> +#define ADXL367_REG_INT2_MAP 0x2B
> #define ADXL367_INT_INACT_MASK BIT(5)
> #define ADXL367_INT_ACT_MASK BIT(4)
> #define ADXL367_INT_FIFO_WATERMARK_MASK BIT(2)
> @@ -168,6 +170,8 @@ struct adxl367_state {
> enum adxl367_odr odr;
> enum adxl367_range range;
>
> + u8 int_map_reg;
> +
> unsigned int act_threshold;
> unsigned int act_time_ms;
> unsigned int inact_threshold;
> @@ -366,7 +370,7 @@ static int adxl367_set_act_interrupt_en(struct adxl367_state *st,
> {
> unsigned int mask = adxl367_act_int_mask_tbl[act];
>
> - return regmap_assign_bits(st->regmap, ADXL367_REG_INT1_MAP, mask, en);
> + return regmap_assign_bits(st->regmap, st->int_map_reg, mask, en);
> }
>
> static int adxl367_get_act_interrupt_en(struct adxl367_state *st,
> @@ -377,7 +381,7 @@ static int adxl367_get_act_interrupt_en(struct adxl367_state *st,
> unsigned int val;
> int ret;
>
> - ret = regmap_read(st->regmap, ADXL367_REG_INT1_MAP, &val);
> + ret = regmap_read(st->regmap, st->int_map_reg, &val);
> if (ret)
> return ret;
>
> @@ -400,7 +404,7 @@ static int adxl367_set_act_en(struct adxl367_state *st,
> static int adxl367_set_fifo_watermark_interrupt_en(struct adxl367_state *st,
> bool en)
> {
> - return regmap_assign_bits(st->regmap, ADXL367_REG_INT1_MAP,
> + return regmap_assign_bits(st->regmap, st->int_map_reg,
> ADXL367_INT_FIFO_WATERMARK_MASK, en);
> }
>
> @@ -1423,6 +1427,31 @@ static int adxl367_setup(struct adxl367_state *st)
> return adxl367_set_measure_en(st, true);
> }
>
> +static int adxl367_set_int_map_reg(struct adxl367_state *st, int irq)
> +{
> + int ret;
> +
> + ret = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1");
> + if (ret == -EPROBE_DEFER)
> + return ret;
> + if (ret > 0) {
> + st->int_map_reg = ADXL367_REG_INT1_MAP;
> + return ret;
> + }
> +
> + ret = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT2");
> + if (ret == -EPROBE_DEFER)
> + return ret;
> + if (ret > 0) {
> + st->int_map_reg = ADXL367_REG_INT2_MAP;
> + return ret;
> + }
> +
> + /* No interrupt-names: default to INT1 for backwards compatibility. */
> + st->int_map_reg = ADXL367_REG_INT1_MAP;
> + return irq;
I guess this works, but it seems like trial and error rather than being
purposeful.
Could probably do something like this too:
if (device_property_present("interrupt-names")) {
ret = device_property_match_string(st->dev, "interrupt-names",
"INT2");
if (ret < 0)
return ret;
/* If INT2 is at index 0, use it, otherwise use INT1. */
st->int_map_reg = ret ? ADXL367_REG_INT2_MAP : ADXL367_REG_INT1_MAP;
} else {
/* No interrupt-names: default to INT1 for backwards compatibility. */
st->int_map_reg = ADXL367_REG_INT1_MAP;
}
ret = fwnode_irq_get_byname(dev_fwnode(st->dev),
st->int_map_reg == ADXL367_REG_INT1_MAP ?
"INT1" : "INT2");
(Could use device_property_match_property_string() instead if we want to
return error on invalid values instead of assuming INT1.)
> +}
> +
> int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
> void *context, struct regmap *regmap, int irq)
> {
> @@ -1479,6 +1508,11 @@ int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
> if (ret)
> return ret;
>
> + ret = adxl367_set_int_map_reg(st, irq);
> + if (ret < 0)
> + return dev_err_probe(st->dev, ret, "Failed to get interrupt\n");
> + irq = ret;
> +
> ret = devm_request_threaded_irq(st->dev, irq, NULL,
> adxl367_irq_handler, IRQF_ONESHOT,
> indio_dev->name, indio_dev);
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3 4/4] iio: accel: adxl367: add support for INT2 interrupt pin
2026-08-22 19:07 ` David Lechner
@ 2026-08-23 18:43 ` Jonathan Cameron
0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2026-08-23 18:43 UTC (permalink / raw)
To: David Lechner
Cc: Antoniu Miclaus, Marcelo Schmitt, Nuno Sá, Michael Hennerich,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-iio, linux,
devicetree, linux-kernel
...
> > +static int adxl367_set_int_map_reg(struct adxl367_state *st, int irq)
> > +{
> > + int ret;
> > +
> > + ret = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1");
> > + if (ret == -EPROBE_DEFER)
> > + return ret;
There is only one return value that means the value wasn't there, -ENODATA
For other values we'd ideally return the error. Bit ugly but something like
if (ret < 0) {
if (ret != -ENODATA)
return ret;
} else {
st->int_map_reg = ADXL367_REG_INT1_MAP;
return ret;
}
> > + if (ret > 0) {
> > + st->int_map_reg = ADXL367_REG_INT1_MAP;
> > + return ret;
> > + }
> > +
> > + ret = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT2");
> > + if (ret == -EPROBE_DEFER)
> > + return ret;
> > + if (ret > 0) {
> > + st->int_map_reg = ADXL367_REG_INT2_MAP;
> > + return ret;
> > + }
> > +
> > + /* No interrupt-names: default to INT1 for backwards compatibility. */
> > + st->int_map_reg = ADXL367_REG_INT1_MAP;
> > + return irq;
>
> I guess this works, but it seems like trial and error rather than being
> purposeful.
>
> Could probably do something like this too:
>
> if (device_property_present("interrupt-names")) {
> ret = device_property_match_string(st->dev, "interrupt-names",
> "INT2");
> if (ret < 0)
> return ret;
If we get -ENODATA this exits - but that just means we didn't find the property
(the docs aren't great for these functions - could do with improving if anyone
has time!)
>
> /* If INT2 is at index 0, use it, otherwise use INT1. */
As you suggest below, an explicit INT1 match would be better. Also why do we care about
the index being 0. We just need to provide irq to map_reg for an irq.
> st->int_map_reg = ret ? ADXL367_REG_INT2_MAP : ADXL367_REG_INT1_MAP;
> } else {
> /* No interrupt-names: default to INT1 for backwards compatibility. */
> st->int_map_reg = ADXL367_REG_INT1_MAP;
> }
>
>
> ret = fwnode_irq_get_byname(dev_fwnode(st->dev),
> st->int_map_reg == ADXL367_REG_INT1_MAP ?
> "INT1" : "INT2");
>
>
> (Could use device_property_match_property_string() instead if we want to
> return error on invalid values instead of assuming INT1.)
Whilst I see your point about trying and failing being a bit ugly that is
how we normally handle optional irqs and I think the code flow ends up
simpler than trying to be more clever.
I wouldn't mind a helper that lets us find any random irq from a set of
provided names providing us the index and the irq number
const char *irq_names[] = { "INT1", "INT2 };
int index = 0;
ret = fwnode_irq_get_byname_from_array(dev_fwnode(st->dev),
irq_names, ARRAY_SIZE(irq_names),
&index);
if (ret < 0) {
if (ret == -ENODATA) {
/* Default to INT1 for backwards compat */
st->int_map_reg = ADXL367_REG_INT1_MAP;
return irq;
}
return ret;
}
st->int_map_reg = index ? ADXL367_REG_INT2_MAP : ADXL367_REG_INT1_MAP;
return ret;
I haven't checked but such a helper should I think be pretty useful across
a range of IIO drivers and probably beyond.
Obviously that pushes the style of code choice into the helper though so
the above discussion on what is the better choice continues..
Jonathan.
>
> > +}
> > +
> > int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
> > void *context, struct regmap *regmap, int irq)
> > {
> > @@ -1479,6 +1508,11 @@ int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
> > if (ret)
> > return ret;
> >
> > + ret = adxl367_set_int_map_reg(st, irq);
> > + if (ret < 0)
> > + return dev_err_probe(st->dev, ret, "Failed to get interrupt\n");
> > + irq = ret;
> > +
> > ret = devm_request_threaded_irq(st->dev, irq, NULL,
> > adxl367_irq_handler, IRQF_ONESHOT,
> > indio_dev->name, indio_dev);
>
^ permalink raw reply [flat|nested] 10+ messages in thread