gpio-pcf857x.txt 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. * PCF857x-compatible I/O expanders
  2. The PCF857x-compatible chips have "quasi-bidirectional" I/O lines that can be
  3. driven high by a pull-up current source or driven low to ground. This combines
  4. the direction and output level into a single bit per line, which can't be read
  5. back. We can't actually know at initialization time whether a line is configured
  6. (a) as output and driving the signal low/high, or (b) as input and reporting a
  7. low/high value, without knowing the last value written since the chip came out
  8. of reset (if any). The only reliable solution for setting up line direction is
  9. thus to do it explicitly.
  10. Required Properties:
  11. - compatible: should be one of the following.
  12. - "maxim,max7328": For the Maxim MAX7378
  13. - "maxim,max7329": For the Maxim MAX7329
  14. - "nxp,pca8574": For the NXP PCA8574
  15. - "nxp,pca8575": For the NXP PCA8575
  16. - "nxp,pca9670": For the NXP PCA9670
  17. - "nxp,pca9671": For the NXP PCA9671
  18. - "nxp,pca9672": For the NXP PCA9672
  19. - "nxp,pca9673": For the NXP PCA9673
  20. - "nxp,pca9674": For the NXP PCA9674
  21. - "nxp,pca9675": For the NXP PCA9675
  22. - "nxp,pcf8574": For the NXP PCF8574
  23. - "nxp,pcf8574a": For the NXP PCF8574A
  24. - "nxp,pcf8575": For the NXP PCF8575
  25. - "ti,tca9554": For the TI TCA9554
  26. - reg: I2C slave address.
  27. - gpio-controller: Marks the device node as a gpio controller.
  28. - #gpio-cells: Should be 2. The first cell is the GPIO number and the second
  29. cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the
  30. GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
  31. Optional Properties:
  32. - lines-initial-states: Bitmask that specifies the initial state of each
  33. line. When a bit is set to zero, the corresponding line will be initialized to
  34. the input (pulled-up) state. When the bit is set to one, the line will be
  35. initialized the low-level output state. If the property is not specified
  36. all lines will be initialized to the input state.
  37. The I/O expander can detect input state changes, and thus optionally act as
  38. an interrupt controller. When the expander interrupt line is connected all the
  39. following properties must be set. For more information please see the
  40. interrupt controller device tree bindings documentation available at
  41. Documentation/devicetree/bindings/interrupt-controller/interrupts.txt.
  42. - interrupt-controller: Identifies the node as an interrupt controller.
  43. - #interrupt-cells: Number of cells to encode an interrupt source, shall be 2.
  44. - interrupt-parent: phandle of the parent interrupt controller.
  45. - interrupts: Interrupt specifier for the controllers interrupt.
  46. Please refer to gpio.txt in this directory for details of the common GPIO
  47. bindings used by client devices.
  48. Example: PCF8575 I/O expander node
  49. pcf8575: gpio@20 {
  50. compatible = "nxp,pcf8575";
  51. reg = <0x20>;
  52. interrupt-parent = <&irqpin2>;
  53. interrupts = <3 0>;
  54. gpio-controller;
  55. #gpio-cells = <2>;
  56. interrupt-controller;
  57. #interrupt-cells = <2>;
  58. };