maxim,max8997.yaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/regulator/maxim,max8997.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Maxim MAX8997 Power Management IC
  7. maintainers:
  8. - Krzysztof Kozlowski <krzk@kernel.org>
  9. description: |
  10. The Maxim MAX8997 is a Power Management IC which includes voltage and current
  11. regulators, charger controller with fuel gauge, RTC, clock outputs, haptic
  12. motor driver, flash LED driver and Micro-USB Interface Controller.
  13. The binding here is not complete and describes only regulator and charger
  14. controller parts.
  15. properties:
  16. compatible:
  17. const: maxim,max8997-pmic
  18. charger-supply:
  19. description: |
  20. Regulator node for charging current.
  21. interrupts:
  22. items:
  23. - description: irq1 interrupt
  24. - description: alert interrupt
  25. max8997,pmic-buck1-dvs-voltage:
  26. $ref: /schemas/types.yaml#/definitions/uint32-array
  27. minItems: 1
  28. maxItems: 8
  29. description: |
  30. A set of 8 voltage values in micro-volt (uV) units for buck1 when
  31. changing voltage using GPIO DVS.
  32. If none of max8997,pmic-buck[1/2/5]-uses-gpio-dvs optional property is
  33. specified, the max8997,pmic-buck[1/2/5]-dvs-voltage property should
  34. specify at least one voltage level (which would be a safe operating
  35. voltage).
  36. max8997,pmic-buck2-dvs-voltage:
  37. $ref: /schemas/types.yaml#/definitions/uint32-array
  38. minItems: 1
  39. maxItems: 8
  40. description: |
  41. A set of 8 voltage values in micro-volt (uV) units for buck2 when
  42. changing voltage using GPIO DVS.
  43. If none of max8997,pmic-buck[1/2/5]-uses-gpio-dvs optional property is
  44. specified, the max8997,pmic-buck[1/2/5]-dvs-voltage property should
  45. specify at least one voltage level (which would be a safe operating
  46. voltage).
  47. max8997,pmic-buck5-dvs-voltage:
  48. $ref: /schemas/types.yaml#/definitions/uint32-array
  49. minItems: 1
  50. maxItems: 8
  51. description: |
  52. A set of 8 voltage values in micro-volt (uV) units for buck5 when
  53. changing voltage using GPIO DVS.
  54. If none of max8997,pmic-buck[1/2/5]-uses-gpio-dvs optional property is
  55. specified, the max8997,pmic-buck[1/2/5]-dvs-voltage property should
  56. specify at least one voltage level (which would be a safe operating
  57. voltage).
  58. max8997,pmic-buck1-uses-gpio-dvs:
  59. type: boolean
  60. description: |
  61. buck1 can be controlled by GPIO DVS.
  62. max8997,pmic-buck2-uses-gpio-dvs:
  63. type: boolean
  64. description: |
  65. buck2 can be controlled by GPIO DVS.
  66. max8997,pmic-buck5-uses-gpio-dvs:
  67. type: boolean
  68. description: |
  69. buck5 can be controlled by GPIO DVS.
  70. max8997,pmic-buck125-default-dvs-idx:
  71. $ref: /schemas/types.yaml#/definitions/uint32
  72. minimum: 0
  73. maximum: 7
  74. default: 0
  75. description: |
  76. Default voltage setting selected from the possible 8 options selectable
  77. by the dvs gpios. The value of this property should be between 0 and 7.
  78. If not specified or if out of range, the default value of this property
  79. is set to 0.
  80. max8997,pmic-buck125-dvs-gpios:
  81. minItems: 3
  82. maxItems: 3
  83. description: |
  84. GPIO specifiers for three host gpio's used for DVS.
  85. max8997,pmic-ignore-gpiodvs-side-effect:
  86. type: boolean
  87. description: |
  88. When GPIO-DVS mode is used for multiple bucks, changing the voltage value
  89. of one of the bucks may affect that of another buck, which is the side
  90. effect of the change (set_voltage). Use this property to ignore such
  91. side effects and change the voltage.
  92. reg:
  93. maxItems: 1
  94. regulators:
  95. type: object
  96. additionalProperties: false
  97. description:
  98. List of child nodes that specify the regulators.
  99. patternProperties:
  100. # 1-18 and 21 LDOs
  101. "^LDO([1-9]|1[0-8]|21)$":
  102. type: object
  103. $ref: regulator.yaml#
  104. description:
  105. Properties for single LDO regulator.
  106. properties:
  107. regulator-name: true
  108. required:
  109. - regulator-name
  110. unevaluatedProperties: false
  111. # 7 bucks
  112. "^BUCK[1-7]$":
  113. type: object
  114. $ref: regulator.yaml#
  115. description:
  116. Properties for single BUCK regulator.
  117. properties:
  118. regulator-name: true
  119. required:
  120. - regulator-name
  121. unevaluatedProperties: false
  122. "^EN32KHZ_[AC]P$":
  123. type: object
  124. $ref: regulator.yaml#
  125. description:
  126. 32768 Hz clock output (modelled as regulator)
  127. properties:
  128. regulator-name: true
  129. regulator-always-on: true
  130. regulator-boot-on: true
  131. required:
  132. - regulator-name
  133. additionalProperties: false
  134. properties:
  135. CHARGER:
  136. type: object
  137. $ref: regulator.yaml#
  138. description: main battery charger current control
  139. properties:
  140. regulator-name: true
  141. required:
  142. - regulator-name
  143. unevaluatedProperties: false
  144. CHARGER_CV:
  145. type: object
  146. $ref: regulator.yaml#
  147. description: main battery charger voltage control
  148. properties:
  149. regulator-name: true
  150. required:
  151. - regulator-name
  152. unevaluatedProperties: false
  153. CHARGER_TOPOFF:
  154. type: object
  155. $ref: regulator.yaml#
  156. description: end of charge current threshold level
  157. properties:
  158. regulator-name: true
  159. required:
  160. - regulator-name
  161. unevaluatedProperties: false
  162. ENVICHG:
  163. type: object
  164. $ref: regulator.yaml#
  165. description: |
  166. Battery Charging Current Monitor Output. This is a fixed voltage type
  167. regulator
  168. properties:
  169. regulator-name: true
  170. required:
  171. - regulator-name
  172. unevaluatedProperties: false
  173. ESAFEOUT1:
  174. type: object
  175. $ref: regulator.yaml#
  176. description: LDO19
  177. properties:
  178. regulator-name: true
  179. required:
  180. - regulator-name
  181. unevaluatedProperties: false
  182. ESAFEOUT2:
  183. type: object
  184. $ref: regulator.yaml#
  185. description: LDO20
  186. properties:
  187. regulator-name: true
  188. required:
  189. - regulator-name
  190. unevaluatedProperties: false
  191. required:
  192. - compatible
  193. - max8997,pmic-buck1-dvs-voltage
  194. - max8997,pmic-buck2-dvs-voltage
  195. - max8997,pmic-buck5-dvs-voltage
  196. - reg
  197. - regulators
  198. dependencies:
  199. max8997,pmic-buck1-uses-gpio-dvs: [ 'max8997,pmic-buck125-dvs-gpios' ]
  200. max8997,pmic-buck2-uses-gpio-dvs: [ 'max8997,pmic-buck125-dvs-gpios' ]
  201. max8997,pmic-buck5-uses-gpio-dvs: [ 'max8997,pmic-buck125-dvs-gpios' ]
  202. additionalProperties: false
  203. if:
  204. anyOf:
  205. - required:
  206. - max8997,pmic-buck1-uses-gpio-dvs
  207. - required:
  208. - max8997,pmic-buck2-uses-gpio-dvs
  209. - required:
  210. - max8997,pmic-buck5-uses-gpio-dvs
  211. then:
  212. properties:
  213. max8997,pmic-buck1-dvs-voltage:
  214. minItems: 8
  215. maxItems: 8
  216. max8997,pmic-buck2-dvs-voltage:
  217. minItems: 8
  218. maxItems: 8
  219. max8997,pmic-buck5-dvs-voltage:
  220. minItems: 8
  221. maxItems: 8
  222. examples:
  223. - |
  224. #include <dt-bindings/gpio/gpio.h>
  225. #include <dt-bindings/interrupt-controller/irq.h>
  226. i2c {
  227. #address-cells = <1>;
  228. #size-cells = <0>;
  229. pmic@66 {
  230. compatible = "maxim,max8997-pmic";
  231. reg = <0x66>;
  232. interrupts-extended = <&gpx0 7 IRQ_TYPE_LEVEL_LOW>,
  233. <&gpx2 3 IRQ_TYPE_EDGE_FALLING>;
  234. max8997,pmic-buck1-uses-gpio-dvs;
  235. max8997,pmic-buck2-uses-gpio-dvs;
  236. max8997,pmic-buck5-uses-gpio-dvs;
  237. max8997,pmic-ignore-gpiodvs-side-effect;
  238. max8997,pmic-buck125-default-dvs-idx = <0>;
  239. max8997,pmic-buck125-dvs-gpios = <&gpx0 5 GPIO_ACTIVE_HIGH>,
  240. <&gpx0 6 GPIO_ACTIVE_HIGH>,
  241. <&gpl0 0 GPIO_ACTIVE_HIGH>;
  242. max8997,pmic-buck1-dvs-voltage = <1350000>, <1300000>,
  243. <1250000>, <1200000>,
  244. <1150000>, <1100000>,
  245. <1000000>, <950000>;
  246. max8997,pmic-buck2-dvs-voltage = <1100000>, <1000000>,
  247. <950000>, <900000>,
  248. <1100000>, <1000000>,
  249. <950000>, <900000>;
  250. max8997,pmic-buck5-dvs-voltage = <1200000>, <1200000>,
  251. <1200000>, <1200000>,
  252. <1200000>, <1200000>,
  253. <1200000>, <1200000>;
  254. pinctrl-0 = <&max8997_irq>, <&otg_gp>, <&usb_sel>;
  255. pinctrl-names = "default";
  256. charger-supply = <&charger_reg>;
  257. regulators {
  258. LDO1 {
  259. regulator-name = "VADC_3.3V_C210";
  260. regulator-min-microvolt = <3300000>;
  261. regulator-max-microvolt = <3300000>;
  262. regulator-always-on;
  263. };
  264. LDO2 {
  265. regulator-name = "VALIVE_1.1V_C210";
  266. regulator-min-microvolt = <1100000>;
  267. regulator-max-microvolt = <1100000>;
  268. regulator-always-on;
  269. };
  270. BUCK1 {
  271. regulator-name = "VARM_1.2V_C210";
  272. regulator-min-microvolt = <65000>;
  273. regulator-max-microvolt = <2225000>;
  274. regulator-always-on;
  275. };
  276. // ...
  277. BUCK7 {
  278. regulator-name = "VCC_SUB_2.0V";
  279. regulator-min-microvolt = <2000000>;
  280. regulator-max-microvolt = <2000000>;
  281. regulator-always-on;
  282. };
  283. ESAFEOUT1 {
  284. regulator-name = "SAFEOUT1";
  285. };
  286. ESAFEOUT2 {
  287. regulator-name = "SAFEOUT2";
  288. regulator-boot-on;
  289. };
  290. EN32KHZ_AP {
  291. regulator-name = "EN32KHZ_AP";
  292. regulator-always-on;
  293. };
  294. EN32KHZ_CP {
  295. regulator-name = "EN32KHZ_CP";
  296. regulator-always-on;
  297. };
  298. CHARGER {
  299. regulator-name = "CHARGER";
  300. regulator-min-microamp = <200000>;
  301. regulator-max-microamp = <950000>;
  302. };
  303. CHARGER_CV {
  304. regulator-name = "CHARGER_CV";
  305. regulator-min-microvolt = <4200000>;
  306. regulator-max-microvolt = <4200000>;
  307. regulator-always-on;
  308. };
  309. CHARGER_TOPOFF {
  310. regulator-name = "CHARGER_TOPOFF";
  311. regulator-min-microamp = <200000>;
  312. regulator-max-microamp = <200000>;
  313. regulator-always-on;
  314. };
  315. };
  316. };
  317. };
  318. - |
  319. #include <dt-bindings/interrupt-controller/irq.h>
  320. i2c {
  321. #address-cells = <1>;
  322. #size-cells = <0>;
  323. pmic@66 {
  324. compatible = "maxim,max8997-pmic";
  325. reg = <0x66>;
  326. interrupt-parent = <&gpx0>;
  327. interrupts = <4 IRQ_TYPE_LEVEL_LOW>,
  328. <3 IRQ_TYPE_EDGE_FALLING>;
  329. pinctrl-names = "default";
  330. pinctrl-0 = <&max8997_irq>;
  331. max8997,pmic-buck1-dvs-voltage = <1350000>;
  332. max8997,pmic-buck2-dvs-voltage = <1100000>;
  333. max8997,pmic-buck5-dvs-voltage = <1200000>;
  334. regulators {
  335. LDO1 {
  336. regulator-name = "VDD_ABB_3.3V";
  337. regulator-min-microvolt = <3300000>;
  338. regulator-max-microvolt = <3300000>;
  339. };
  340. // ...
  341. BUCK1 {
  342. regulator-name = "VDD_ARM_1.2V";
  343. regulator-min-microvolt = <950000>;
  344. regulator-max-microvolt = <1350000>;
  345. regulator-always-on;
  346. regulator-boot-on;
  347. };
  348. // ...
  349. EN32KHZ_AP {
  350. regulator-name = "EN32KHZ_AP";
  351. regulator-always-on;
  352. };
  353. };
  354. };
  355. };