mbox series

[RFC,0/2] i2c: rcar: add SMBAlert support

Message ID 20240826150840.25497-4-wsa+renesas@sang-engineering.com
Headers show
Series i2c: rcar: add SMBAlert support | expand

Message

Wolfram Sang Aug. 26, 2024, 3:08 p.m. UTC
This series allows an R-Car I2C IP core to handle SMBAlerts using a
GPIO. It was tested on a Renesas Lager board (R-Car H2) and the bindings
were checked with 'dtbs_check' and the latest dtschema which also
include SMBAlert additions[1].

The series is still marked RFC because I have one question left, see the
annotations of patch 1.

Looking forward to comments! Happy hacking...

[1] https://github.com/devicetree-org/dt-schema/commit/c51125d571cac9596048e888a856d70650e400e0


Wolfram Sang (2):
  dt-bindings: i2c: renesas,rcar-i2c: document SMBusAlert usage
  i2c: rcar: support named interrupts

 .../bindings/i2c/renesas,rcar-i2c.yaml         | 18 ++++++++++++++++--
 drivers/i2c/busses/i2c-rcar.c                  | 11 +++++++----
 2 files changed, 23 insertions(+), 6 deletions(-)

Comments

Krzysztof Kozlowski Aug. 27, 2024, 6:41 a.m. UTC | #1
On Mon, Aug 26, 2024 at 05:08:42PM +0200, Wolfram Sang wrote:
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> Question: Should I remove 'smbus_alert' from the enum of
> 'interrupt-names'? It is already documented here:
> 
> https://github.com/devicetree-org/dt-schema/commit/c51125d571cac9596048e888a856d70650e400e0

No, because dtschema is not specific there and allows any combination,
while device bindings should make it constrained.

> 
> 
>  .../bindings/i2c/renesas,rcar-i2c.yaml         | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/renesas,rcar-i2c.yaml b/Documentation/devicetree/bindings/i2c/renesas,rcar-i2c.yaml
> index 6cc60c3f61cd..2eed3ae7c57d 100644
> --- a/Documentation/devicetree/bindings/i2c/renesas,rcar-i2c.yaml
> +++ b/Documentation/devicetree/bindings/i2c/renesas,rcar-i2c.yaml
> @@ -60,7 +60,20 @@ properties:
>      maxItems: 1
>  
>    interrupts:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 2
> +    description:
> +      Without interrupt-names, the first interrupt listed must be the one
> +      of the IP core, the second optional interrupt listed must handle
> +      SMBALERT#, likely a GPIO.

With interrupt-names the same... unless you want to allow anything? No
clue what is being fixed here, no commit msg. Which interrupts are
flexible? Why main can be skipped suddenly (or was it always)?

> +
> +  interrupt-names:
> +    minItems: 1
> +    maxItems: 2
> +    items:
> +      enum:
> +        - main
> +        - smbus_alert

Best regards,
Krzysztof