mbox series

[v3,0/3] leds: aw2013: Document interrupt and pull-up supply

Message ID 20230815-aw2013-vio-v3-0-2505296b0856@gerhold.net
Headers show
Series leds: aw2013: Document interrupt and pull-up supply | expand

Message

Stephan Gerhold Aug. 15, 2023, 5:21 p.m. UTC
AW2013 has an optional interrupt pin "INTN" which is used to report 
completion of started operations (e.g. power up or LED breath effects). 
The driver does not use it (yet) but it should be already described for 
completeness inside the DT schema.

Since the interrupt and I2C lines operate in open drain low active mode 
a pull-up supply is needed for correct operation. Unfortunately there 
is no ideal place to describe it in the DT: The pull-up needed for the 
I2C lines could be described on the I2C bus. However, the pull-up 
needed for the interrupt line belongs neither directly to the interrupt 
controller nor to AW2013. Since the AW2013 driver will be typically in 
control of the power management and interrupt masking it makes more 
sense to describe it inside the AW2013 device tree node.

Changes in v3:
  - Rewrite commit messages based on discussion on v2
  - Also document missing interrupt in DT schema (new patch)

Discussion on v2:
https://lore.kernel.org/linux-leds/20230321220825.GA1685482-robh@kernel.org/

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
Lin, Meng-Bo (1):
      leds: aw2013: Enable pull-up supply for interrupt and I2C

Stephan Gerhold (2):
      dt-bindings: leds: aw2013: Document interrupt
      dt-bindings: leds: Document pull-up supply for interrupt and I2C

 .../devicetree/bindings/leds/leds-aw2013.yaml      | 13 ++++++++
 drivers/leds/leds-aw2013.c                         | 36 +++++++++++++---------
 2 files changed, 35 insertions(+), 14 deletions(-)
---
base-commit: 841165267827955bb3295b066cb6a906ba9265c0
change-id: 20230815-aw2013-vio-92a4566c5863

Best regards,

Comments

Krzysztof Kozlowski Aug. 15, 2023, 8:31 p.m. UTC | #1
On 15/08/2023 19:21, Stephan Gerhold wrote:
> Since the interrupt and I2C lines of AW2013 operate in open drain low
> active mode a pull-up supply is needed for correct operation.
> Unfortunately there is no ideal place to describe it in the DT: The
> pull-up needed for the I2C lines could be described on the I2C bus.
> However, the pull-up needed for the interrupt line belongs neither
> directly to the interrupt controller nor to AW2013. Since the AW2013
> driver will be typically in control of the power management and
> interrupt masking it makes more sense to describe it inside the AW2013
> device tree node.
> 
> Add it to the AW2013 DT schema together with a comment that makes it
> clear what exactly it represents.
> 

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Nikita Travkin Aug. 16, 2023, 5:38 a.m. UTC | #2
Stephan Gerhold писал(а) 15.08.2023 22:21:
> AW2013 has an optional interrupt pin "INTN" which is used to report 
> completion of started operations (e.g. power up or LED breath effects). 
> The driver does not use it (yet) but it should be already described for 
> completeness inside the DT schema.
> 
> Since the interrupt and I2C lines operate in open drain low active mode 
> a pull-up supply is needed for correct operation. Unfortunately there 
> is no ideal place to describe it in the DT: The pull-up needed for the 
> I2C lines could be described on the I2C bus. However, the pull-up 
> needed for the interrupt line belongs neither directly to the interrupt 
> controller nor to AW2013. Since the AW2013 driver will be typically in 
> control of the power management and interrupt masking it makes more 
> sense to describe it inside the AW2013 device tree node.
> 

Oh indeed, seems like even on the hardware I was initially targeting,
the pull is tied to a regulator, I probably missed it because it was
always on. Thank you both for adding that and fixing up the bindings!

Reviewed-by: Nikita Travkin <nikita@trvn.ru>

Nikita

> Changes in v3:
>   - Rewrite commit messages based on discussion on v2
>   - Also document missing interrupt in DT schema (new patch)
> 
> Discussion on v2:
> https://lore.kernel.org/linux-leds/20230321220825.GA1685482-robh@kernel.org/
> 
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> Lin, Meng-Bo (1):
>       leds: aw2013: Enable pull-up supply for interrupt and I2C
> 
> Stephan Gerhold (2):
>       dt-bindings: leds: aw2013: Document interrupt
>       dt-bindings: leds: Document pull-up supply for interrupt and I2C
> 
>  .../devicetree/bindings/leds/leds-aw2013.yaml      | 13 ++++++++
>  drivers/leds/leds-aw2013.c                         | 36 +++++++++++++---------
>  2 files changed, 35 insertions(+), 14 deletions(-)
> ---
> base-commit: 841165267827955bb3295b066cb6a906ba9265c0
> change-id: 20230815-aw2013-vio-92a4566c5863
> 
> Best regards,
Lee Jones Aug. 18, 2023, 3:47 p.m. UTC | #3
On Tue, 15 Aug 2023 19:21:03 +0200, Stephan Gerhold wrote:
> AW2013 has an optional interrupt pin "INTN" which is used to report
> completion of started operations (e.g. power up or LED breath effects).
> The driver does not use it (yet) but it should be already described for
> completeness inside the DT schema.
> 
> Since the interrupt and I2C lines operate in open drain low active mode
> a pull-up supply is needed for correct operation. Unfortunately there
> is no ideal place to describe it in the DT: The pull-up needed for the
> I2C lines could be described on the I2C bus. However, the pull-up
> needed for the interrupt line belongs neither directly to the interrupt
> controller nor to AW2013. Since the AW2013 driver will be typically in
> control of the power management and interrupt masking it makes more
> sense to describe it inside the AW2013 device tree node.
> 
> [...]

Applied, thanks!

[1/3] dt-bindings: leds: aw2013: Document interrupt
      commit: 9422bcf125b94e553c795af4f6c59d8e8fd8affa
[2/3] dt-bindings: leds: Document pull-up supply for interrupt and I2C
      commit: 2cccb179addedff6a5234e37237fc6b22d9217d4
[3/3] leds: aw2013: Enable pull-up supply for interrupt and I2C
      commit: baca986e1f2c31f8e4b2a6d99d47c3bc844033e8

--
Lee Jones [李琼斯]