[PATCH v2 03/14] dt-bindings: iio: accel: bosch,bma220 change irq type

Petre Rodan posted 14 patches 3 weeks, 1 day ago
There is a newer version of this series
[PATCH v2 03/14] dt-bindings: iio: accel: bosch,bma220 change irq type
Posted by Petre Rodan 3 weeks, 1 day ago
Set the interrupt type to rising edge instead of high level.

Quoting from the datasheet:

 "If at least one of the configured conditions applies, an interrupt
 (logic ‘1’) is issued through the INT pin of the sensor."

The old code did not request an irq line via devm_request_threaded_irq()
so there is no backward compatibility that would be affected by this
change.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
---
ChangeLog:
- split out from a bigger patch file
---
 Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
index 0e27ec74065acca611e63309d6ae889b8a3134ce..8c820c27f781e8001bc14b4ca6ab1f293bdb18ca 100644
--- a/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
+++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
@@ -50,7 +50,7 @@ examples:
             spi-cpol;
             spi-cpha;
             interrupt-parent = <&gpio0>;
-            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+            interrupts = <0 IRQ_TYPE_EDGE_RISING>;
         };
     };
 ...

-- 
2.49.1

Re: [PATCH v2 03/14] dt-bindings: iio: accel: bosch,bma220 change irq type
Posted by Krzysztof Kozlowski 3 weeks ago
On Wed, Sep 10, 2025 at 10:57:08AM +0300, Petre Rodan wrote:
> Set the interrupt type to rising edge instead of high level.
> 
> Quoting from the datasheet:
> 
>  "If at least one of the configured conditions applies, an interrupt
>  (logic ‘1’) is issued through the INT pin of the sensor."

I don't see how this explains/suggests raising edge.

> 
> The old code did not request an irq line via devm_request_threaded_irq()
> so there is no backward compatibility that would be affected by this
> change.

This sentence is irrelevant. You are changing only example, which has
zero impact.

Rewrite the subject and commit msg to accurately say this - it is only
example - because now you suggest you actually change something...

Best regards,
Krzysztof
Re: [PATCH v2 03/14] dt-bindings: iio: accel: bosch,bma220 change irq type
Posted by Petre Rodan 3 weeks ago
Hi Krzysztof,

On Thu, Sep 11, 2025 at 09:33:25AM +0200, Krzysztof Kozlowski wrote:
> On Wed, Sep 10, 2025 at 10:57:08AM +0300, Petre Rodan wrote:
> > Set the interrupt type to rising edge instead of high level.
> > 
> > Quoting from the datasheet:
> > 
> >  "If at least one of the configured conditions applies, an interrupt
> >  (logic ???1???) is issued through the INT pin of the sensor."
> 
> I don't see how this explains/suggests raising edge.

well, I want my driver to react directly at the transition from lo to hi
(aka rising edge) of the INT signal.

why?
1. by default the latch register is disabled, thus the master (my driver) is not
expected to ack or clear any interrupt flag. the sensor controls when the INT line
deasserts. for instance during a tap interrupt the bottom half handles the rising
edge condition after 250-300us and the irq gets deasserted by the sensor 150-300ms
later without any other interaction from the driver.

which means that the time interval the trigger is asserted for can not be
controlled by the master (without tweaking the latch register).

2. there is no scenario in which an irq trigger that has been asserted before probe()
needs to be handled.

3. there is zero reason to handle one event multiple times.

these would be my reasons for gravitating toward edge triggering.

best regards,
peter