gpio-regulator.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # SPDX-License-Identifier: GPL-2.0
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/regulator/gpio-regulator.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: GPIO controlled regulators
  7. maintainers:
  8. - Liam Girdwood <lgirdwood@gmail.com>
  9. - Mark Brown <broonie@kernel.org>
  10. description:
  11. Any property defined as part of the core regulator binding, defined in
  12. regulator.txt, can also be used.
  13. allOf:
  14. - $ref: regulator.yaml#
  15. properties:
  16. compatible:
  17. const: regulator-gpio
  18. regulator-name: true
  19. enable-gpios:
  20. description: GPIO to use to enable/disable the regulator.
  21. Warning, the GPIO phandle flags are ignored and the GPIO polarity is
  22. controlled solely by the presence of "enable-active-high" DT property.
  23. This is due to compatibility with old DTs.
  24. maxItems: 1
  25. gpios:
  26. description: Array of one or more GPIO pins used to select the regulator
  27. voltage/current listed in "states".
  28. minItems: 1
  29. maxItems: 8 # Should be enough...
  30. gpios-states:
  31. description: |
  32. On operating systems, that don't support reading back gpio values in
  33. output mode (most notably linux), this array provides the state of GPIO
  34. pins set when requesting them from the gpio controller. Systems, that are
  35. capable of preserving state when requesting the lines, are free to ignore
  36. this property.
  37. 0: LOW
  38. 1: HIGH
  39. Default is LOW if nothing else is specified.
  40. $ref: /schemas/types.yaml#/definitions/uint32-array
  41. minItems: 1
  42. maxItems: 8
  43. items:
  44. enum: [0, 1]
  45. default: 0
  46. states:
  47. description: Selection of available voltages/currents provided by this
  48. regulator and matching GPIO configurations to achieve them. If there are
  49. no states in the "states" array, use a fixed regulator instead.
  50. $ref: /schemas/types.yaml#/definitions/uint32-matrix
  51. minItems: 2
  52. maxItems: 256
  53. items:
  54. items:
  55. - description: Voltage in microvolts
  56. - description: GPIO group state value
  57. startup-delay-us:
  58. description: startup time in microseconds
  59. enable-active-high:
  60. description: Polarity of "enable-gpio" GPIO is active HIGH. Default is
  61. active LOW.
  62. type: boolean
  63. gpio-open-drain:
  64. description:
  65. GPIO is open drain type. If this property is missing then default
  66. assumption is false.
  67. type: boolean
  68. regulator-type:
  69. description: Specifies what is being regulated.
  70. $ref: /schemas/types.yaml#/definitions/string
  71. enum:
  72. - voltage
  73. - current
  74. default: voltage
  75. vin-supply:
  76. description: Input supply phandle.
  77. required:
  78. - compatible
  79. - regulator-name
  80. - gpios
  81. - states
  82. unevaluatedProperties: false
  83. examples:
  84. - |
  85. gpio-regulator {
  86. compatible = "regulator-gpio";
  87. regulator-name = "mmci-gpio-supply";
  88. regulator-min-microvolt = <1800000>;
  89. regulator-max-microvolt = <2600000>;
  90. regulator-boot-on;
  91. enable-gpios = <&gpio0 23 0x4>;
  92. gpios = <&gpio0 24 0x4
  93. &gpio0 25 0x4>;
  94. states = <1800000 0x3>,
  95. <2200000 0x2>,
  96. <2600000 0x1>,
  97. <2900000 0x0>;
  98. startup-delay-us = <100000>;
  99. enable-active-high;
  100. };
  101. ...