i2c-mux-pinctrl.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Pinctrl-based I2C Bus Mux
  2. This binding describes an I2C bus multiplexer that uses pin multiplexing to
  3. route the I2C signals, and represents the pin multiplexing configuration
  4. using the pinctrl device tree bindings.
  5. +-----+ +-----+
  6. | dev | | dev |
  7. +------------------------+ +-----+ +-----+
  8. | SoC | | |
  9. | /----|------+--------+
  10. | +---+ +------+ | child bus A, on first set of pins
  11. | |I2C|---|Pinmux| |
  12. | +---+ +------+ | child bus B, on second set of pins
  13. | \----|------+--------+--------+
  14. | | | | |
  15. +------------------------+ +-----+ +-----+ +-----+
  16. | dev | | dev | | dev |
  17. +-----+ +-----+ +-----+
  18. Required properties:
  19. - compatible: i2c-mux-pinctrl
  20. - i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
  21. port is connected to.
  22. Also required are:
  23. * Standard pinctrl properties that specify the pin mux state for each child
  24. bus. See ../pinctrl/pinctrl-bindings.txt.
  25. * Standard I2C mux properties. See mux.txt in this directory.
  26. * I2C child bus nodes. See mux.txt in this directory.
  27. For each named state defined in the pinctrl-names property, an I2C child bus
  28. will be created. I2C child bus numbers are assigned based on the index into
  29. the pinctrl-names property.
  30. The only exception is that no bus will be created for a state named "idle". If
  31. such a state is defined, it must be the last entry in pinctrl-names. For
  32. example:
  33. pinctrl-names = "ddc", "pta", "idle" -> ddc = bus 0, pta = bus 1
  34. pinctrl-names = "ddc", "idle", "pta" -> Invalid ("idle" not last)
  35. pinctrl-names = "idle", "ddc", "pta" -> Invalid ("idle" not last)
  36. Whenever an access is made to a device on a child bus, the relevant pinctrl
  37. state will be programmed into hardware.
  38. If an idle state is defined, whenever an access is not being made to a device
  39. on a child bus, the idle pinctrl state will be programmed into hardware.
  40. If an idle state is not defined, the most recently used pinctrl state will be
  41. left programmed into hardware whenever no access is being made of a device on
  42. a child bus.
  43. Example:
  44. i2cmux {
  45. compatible = "i2c-mux-pinctrl";
  46. #address-cells = <1>;
  47. #size-cells = <0>;
  48. i2c-parent = <&i2c1>;
  49. pinctrl-names = "ddc", "pta", "idle";
  50. pinctrl-0 = <&state_i2cmux_ddc>;
  51. pinctrl-1 = <&state_i2cmux_pta>;
  52. pinctrl-2 = <&state_i2cmux_idle>;
  53. i2c@0 {
  54. reg = <0>;
  55. #address-cells = <1>;
  56. #size-cells = <0>;
  57. eeprom {
  58. compatible = "eeprom";
  59. reg = <0x50>;
  60. };
  61. };
  62. i2c@1 {
  63. reg = <1>;
  64. #address-cells = <1>;
  65. #size-cells = <0>;
  66. eeprom {
  67. compatible = "eeprom";
  68. reg = <0x50>;
  69. };
  70. };
  71. };