qcom,spmi-pmic.yaml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/mfd/qcom,spmi-pmic.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Qualcomm SPMI PMICs multi-function device
  7. description: |
  8. Some Qualcomm PMICs used with the Snapdragon series SoCs are interfaced
  9. to the chip via the SPMI (System Power Management Interface) bus.
  10. Support for multiple independent functions are implemented by splitting the
  11. 16-bit SPMI peripheral address space into 256 smaller fixed-size regions, 256 bytes
  12. each. A function can consume one or more of these fixed-size register regions.
  13. The Qualcomm SPMI series includes the PM8941, PM8841, PMA8084, PM8998 and other
  14. PMICs. These PMICs use a "QPNP" scheme through SPMI interface.
  15. QPNP is effectively a partitioning scheme for dividing the SPMI extended
  16. register space up into logical pieces, and set of fixed register
  17. locations/definitions within these regions, with some of these regions
  18. specifically used for interrupt handling.
  19. maintainers:
  20. - Stephen Boyd <sboyd@kernel.org>
  21. properties:
  22. $nodename:
  23. oneOf:
  24. - pattern: '^pmic@.*$'
  25. - pattern: '^pm(a|s)?[0-9]*@.*$'
  26. deprecated: true
  27. compatible:
  28. items:
  29. - enum:
  30. - qcom,pm2250
  31. - qcom,pm6125
  32. - qcom,pm6150
  33. - qcom,pm6150l
  34. - qcom,pm6350
  35. - qcom,pm660
  36. - qcom,pm660l
  37. - qcom,pm7250b
  38. - qcom,pm7550ba
  39. - qcom,pm7325
  40. - qcom,pm7550
  41. - qcom,pm8004
  42. - qcom,pm8005
  43. - qcom,pm8009
  44. - qcom,pm8010
  45. - qcom,pm8019
  46. - qcom,pm8028
  47. - qcom,pm8110
  48. - qcom,pm8150
  49. - qcom,pm8150b
  50. - qcom,pm8150c
  51. - qcom,pm8150l
  52. - qcom,pm8226
  53. - qcom,pm8350
  54. - qcom,pm8350b
  55. - qcom,pm8350c
  56. - qcom,pm8450
  57. - qcom,pm8550
  58. - qcom,pm8550b
  59. - qcom,pm8550ve
  60. - qcom,pm8550vs
  61. - qcom,pm8841
  62. - qcom,pm8909
  63. - qcom,pm8916
  64. - qcom,pm8937
  65. - qcom,pm8941
  66. - qcom,pm8950
  67. - qcom,pm8953
  68. - qcom,pm8994
  69. - qcom,pm8998
  70. - qcom,pma8084
  71. - qcom,pmc8180
  72. - qcom,pmc8180c
  73. - qcom,pmc8380
  74. - qcom,pmcx0102
  75. - qcom,pmd8028
  76. - qcom,pmd9635
  77. - qcom,pmh0101
  78. - qcom,pmh0104
  79. - qcom,pmh0110
  80. - qcom,pmi632
  81. - qcom,pmi8950
  82. - qcom,pmi8962
  83. - qcom,pmi8994
  84. - qcom,pmi8998
  85. - qcom,pmih0108
  86. - qcom,pmiv0104
  87. - qcom,pmk8002
  88. - qcom,pmk8350
  89. - qcom,pmk8550
  90. - qcom,pmk8850
  91. - qcom,pmm8155au
  92. - qcom,pmm8654au
  93. - qcom,pmp8074
  94. - qcom,pmr735a
  95. - qcom,pmr735b
  96. - qcom,pmr735d
  97. - qcom,pms405
  98. - qcom,pmx55
  99. - qcom,pmx65
  100. - qcom,pmx75
  101. - qcom,smb2351
  102. - qcom,smb2360
  103. - qcom,smb2370
  104. - const: qcom,spmi-pmic
  105. reg:
  106. minItems: 1
  107. maxItems: 2
  108. '#address-cells':
  109. const: 1
  110. '#size-cells':
  111. const: 0
  112. labibb:
  113. type: object
  114. $ref: /schemas/regulator/qcom-labibb-regulator.yaml#
  115. regulators:
  116. type: object
  117. $ref: /schemas/regulator/qcom,spmi-regulator.yaml#
  118. pwm:
  119. type: object
  120. $ref: /schemas/leds/leds-qcom-lpg.yaml#
  121. patternProperties:
  122. "^adc@[0-9a-f]+$":
  123. type: object
  124. oneOf:
  125. - $ref: /schemas/iio/adc/qcom,spmi-iadc.yaml#
  126. - $ref: /schemas/iio/adc/qcom,spmi-rradc.yaml#
  127. - $ref: /schemas/iio/adc/qcom,spmi-vadc.yaml#
  128. "^adc-tm@[0-9a-f]+$":
  129. type: object
  130. # ref depends on compatible, see allOf below
  131. "^audio-codec@[0-9a-f]+$":
  132. type: object
  133. $ref: /schemas/sound/qcom,pm8916-wcd-analog-codec.yaml#
  134. "^battery@[0-9a-f]+$":
  135. type: object
  136. oneOf:
  137. - $ref: /schemas/power/supply/qcom,pm8916-bms-vm.yaml#
  138. "^charger@[0-9a-f]+$":
  139. type: object
  140. oneOf:
  141. - $ref: /schemas/power/supply/qcom,pm8916-lbc.yaml#
  142. - $ref: /schemas/power/supply/qcom,pm8941-charger.yaml#
  143. - $ref: /schemas/power/supply/qcom,pm8941-coincell.yaml#
  144. - $ref: /schemas/power/supply/qcom,pmi8998-charger.yaml#
  145. "gpio@[0-9a-f]+$":
  146. type: object
  147. $ref: /schemas/pinctrl/qcom,pmic-gpio.yaml#
  148. "^led-controller@[0-9a-f]+$":
  149. type: object
  150. $ref: /schemas/leds/qcom,spmi-flash-led.yaml#
  151. "^nvram@[0-9a-f]+$":
  152. type: object
  153. $ref: /schemas/nvmem/qcom,spmi-sdam.yaml#
  154. "^pbs@[0-9a-f]+$":
  155. type: object
  156. $ref: /schemas/soc/qcom/qcom,pbs.yaml#
  157. "phy@[0-9a-f]+$":
  158. type: object
  159. $ref: /schemas/phy/qcom,snps-eusb2-repeater.yaml#
  160. "pon@[0-9a-f]+$":
  161. type: object
  162. $ref: /schemas/power/reset/qcom,pon.yaml#
  163. "^rtc@[0-9a-f]+$":
  164. type: object
  165. $ref: /schemas/rtc/qcom-pm8xxx-rtc.yaml#
  166. "^temp-alarm@[0-9a-f]+$":
  167. type: object
  168. $ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml#
  169. "^typec@[0-9a-f]+$":
  170. type: object
  171. $ref: /schemas/usb/qcom,pmic-typec.yaml#
  172. "^usb-detect@[0-9a-f]+$":
  173. type: object
  174. $ref: /schemas/extcon/qcom,pm8941-misc.yaml#
  175. "^usb-vbus-regulator@[0-9a-f]+$":
  176. type: object
  177. $ref: /schemas/regulator/qcom,usb-vbus-regulator.yaml#
  178. "^vibrator@[0-9a-f]+$":
  179. type: object
  180. $ref: /schemas/input/qcom,pm8xxx-vib.yaml#
  181. "^mpps@[0-9a-f]+$":
  182. type: object
  183. $ref: /schemas/pinctrl/qcom,pmic-mpp.yaml#
  184. "(.*)?(wled|leds)@[0-9a-f]+$":
  185. type: object
  186. $ref: /schemas/leds/backlight/qcom-wled.yaml#
  187. unevaluatedProperties: false
  188. required:
  189. - compatible
  190. - reg
  191. allOf:
  192. - if:
  193. properties:
  194. compatible:
  195. contains:
  196. enum:
  197. - qcom,pm8998
  198. then:
  199. patternProperties:
  200. "^adc-tm@[0-9a-f]+$":
  201. $ref: /schemas/thermal/qcom-spmi-adc-tm-hc.yaml#
  202. else:
  203. patternProperties:
  204. "^adc-tm@[0-9a-f]+$":
  205. $ref: /schemas/thermal/qcom-spmi-adc-tm5.yaml#
  206. additionalProperties: false
  207. examples:
  208. - |
  209. #include <dt-bindings/spmi/spmi.h>
  210. #include <dt-bindings/interrupt-controller/irq.h>
  211. #include <dt-bindings/interrupt-controller/arm-gic.h>
  212. spmi@c440000 {
  213. compatible = "qcom,spmi-pmic-arb";
  214. reg = <0x0c440000 0x1100>,
  215. <0x0c600000 0x2000000>,
  216. <0x0e600000 0x100000>,
  217. <0x0e700000 0xa0000>,
  218. <0x0c40a000 0x26000>;
  219. reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
  220. interrupt-names = "periph_irq";
  221. interrupts = <GIC_SPI 481 IRQ_TYPE_LEVEL_HIGH>;
  222. qcom,ee = <0>;
  223. qcom,channel = <0>;
  224. #address-cells = <2>;
  225. #size-cells = <0>;
  226. interrupt-controller;
  227. #interrupt-cells = <4>;
  228. pmic@2 {
  229. compatible = "qcom,pmi8998", "qcom,spmi-pmic";
  230. reg = <0x2 SPMI_USID>;
  231. #address-cells = <1>;
  232. #size-cells = <0>;
  233. gpio@c000 {
  234. compatible = "qcom,pmi8998-gpio", "qcom,spmi-gpio";
  235. reg = <0xc000>;
  236. gpio-controller;
  237. gpio-ranges = <&pmi8998_gpio 0 0 14>;
  238. #gpio-cells = <2>;
  239. interrupt-controller;
  240. #interrupt-cells = <2>;
  241. };
  242. };
  243. };
  244. - |
  245. #include <dt-bindings/input/input.h>
  246. #include <dt-bindings/interrupt-controller/irq.h>
  247. #include <dt-bindings/interrupt-controller/arm-gic.h>
  248. #include <dt-bindings/iio/qcom,spmi-vadc.h>
  249. #include <dt-bindings/spmi/spmi.h>
  250. pmic@0 {
  251. compatible = "qcom,pm6150", "qcom,spmi-pmic";
  252. reg = <0x0 SPMI_USID>;
  253. #address-cells = <1>;
  254. #size-cells = <0>;
  255. pon@800 {
  256. compatible = "qcom,pm8998-pon";
  257. reg = <0x800>;
  258. mode-bootloader = <0x2>;
  259. mode-recovery = <0x1>;
  260. pwrkey {
  261. compatible = "qcom,pm8941-pwrkey";
  262. interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
  263. debounce = <15625>;
  264. bias-pull-up;
  265. linux,code = <KEY_POWER>;
  266. };
  267. };
  268. temp-alarm@2400 {
  269. compatible = "qcom,spmi-temp-alarm";
  270. reg = <0x2400>;
  271. interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
  272. io-channels = <&pm6150_adc ADC5_DIE_TEMP>;
  273. io-channel-names = "thermal";
  274. #thermal-sensor-cells = <0>;
  275. };
  276. pm6150_adc: adc@3100 {
  277. compatible = "qcom,spmi-adc5";
  278. reg = <0x3100>;
  279. interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
  280. #address-cells = <1>;
  281. #size-cells = <0>;
  282. #io-channel-cells = <1>;
  283. channel@6 {
  284. reg = <ADC5_DIE_TEMP>;
  285. label = "die_temp";
  286. };
  287. channel@4f {
  288. reg = <ADC5_AMUX_THM3_100K_PU>;
  289. qcom,ratiometric;
  290. qcom,hw-settle-time = <200>;
  291. };
  292. };
  293. adc-tm@3500 {
  294. compatible = "qcom,spmi-adc-tm5";
  295. reg = <0x3500>;
  296. interrupts = <0x0 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
  297. #thermal-sensor-cells = <1>;
  298. #address-cells = <1>;
  299. #size-cells = <0>;
  300. charger-thermistor@0 {
  301. reg = <0>;
  302. io-channels = <&pm6150_adc ADC5_AMUX_THM3_100K_PU>;
  303. qcom,ratiometric;
  304. qcom,hw-settle-time-us = <200>;
  305. };
  306. };
  307. gpio@c000 {
  308. compatible = "qcom,pm6150-gpio", "qcom,spmi-gpio";
  309. reg = <0xc000>;
  310. gpio-controller;
  311. gpio-ranges = <&pm6150_gpio 0 0 10>;
  312. #gpio-cells = <2>;
  313. interrupt-controller;
  314. #interrupt-cells = <2>;
  315. };
  316. };