mediatek,mt6370.yaml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/mfd/mediatek,mt6370.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: MediaTek MT6370 SubPMIC
  7. maintainers:
  8. - ChiYuan Huang <cy_huang@richtek.com>
  9. description: |
  10. MT6370 is a highly-integrated smart power management IC, which includes a
  11. single cell Li-Ion/Li-Polymer switching battery charger, a USB Type-C &
  12. Power Delivery (PD) controller, dual flash LED current sources, a RGB LED
  13. driver, a backlight WLED driver, a display bias driver and a general LDO for
  14. portable devices.
  15. properties:
  16. compatible:
  17. const: mediatek,mt6370
  18. reg:
  19. maxItems: 1
  20. wakeup-source: true
  21. interrupts:
  22. maxItems: 1
  23. interrupt-controller: true
  24. "#interrupt-cells":
  25. const: 1
  26. adc:
  27. type: object
  28. additionalProperties: false
  29. description: |
  30. Provides 9 channels for system monitoring, including VBUSDIV5 (lower
  31. accuracy, higher measure range), VBUSDIV2 (higher accuracy, lower
  32. measure range), VBAT, VSYS, CHG_VDDP, TS_BAT, IBUS, IBAT, and TEMP_JC.
  33. properties:
  34. compatible:
  35. const: mediatek,mt6370-adc
  36. "#io-channel-cells":
  37. const: 1
  38. required:
  39. - compatible
  40. - "#io-channel-cells"
  41. backlight:
  42. type: object
  43. $ref: /schemas/leds/backlight/mediatek,mt6370-backlight.yaml#
  44. charger:
  45. type: object
  46. $ref: /schemas/power/supply/mediatek,mt6370-charger.yaml#
  47. tcpc:
  48. type: object
  49. $ref: /schemas/usb/mediatek,mt6370-tcpc.yaml#
  50. indicator:
  51. type: object
  52. $ref: /schemas/leds/mediatek,mt6370-indicator.yaml#
  53. flashlight:
  54. type: object
  55. $ref: /schemas/leds/mediatek,mt6370-flashlight.yaml#
  56. regulators:
  57. type: object
  58. additionalProperties: false
  59. description: |
  60. List all supported regulators, which support the control for DisplayBias
  61. voltages and one general purpose LDO which commonly used to drive the
  62. vibrator.
  63. patternProperties:
  64. "^(dsvbst|vibldo)$":
  65. $ref: /schemas/regulator/regulator.yaml#
  66. type: object
  67. unevaluatedProperties: false
  68. "^(dsvpos|dsvneg)$":
  69. $ref: /schemas/regulator/regulator.yaml#
  70. type: object
  71. unevaluatedProperties: false
  72. properties:
  73. enable-gpios:
  74. maxItems: 1
  75. required:
  76. - compatible
  77. - reg
  78. - interrupts
  79. - interrupt-controller
  80. - "#interrupt-cells"
  81. - regulators
  82. - adc
  83. - backlight
  84. - indicator
  85. - tcpc
  86. - charger
  87. - flashlight
  88. additionalProperties: false
  89. examples:
  90. - |
  91. #include <dt-bindings/interrupt-controller/irq.h>
  92. #include <dt-bindings/leds/common.h>
  93. #include <dt-bindings/iio/adc/mediatek,mt6370_adc.h>
  94. #include <dt-bindings/usb/pd.h>
  95. i2c {
  96. #address-cells = <1>;
  97. #size-cells = <0>;
  98. pmic@34 {
  99. compatible = "mediatek,mt6370";
  100. reg = <0x34>;
  101. wakeup-source;
  102. interrupts-extended = <&gpio26 3 IRQ_TYPE_LEVEL_LOW>;
  103. interrupt-controller;
  104. #interrupt-cells = <1>;
  105. mt6370_adc: adc {
  106. compatible = "mediatek,mt6370-adc";
  107. #io-channel-cells = <1>;
  108. };
  109. backlight {
  110. compatible = "mediatek,mt6370-backlight";
  111. mediatek,bled-channel-use = /bits/ 8 <15>;
  112. };
  113. charger {
  114. compatible = "mediatek,mt6370-charger";
  115. interrupts = <68>, <48>, <6>;
  116. interrupt-names = "uvp_d_evt", "attach_i", "mivr";
  117. io-channels = <&mt6370_adc MT6370_CHAN_IBUS>;
  118. mt6370_otg_vbus: usb-otg-vbus-regulator {
  119. regulator-name = "mt6370-usb-otg-vbus";
  120. regulator-min-microvolt = <4350000>;
  121. regulator-max-microvolt = <5800000>;
  122. regulator-min-microamp = <500000>;
  123. regulator-max-microamp = <3000000>;
  124. };
  125. };
  126. indicator {
  127. compatible = "mediatek,mt6370-indicator";
  128. #address-cells = <1>;
  129. #size-cells = <0>;
  130. multi-led@0 {
  131. reg = <0>;
  132. function = LED_FUNCTION_INDICATOR;
  133. color = <LED_COLOR_ID_RGB>;
  134. led-max-microamp = <24000>;
  135. #address-cells = <1>;
  136. #size-cells = <0>;
  137. led@0 {
  138. reg = <0>;
  139. color = <LED_COLOR_ID_RED>;
  140. };
  141. led@1 {
  142. reg = <1>;
  143. color = <LED_COLOR_ID_GREEN>;
  144. };
  145. led@2 {
  146. reg = <2>;
  147. color = <LED_COLOR_ID_BLUE>;
  148. };
  149. };
  150. led@3 {
  151. reg = <3>;
  152. function = LED_FUNCTION_INDICATOR;
  153. color = <LED_COLOR_ID_WHITE>;
  154. led-max-microamp = <6000>;
  155. };
  156. };
  157. flashlight {
  158. compatible = "mediatek,mt6370-flashlight";
  159. #address-cells = <1>;
  160. #size-cells = <0>;
  161. led@0 {
  162. reg = <0>;
  163. led-sources = <0>;
  164. function = LED_FUNCTION_FLASH;
  165. color = <LED_COLOR_ID_WHITE>;
  166. function-enumerator = <1>;
  167. led-max-microamp = <200000>;
  168. flash-max-microamp = <500000>;
  169. flash-max-timeout-us = <1248000>;
  170. };
  171. led@1 {
  172. reg = <1>;
  173. led-sources = <1>;
  174. function = LED_FUNCTION_FLASH;
  175. color = <LED_COLOR_ID_WHITE>;
  176. function-enumerator = <2>;
  177. led-max-microamp = <200000>;
  178. flash-max-microamp = <500000>;
  179. flash-max-timeout-us = <1248000>;
  180. };
  181. };
  182. tcpc {
  183. compatible = "mediatek,mt6370-tcpc";
  184. interrupts-extended = <&gpio26 4 IRQ_TYPE_LEVEL_LOW>;
  185. connector {
  186. compatible = "usb-c-connector";
  187. label = "USB-C";
  188. vbus-supply = <&mt6370_otg_vbus>;
  189. data-role = "dual";
  190. power-role = "dual";
  191. try-power-role = "sink";
  192. source-pdos = <PDO_FIXED(5000, 1000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
  193. sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
  194. op-sink-microwatt = <10000000>;
  195. ports {
  196. #address-cells = <1>;
  197. #size-cells = <0>;
  198. port@0 {
  199. reg = <0>;
  200. endpoint {
  201. remote-endpoint = <&usb_hs>;
  202. };
  203. };
  204. port@1 {
  205. reg = <1>;
  206. endpoint {
  207. remote-endpoint = <&usb_ss>;
  208. };
  209. };
  210. port@2 {
  211. reg = <2>;
  212. endpoint {
  213. remote-endpoint = <&dp_aux>;
  214. };
  215. };
  216. };
  217. };
  218. };
  219. regulators {
  220. dsvbst {
  221. regulator-name = "mt6370-dsv-vbst";
  222. regulator-min-microvolt = <4000000>;
  223. regulator-max-microvolt = <6200000>;
  224. };
  225. dsvpos {
  226. regulator-name = "mt6370-dsv-vpos";
  227. regulator-min-microvolt = <4000000>;
  228. regulator-max-microvolt = <6000000>;
  229. regulator-boot-on;
  230. };
  231. dsvneg {
  232. regulator-name = "mt6370-dsv-vneg";
  233. regulator-min-microvolt = <4000000>;
  234. regulator-max-microvolt = <6000000>;
  235. regulator-boot-on;
  236. };
  237. vibldo {
  238. regulator-name = "mt6370-vib-ldo";
  239. regulator-min-microvolt = <1600000>;
  240. regulator-max-microvolt = <4000000>;
  241. };
  242. };
  243. };
  244. };