gpio-mux.yaml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # SPDX-License-Identifier: GPL-2.0
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/mux/gpio-mux.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: GPIO-based multiplexer controller
  7. maintainers:
  8. - Peter Rosin <peda@axentia.se>
  9. description: |+
  10. Define what GPIO pins are used to control a multiplexer. Or several
  11. multiplexers, if the same pins control more than one multiplexer.
  12. The multiplexer state is defined as the number represented by the
  13. multiplexer GPIO pins, where the first pin is the least significant
  14. bit. An active pin is a binary 1, an inactive pin is a binary 0.
  15. properties:
  16. compatible:
  17. const: gpio-mux
  18. mux-gpios:
  19. description:
  20. List of gpios used to control the multiplexer, least significant bit first.
  21. '#mux-control-cells':
  22. enum: [ 0, 1 ]
  23. '#mux-state-cells':
  24. enum: [ 1, 2 ]
  25. idle-state:
  26. default: -1
  27. required:
  28. - compatible
  29. - mux-gpios
  30. anyOf:
  31. - required:
  32. - "#mux-control-cells"
  33. - required:
  34. - "#mux-state-cells"
  35. additionalProperties: false
  36. examples:
  37. - |
  38. #include <dt-bindings/gpio/gpio.h>
  39. mux: mux-controller {
  40. compatible = "gpio-mux";
  41. #mux-control-cells = <0>;
  42. mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
  43. <&pioA 1 GPIO_ACTIVE_HIGH>;
  44. };
  45. adc-mux {
  46. compatible = "io-channel-mux";
  47. io-channels = <&adc 0>;
  48. io-channel-names = "parent";
  49. mux-controls = <&mux>;
  50. channels = "sync-1", "in", "out", "sync-2";
  51. };
  52. i2c-mux {
  53. compatible = "i2c-mux";
  54. i2c-parent = <&i2c1>;
  55. mux-controls = <&mux>;
  56. #address-cells = <1>;
  57. #size-cells = <0>;
  58. i2c@0 {
  59. reg = <0>;
  60. #address-cells = <1>;
  61. #size-cells = <0>;
  62. ssd1307: oled@3c {
  63. reg = <0x3c>;
  64. };
  65. };
  66. i2c@3 {
  67. reg = <3>;
  68. #address-cells = <1>;
  69. #size-cells = <0>;
  70. pca9555: pca9555@20 {
  71. reg = <0x20>;
  72. };
  73. };
  74. };
  75. ...