i2c-gpio.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Device-Tree bindings for i2c gpio driver
  2. Required properties:
  3. - compatible = "i2c-gpio";
  4. - sda-gpios: gpio used for the sda signal, this should be flagged as
  5. active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)
  6. from <dt-bindings/gpio/gpio.h> since the signal is by definition
  7. open drain.
  8. - scl-gpios: gpio used for the scl signal, this should be flagged as
  9. active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)
  10. from <dt-bindings/gpio/gpio.h> since the signal is by definition
  11. open drain.
  12. Optional properties:
  13. - i2c-gpio,scl-output-only: scl as output only
  14. - i2c-gpio,delay-us: delay between GPIO operations (may depend on each platform)
  15. - i2c-gpio,timeout-ms: timeout to get data
  16. Deprecated properties, do not use in new device tree sources:
  17. - gpios: sda and scl gpio, alternative for {sda,scl}-gpios
  18. - i2c-gpio,sda-open-drain: this means that something outside of our
  19. control has put the GPIO line used for SDA into open drain mode, and
  20. that something is not the GPIO chip. It is essentially an
  21. inconsistency flag.
  22. - i2c-gpio,scl-open-drain: this means that something outside of our
  23. control has put the GPIO line used for SCL into open drain mode, and
  24. that something is not the GPIO chip. It is essentially an
  25. inconsistency flag.
  26. Example nodes:
  27. #include <dt-bindings/gpio/gpio.h>
  28. i2c@0 {
  29. compatible = "i2c-gpio";
  30. sda-gpios = <&pioA 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
  31. scl-gpios = <&pioA 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
  32. i2c-gpio,delay-us = <2>; /* ~100 kHz */
  33. #address-cells = <1>;
  34. #size-cells = <0>;
  35. rv3029c2@56 {
  36. compatible = "rv3029c2";
  37. reg = <0x56>;
  38. };
  39. };