Commit b28037d4 authored by Quentin Schulz's avatar Quentin Schulz Committed by Bartosz Golaszewski
Browse files

dt-bindings: gpio: nxp,pcf8575: add reset GPIO

A few of the I2C GPIO expander chips supported by this binding have a
RESETN pin to be able to reset the chip. The chip is held in reset while
the pin is low, therefore the polarity of reset-gpios is expected to
reflect that, i.e. a GPIO_ACTIVE_HIGH means the GPIO will be driven high
for reset and then driven low, GPIO_ACTIVE_LOW means the GPIO will be
driven low for reset and then driven high. If a GPIO is directly routed
to RESETN pin on the IC without any inverter, GPIO_ACTIVE_LOW is thus
expected.

Out of the supported chips, only PCA9670, PCA9671, PCA9672 and PCA9673
show a RESETN pin in their datasheets. They all share the same reset
timings, that is 4+us reset pulse[0] and 100+us reset time[0].

When performing a reset, "The PCA9670 registers and I2C-bus state
machine will be held in their default state until the RESET input is
once again HIGH."[1] meaning we now know the state of each line
controlled by the GPIO expander. Therefore, setting lines-initial-states
and reset-gpios both does not make sense and their presence is XOR'ed.

[0] https://www.nxp.com/docs/en/data-sheet/PCA9670.pdf Fig 22.
[1] https://www.nxp.com/docs/en/data-sheet/PCA9670.pdf

 8.5

Tested-by: Heiko Stuebner <heiko@sntech.de> # exclusion logic
Acked-by: default avatarConor Dooley <conor.dooley@microchip.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarQuentin Schulz <quentin.schulz@cherry.de>
Link: https://lore.kernel.org/r/20250224-pca976x-reset-driver-v3-1-58370ef405be@cherry.de


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 9080b5d1
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -73,6 +73,43 @@ properties:

  wakeup-source: true

  reset-gpios:
    maxItems: 1
    description:
      GPIO controlling the (reset active LOW) RESET# pin.

      The active polarity of the GPIO must translate to the low state of the
      RESET# pin on the IC, i.e. if a GPIO is directly routed to the RESET# pin
      without any inverter, GPIO_ACTIVE_LOW is expected.

      Performing a reset makes all lines initialized to their input (pulled-up)
      state.

allOf:
  - if:
      properties:
        compatible:
          not:
            contains:
              enum:
                - nxp,pca9670
                - nxp,pca9671
                - nxp,pca9672
                - nxp,pca9673
    then:
      properties:
        reset-gpios: false

  # lines-initial-states XOR reset-gpios
  # Performing a reset reinitializes all lines to a known state which
  # may not match passed lines-initial-states
  - if:
      required:
        - lines-initial-states
    then:
      properties:
        reset-gpios: false

patternProperties:
  "^(.+-hog(-[0-9]+)?)$":
    type: object