[PATCH v6 3/7] dt-bindings: iio: accel: adxl345: add interrupt-names

Lothar Rubusch posted 7 patches 1 year ago
There is a newer version of this series
[PATCH v6 3/7] dt-bindings: iio: accel: adxl345: add interrupt-names
Posted by Lothar Rubusch 1 year ago
Add interrupt-names INT1 and INT2 for the two interrupt lines of the
sensor. Only one line will be connected for incoming events. The driver
needs to be configured accordingly. If no interrupt line is set up, the
sensor will fall back to FIFO bypass mode and still measure, but no
interrupt based events are possible.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
---
 .../devicetree/bindings/iio/accel/adi,adxl345.yaml          | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
index 280ed479e..0fe878473 100644
--- a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
+++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
@@ -37,6 +37,10 @@ properties:
   interrupts:
     maxItems: 1
 
+  interrupt-names:
+    items:
+      - enum: [INT1, INT2]
+
 required:
   - compatible
   - reg
@@ -61,6 +65,7 @@ examples:
             reg = <0x2a>;
             interrupt-parent = <&gpio0>;
             interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+            interrupt-names = "INT1";
         };
     };
   - |
@@ -79,5 +84,6 @@ examples:
             spi-cpha;
             interrupt-parent = <&gpio0>;
             interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+            interrupt-names = "INT2";
         };
     };
-- 
2.39.5
Re: [PATCH v6 3/7] dt-bindings: iio: accel: adxl345: add interrupt-names
Posted by Jonathan Cameron 1 year ago
On Wed, 11 Dec 2024 23:06:44 +0000
Lothar Rubusch <l.rubusch@gmail.com> wrote:

> Add interrupt-names INT1 and INT2 for the two interrupt lines of the
> sensor. Only one line will be connected for incoming events. The driver
> needs to be configured accordingly. If no interrupt line is set up, the
> sensor will fall back to FIFO bypass mode and still measure, but no
> interrupt based events are possible.
> 
> Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Given discussion in mostly here rather than next version...

> ---
>  .../devicetree/bindings/iio/accel/adi,adxl345.yaml          | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> index 280ed479e..0fe878473 100644
> --- a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> @@ -37,6 +37,10 @@ properties:
>    interrupts:
>      maxItems: 1
>  
> +  interrupt-names:
> +    items:
> +      - enum: [INT1, INT2]

Can we add a default for INT1 only?
That would the incorporate a single provided interrupt and 'probably'
not break any existing DT that is out there.

> +
>  required:
>    - compatible
>    - reg
> @@ -61,6 +65,7 @@ examples:
>              reg = <0x2a>;
>              interrupt-parent = <&gpio0>;
>              interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> +            interrupt-names = "INT1";
>          };
>      };
>    - |
> @@ -79,5 +84,6 @@ examples:
>              spi-cpha;
>              interrupt-parent = <&gpio0>;
>              interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> +            interrupt-names = "INT2";
>          };
>      };
Re: [PATCH v6 3/7] dt-bindings: iio: accel: adxl345: add interrupt-names
Posted by Krzysztof Kozlowski 1 year ago
On Wed, Dec 11, 2024 at 11:06:44PM +0000, Lothar Rubusch wrote:
> Add interrupt-names INT1 and INT2 for the two interrupt lines of the
> sensor. Only one line will be connected for incoming events. The driver
> needs to be configured accordingly. If no interrupt line is set up, the
> sensor will fall back to FIFO bypass mode and still measure, but no
> interrupt based events are possible.

There was interrupt before and it was required, so I do not understand
last statement. You describe case which is impossible.

Best regards,
Krzysztof
Re: [PATCH v6 3/7] dt-bindings: iio: accel: adxl345: add interrupt-names
Posted by Jonathan Cameron 1 year ago
On Thu, 12 Dec 2024 09:08:22 +0100
Krzysztof Kozlowski <krzk@kernel.org> wrote:

> On Wed, Dec 11, 2024 at 11:06:44PM +0000, Lothar Rubusch wrote:
> > Add interrupt-names INT1 and INT2 for the two interrupt lines of the
> > sensor. Only one line will be connected for incoming events. The driver
> > needs to be configured accordingly.
This is all driver info.  This patch description just needs to say something
like:
"
There are two interrupt lines that may be connected. As the device can
route each type of interrupt to one or other of those lines, interrupt-names
is necessary for two reasons.

- One interrupt line is connected, the device has to be configured to send
  interrupts to that line.
- Two interrupt lines connected.  The device can route all interrupts to 
  one line or elect to split them up.

If no interrupt lines are connected, device functionality may be restricted.
"

Note as below, the required interrupts entry should be removed in a precursor
patch.

> If no interrupt line is set up, the
> > sensor will fall back to FIFO bypass mode and still measure, but no
> > interrupt based events are possible.  
> 
> There was interrupt before and it was required, so I do not understand
> last statement. You describe case which is impossible.

Binding was wrong. Interrupt isn't required for quite a bit of the functionality.

I'd like to see an earlier patch removing that required entry and explaining
why rather than jumping into adding the new interrupt-names part without
resolving that.  Its a relaxation of constraints so probably no need to backport
that patch.

Jonathan


> 
> Best regards,
> Krzysztof
>