0020-regulator-dt-bindings-Add-Allwinner-D1-LDOs.patch 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. From f666d95c1443854555044d3d4b52c463cf845ccc Mon Sep 17 00:00:00 2001
  2. From: Samuel Holland <[email protected]>
  3. Date: Sun, 17 Jul 2022 20:33:40 -0500
  4. Subject: [PATCH 020/117] regulator: dt-bindings: Add Allwinner D1 LDOs
  5. The Allwinner D1 SoC contains two pairs of in-package LDOs. One pair is
  6. for general purpose use. LDOA generally powers the board's 1.8 V rail.
  7. LDOB generally powers the in-package DRAM, where applicable.
  8. The other pair of LDOs powers the analog power domains inside the SoC,
  9. including the audio codec, thermal sensor, and ADCs. These LDOs require
  10. a 0.9 V bandgap voltage reference. The calibration value for the voltage
  11. reference is stored in an eFuse, accessed via an NVMEM cell.
  12. Neither LDO control register is in its own MMIO range; instead, each
  13. regulator device relies on a regmap/syscon exported by its parent.
  14. Series-changes: 2
  15. - Remove syscon property from bindings
  16. - Update binding examples to fix warnings and provide context
  17. Series-changes: 3
  18. - Add "reg" property to bindings
  19. - Add "unevaluatedProperties: true" to regulator nodes
  20. - Minor changes to regulator node name patterns
  21. - Remove system-ldos example (now added in patch 3)
  22. Series-changes: 4
  23. - Fix the order of the maintainer/description sections
  24. - Replace unevaluatedProperties with "additionalProperties: false"
  25. Signed-off-by: Samuel Holland <[email protected]>
  26. ---
  27. .../allwinner,sun20i-d1-analog-ldos.yaml | 74 +++++++++++++++++++
  28. .../allwinner,sun20i-d1-system-ldos.yaml | 37 ++++++++++
  29. 2 files changed, 111 insertions(+)
  30. create mode 100644 Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-analog-ldos.yaml
  31. create mode 100644 Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-system-ldos.yaml
  32. --- /dev/null
  33. +++ b/Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-analog-ldos.yaml
  34. @@ -0,0 +1,74 @@
  35. +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  36. +%YAML 1.2
  37. +---
  38. +$id: http://devicetree.org/schemas/regulator/allwinner,sun20i-d1-analog-ldos.yaml#
  39. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  40. +
  41. +title: Allwinner D1 Analog LDOs
  42. +
  43. +maintainers:
  44. + - Samuel Holland <[email protected]>
  45. +
  46. +description:
  47. + Allwinner D1 contains a set of LDOs which are designed to supply analog power
  48. + inside and outside the SoC. They are controlled by a register within the audio
  49. + codec MMIO space, but which is not part of the audio codec clock/reset domain.
  50. +
  51. +properties:
  52. + compatible:
  53. + enum:
  54. + - allwinner,sun20i-d1-analog-ldos
  55. +
  56. + reg:
  57. + maxItems: 1
  58. +
  59. + nvmem-cells:
  60. + items:
  61. + - description: NVMEM cell for the calibrated bandgap reference trim value
  62. +
  63. + nvmem-cell-names:
  64. + items:
  65. + - const: bg_trim
  66. +
  67. +patternProperties:
  68. + "^(a|hp)ldo$":
  69. + type: object
  70. + $ref: regulator.yaml#
  71. + unevaluatedProperties: false
  72. +
  73. +required:
  74. + - compatible
  75. + - reg
  76. + - nvmem-cells
  77. + - nvmem-cell-names
  78. +
  79. +additionalProperties: false
  80. +
  81. +examples:
  82. + - |
  83. + audio-codec@2030000 {
  84. + compatible = "simple-mfd", "syscon";
  85. + reg = <0x2030000 0x1000>;
  86. + ranges;
  87. + #address-cells = <1>;
  88. + #size-cells = <1>;
  89. +
  90. + regulators@2030348 {
  91. + compatible = "allwinner,sun20i-d1-analog-ldos";
  92. + reg = <0x2030348 0x4>;
  93. + nvmem-cells = <&bg_trim>;
  94. + nvmem-cell-names = "bg_trim";
  95. +
  96. + reg_aldo: aldo {
  97. + regulator-min-microvolt = <1800000>;
  98. + regulator-max-microvolt = <1800000>;
  99. + };
  100. +
  101. + reg_hpldo: hpldo {
  102. + regulator-min-microvolt = <1800000>;
  103. + regulator-max-microvolt = <1800000>;
  104. + };
  105. + };
  106. + };
  107. +
  108. +...
  109. --- /dev/null
  110. +++ b/Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-system-ldos.yaml
  111. @@ -0,0 +1,37 @@
  112. +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  113. +%YAML 1.2
  114. +---
  115. +$id: http://devicetree.org/schemas/regulator/allwinner,sun20i-d1-system-ldos.yaml#
  116. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  117. +
  118. +title: Allwinner D1 System LDOs
  119. +
  120. +maintainers:
  121. + - Samuel Holland <[email protected]>
  122. +
  123. +description:
  124. + Allwinner D1 contains a pair of general-purpose LDOs which are designed to
  125. + supply power inside and outside the SoC. They are controlled by a register
  126. + within the system control MMIO space.
  127. +
  128. +properties:
  129. + compatible:
  130. + enum:
  131. + - allwinner,sun20i-d1-system-ldos
  132. +
  133. + reg:
  134. + maxItems: 1
  135. +
  136. +patternProperties:
  137. + "^ldo[ab]$":
  138. + type: object
  139. + $ref: regulator.yaml#
  140. + unevaluatedProperties: false
  141. +
  142. +required:
  143. + - compatible
  144. + - reg
  145. +
  146. +additionalProperties: false
  147. +
  148. +...