i2c-mux-pinctrl.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/i2c/i2c-mux-pinctrl.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Pinctrl-based I2C Bus Mux
  7. maintainers:
  8. - Wolfram Sang <wsa@kernel.org>
  9. description: |
  10. This binding describes an I2C bus multiplexer that uses pin multiplexing to route the I2C
  11. signals, and represents the pin multiplexing configuration using the pinctrl device tree
  12. bindings.
  13. +-----+ +-----+
  14. | dev | | dev |
  15. +------------------------+ +-----+ +-----+
  16. | SoC | | |
  17. | /----|------+--------+
  18. | +---+ +------+ | child bus A, on first set of pins
  19. | |I2C|---|Pinmux| |
  20. | +---+ +------+ | child bus B, on second set of pins
  21. | \----|------+--------+--------+
  22. | | | | |
  23. +------------------------+ +-----+ +-----+ +-----+
  24. | dev | | dev | | dev |
  25. +-----+ +-----+ +-----+
  26. For each named state defined in the pinctrl-names property, an I2C child bus will be created.
  27. I2C child bus numbers are assigned based on the index into the pinctrl-names property.
  28. The only exception is that no bus will be created for a state named "idle". If such a state is
  29. defined, it must be the last entry in pinctrl-names. For example:
  30. pinctrl-names = "ddc", "pta", "idle" -> ddc = bus 0, pta = bus 1
  31. pinctrl-names = "ddc", "idle", "pta" -> Invalid ("idle" not last)
  32. pinctrl-names = "idle", "ddc", "pta" -> Invalid ("idle" not last)
  33. Whenever an access is made to a device on a child bus, the relevant pinctrl state will be
  34. programmed into hardware.
  35. If an idle state is defined, whenever an access is not being made to a device on a child bus,
  36. the idle pinctrl state will be programmed into hardware.
  37. If an idle state is not defined, the most recently used pinctrl state will be left programmed
  38. into hardware whenever no access is being made of a device on a child bus.
  39. properties:
  40. compatible:
  41. const: i2c-mux-pinctrl
  42. i2c-parent:
  43. $ref: /schemas/types.yaml#/definitions/phandle
  44. description: The phandle of the I2C bus that this multiplexer's master-side port is connected
  45. to.
  46. allOf:
  47. - $ref: i2c-mux.yaml
  48. unevaluatedProperties: false
  49. required:
  50. - compatible
  51. - i2c-parent
  52. examples:
  53. - |
  54. i2cmux {
  55. compatible = "i2c-mux-pinctrl";
  56. #address-cells = <1>;
  57. #size-cells = <0>;
  58. i2c-parent = <&i2c1>;
  59. pinctrl-names = "ddc", "pta", "idle";
  60. pinctrl-0 = <&state_i2cmux_ddc>;
  61. pinctrl-1 = <&state_i2cmux_pta>;
  62. pinctrl-2 = <&state_i2cmux_idle>;
  63. i2c@0 {
  64. reg = <0>;
  65. #address-cells = <1>;
  66. #size-cells = <0>;
  67. eeprom@50 {
  68. compatible = "atmel,24c02";
  69. reg = <0x50>;
  70. };
  71. };
  72. i2c@1 {
  73. reg = <1>;
  74. #address-cells = <1>;
  75. #size-cells = <0>;
  76. eeprom@50 {
  77. compatible = "atmel,24c02";
  78. reg = <0x50>;
  79. };
  80. };
  81. };