xref: /linux/Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
16c38ca03SChris Morgan# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
26c38ca03SChris Morgan%YAML 1.2
36c38ca03SChris Morgan---
46c38ca03SChris Morgan$id: http://devicetree.org/schemas/mfd/rockchip,rk817.yaml#
56c38ca03SChris Morgan$schema: http://devicetree.org/meta-schemas/core.yaml#
66c38ca03SChris Morgan
7*f1112131SCristian Ciocalteatitle: RK809/RK817 Power Management Integrated Circuit
86c38ca03SChris Morgan
96c38ca03SChris Morganmaintainers:
106c38ca03SChris Morgan  - Chris Zhong <zyw@rock-chips.com>
116c38ca03SChris Morgan  - Zhang Qing <zhangqing@rock-chips.com>
126c38ca03SChris Morgan
136c38ca03SChris Morgandescription: |
14*f1112131SCristian Ciocaltea  Rockchip RK809/RK817 series PMIC. This device consists of an i2c controlled
15*f1112131SCristian Ciocaltea  MFD that includes regulators, an RTC, a power button and an audio codec.
16*f1112131SCristian Ciocaltea  The RK817 variant also provides a battery charger manager.
176c38ca03SChris Morgan
186c38ca03SChris Morganproperties:
196c38ca03SChris Morgan  compatible:
206c38ca03SChris Morgan    enum:
21*f1112131SCristian Ciocaltea      - rockchip,rk809
226c38ca03SChris Morgan      - rockchip,rk817
236c38ca03SChris Morgan
246c38ca03SChris Morgan  reg:
256c38ca03SChris Morgan    maxItems: 1
266c38ca03SChris Morgan
276c38ca03SChris Morgan  interrupts:
286c38ca03SChris Morgan    maxItems: 1
296c38ca03SChris Morgan
306c38ca03SChris Morgan  '#clock-cells':
316c38ca03SChris Morgan    description:
326c38ca03SChris Morgan      See <dt-bindings/clock/rockchip,rk808.h> for clock IDs.
336c38ca03SChris Morgan    minimum: 0
346c38ca03SChris Morgan    maximum: 1
356c38ca03SChris Morgan
36e7865de2SCristian Ciocaltea  clocks:
37e7865de2SCristian Ciocaltea    maxItems: 1
38e7865de2SCristian Ciocaltea
39e7865de2SCristian Ciocaltea  clock-names:
40e7865de2SCristian Ciocaltea    items:
41e7865de2SCristian Ciocaltea      - const: mclk
42e7865de2SCristian Ciocaltea
436c38ca03SChris Morgan  clock-output-names:
446c38ca03SChris Morgan    description:
456c38ca03SChris Morgan      From common clock binding to override the default output clock name.
466c38ca03SChris Morgan
476c38ca03SChris Morgan  rockchip,system-power-controller:
486c38ca03SChris Morgan    type: boolean
49961748bbSOndrej Jirman    deprecated: true
506c38ca03SChris Morgan    description:
516c38ca03SChris Morgan      Telling whether or not this PMIC is controlling the system power.
526c38ca03SChris Morgan
53e7865de2SCristian Ciocaltea  '#sound-dai-cells':
54e7865de2SCristian Ciocaltea    const: 0
55e7865de2SCristian Ciocaltea
56961748bbSOndrej Jirman  system-power-controller: true
57961748bbSOndrej Jirman
586c38ca03SChris Morgan  wakeup-source:
596c38ca03SChris Morgan    type: boolean
606c38ca03SChris Morgan    description:
616c38ca03SChris Morgan      Device can be used as a wakeup source.
626c38ca03SChris Morgan
636c38ca03SChris Morgan  vcc1-supply:
646c38ca03SChris Morgan    description:
656c38ca03SChris Morgan      The input supply for DCDC_REG1.
666c38ca03SChris Morgan
676c38ca03SChris Morgan  vcc2-supply:
686c38ca03SChris Morgan    description:
696c38ca03SChris Morgan      The input supply for DCDC_REG2.
706c38ca03SChris Morgan
716c38ca03SChris Morgan  vcc3-supply:
726c38ca03SChris Morgan    description:
736c38ca03SChris Morgan      The input supply for DCDC_REG3.
746c38ca03SChris Morgan
756c38ca03SChris Morgan  vcc4-supply:
766c38ca03SChris Morgan    description:
776c38ca03SChris Morgan      The input supply for DCDC_REG4.
786c38ca03SChris Morgan
796c38ca03SChris Morgan  vcc5-supply:
806c38ca03SChris Morgan    description:
816c38ca03SChris Morgan      The input supply for LDO_REG1, LDO_REG2, and LDO_REG3.
826c38ca03SChris Morgan
836c38ca03SChris Morgan  vcc6-supply:
846c38ca03SChris Morgan    description:
856c38ca03SChris Morgan      The input supply for LDO_REG4, LDO_REG5, and LDO_REG6.
866c38ca03SChris Morgan
876c38ca03SChris Morgan  vcc7-supply:
886c38ca03SChris Morgan    description:
896c38ca03SChris Morgan      The input supply for LDO_REG7, LDO_REG8, and LDO_REG9.
906c38ca03SChris Morgan
916c38ca03SChris Morgan  vcc8-supply:
926c38ca03SChris Morgan    description:
93*f1112131SCristian Ciocaltea      The input supply for BOOST on RK817, or for SWITCH_REG2 on RK809.
946c38ca03SChris Morgan
956c38ca03SChris Morgan  vcc9-supply:
966c38ca03SChris Morgan    description:
97*f1112131SCristian Ciocaltea      The input supply for OTG_SWITCH on RK817,
98*f1112131SCristian Ciocaltea      or for DCDC_REG5 and SWITCH_REG1 on RK809.
996c38ca03SChris Morgan
1006c38ca03SChris Morgan  regulators:
1016c38ca03SChris Morgan    type: object
1026c38ca03SChris Morgan    patternProperties:
103*f1112131SCristian Ciocaltea      "^(LDO_REG[1-9]|DCDC_REG[1-5]|BOOST|OTG_SWITCH|SWITCH_REG[1-2])$":
104*f1112131SCristian Ciocaltea        $ref: /schemas/regulator/regulator.yaml
10542839dcaSRob Herring        unevaluatedProperties: false
106*f1112131SCristian Ciocaltea    additionalProperties: false
1076c38ca03SChris Morgan
1086c38ca03SChris Morgan  codec:
1096c38ca03SChris Morgan    type: object
11042839dcaSRob Herring    additionalProperties: false
1116c38ca03SChris Morgan    properties:
1126c38ca03SChris Morgan      rockchip,mic-in-differential:
1136c38ca03SChris Morgan        type: boolean
1146c38ca03SChris Morgan        description:
1156c38ca03SChris Morgan          Describes if the microphone uses differential mode.
1166c38ca03SChris Morgan
117a592aa3aSChris Morgan  charger:
118a592aa3aSChris Morgan    type: object
119c7d47d51SKrzysztof Kozlowski    $ref: /schemas/power/supply/power-supply.yaml
120c7d47d51SKrzysztof Kozlowski
121a592aa3aSChris Morgan    properties:
122a592aa3aSChris Morgan      monitored-battery:
123a592aa3aSChris Morgan        description: |
124a592aa3aSChris Morgan          A phandle to a monitored battery node that contains a valid
125a592aa3aSChris Morgan          value for:
126a592aa3aSChris Morgan          charge-full-design-microamp-hours,
127a592aa3aSChris Morgan          charge-term-current-microamp,
128a592aa3aSChris Morgan          constant-charge-current-max-microamp,
129a592aa3aSChris Morgan          constant-charge-voltage-max-microvolt,
130a592aa3aSChris Morgan          voltage-max-design-microvolt,
131a592aa3aSChris Morgan          voltage-min-design-microvolt,
132a592aa3aSChris Morgan          and a valid ocv-capacity table.
133a592aa3aSChris Morgan
134a592aa3aSChris Morgan      rockchip,resistor-sense-micro-ohms:
135a592aa3aSChris Morgan        description: |
136a592aa3aSChris Morgan          Value in microohms of the battery sense resistor. This value is
137a592aa3aSChris Morgan          used by the driver to set the correct divisor value to translate
138a592aa3aSChris Morgan          ADC readings into the proper units of measure.
139a592aa3aSChris Morgan        enum: [10000, 20000]
140a592aa3aSChris Morgan
141a592aa3aSChris Morgan      rockchip,sleep-enter-current-microamp:
142a592aa3aSChris Morgan        description: |
143a592aa3aSChris Morgan          Value in microamps of the sleep enter current for the charger.
144a592aa3aSChris Morgan          Value is used by the driver to calibrate the relax threshold.
145a592aa3aSChris Morgan
146a592aa3aSChris Morgan      rockchip,sleep-filter-current-microamp:
147a592aa3aSChris Morgan        description:
148a592aa3aSChris Morgan          Value in microamps of the sleep filter current for the charger.
149a592aa3aSChris Morgan          Value is used by the driver to derive the sleep sample current.
150a592aa3aSChris Morgan
151a592aa3aSChris Morgan    required:
152a592aa3aSChris Morgan      - monitored-battery
153a592aa3aSChris Morgan      - rockchip,resistor-sense-micro-ohms
154a592aa3aSChris Morgan      - rockchip,sleep-enter-current-microamp
155a592aa3aSChris Morgan      - rockchip,sleep-filter-current-microamp
156a592aa3aSChris Morgan
157a592aa3aSChris Morgan    additionalProperties: false
158a592aa3aSChris Morgan
1596c38ca03SChris MorganallOf:
160e7865de2SCristian Ciocaltea  - $ref: /schemas/sound/dai-common.yaml#
1616c38ca03SChris Morgan  - if:
1626c38ca03SChris Morgan      properties:
1636c38ca03SChris Morgan        '#clock-cells':
1646c38ca03SChris Morgan          const: 0
1656c38ca03SChris Morgan
1666c38ca03SChris Morgan    then:
1676c38ca03SChris Morgan      properties:
1686c38ca03SChris Morgan        clock-output-names:
1696c38ca03SChris Morgan          maxItems: 1
1706c38ca03SChris Morgan
1716c38ca03SChris Morgan    else:
1726c38ca03SChris Morgan      properties:
1736c38ca03SChris Morgan        clock-output-names:
1746c38ca03SChris Morgan          maxItems: 2
1756c38ca03SChris Morgan
176*f1112131SCristian Ciocaltea  - if:
177*f1112131SCristian Ciocaltea      properties:
178*f1112131SCristian Ciocaltea        compatible:
179*f1112131SCristian Ciocaltea          contains:
180*f1112131SCristian Ciocaltea            const: rockchip,rk817
181*f1112131SCristian Ciocaltea    then:
182*f1112131SCristian Ciocaltea      properties:
183*f1112131SCristian Ciocaltea        regulators:
184*f1112131SCristian Ciocaltea          patternProperties:
185*f1112131SCristian Ciocaltea            "^(DCDC_REG5|SWITCH_REG[1-2])$": false
186*f1112131SCristian Ciocaltea    else:
187*f1112131SCristian Ciocaltea      properties:
188*f1112131SCristian Ciocaltea        regulators:
189*f1112131SCristian Ciocaltea          patternProperties:
190*f1112131SCristian Ciocaltea            "^(BOOST|OTG_SWITCH)$": false
191*f1112131SCristian Ciocaltea
1926c38ca03SChris Morganrequired:
1936c38ca03SChris Morgan  - compatible
1946c38ca03SChris Morgan  - reg
1956c38ca03SChris Morgan  - interrupts
1966c38ca03SChris Morgan  - "#clock-cells"
1976c38ca03SChris Morgan
1986c38ca03SChris MorganadditionalProperties: false
1996c38ca03SChris Morgan
2006c38ca03SChris Morganexamples:
2016c38ca03SChris Morgan  - |
2026c38ca03SChris Morgan    #include <dt-bindings/clock/px30-cru.h>
2036c38ca03SChris Morgan    #include <dt-bindings/pinctrl/rockchip.h>
2046c38ca03SChris Morgan    #include <dt-bindings/interrupt-controller/irq.h>
2056c38ca03SChris Morgan    #include <dt-bindings/gpio/gpio.h>
2066c38ca03SChris Morgan    i2c {
2076c38ca03SChris Morgan        #address-cells = <1>;
2086c38ca03SChris Morgan        #size-cells = <0>;
2096c38ca03SChris Morgan
2106c38ca03SChris Morgan        rk817: pmic@20 {
2116c38ca03SChris Morgan            compatible = "rockchip,rk817";
2126c38ca03SChris Morgan            reg = <0x20>;
2136c38ca03SChris Morgan            interrupt-parent = <&gpio0>;
2146c38ca03SChris Morgan            interrupts = <RK_PB2 IRQ_TYPE_LEVEL_LOW>;
2156c38ca03SChris Morgan            clock-output-names = "rk808-clkout1", "xin32k";
2166c38ca03SChris Morgan            clock-names = "mclk";
2176c38ca03SChris Morgan            clocks = <&cru SCLK_I2S1_OUT>;
2186c38ca03SChris Morgan            pinctrl-names = "default";
2196c38ca03SChris Morgan            pinctrl-0 = <&pmic_int>, <&i2s1_2ch_mclk>;
2206c38ca03SChris Morgan            wakeup-source;
2216c38ca03SChris Morgan            #clock-cells = <1>;
2226c38ca03SChris Morgan            #sound-dai-cells = <0>;
2236c38ca03SChris Morgan
2246c38ca03SChris Morgan            vcc1-supply = <&vccsys>;
2256c38ca03SChris Morgan            vcc2-supply = <&vccsys>;
2266c38ca03SChris Morgan            vcc3-supply = <&vccsys>;
2276c38ca03SChris Morgan            vcc4-supply = <&vccsys>;
2286c38ca03SChris Morgan            vcc5-supply = <&vccsys>;
2296c38ca03SChris Morgan            vcc6-supply = <&vccsys>;
2306c38ca03SChris Morgan            vcc7-supply = <&vccsys>;
2316c38ca03SChris Morgan
2326c38ca03SChris Morgan            regulators {
2336c38ca03SChris Morgan                vdd_logic: DCDC_REG1 {
2346c38ca03SChris Morgan                    regulator-name = "vdd_logic";
2356c38ca03SChris Morgan                    regulator-min-microvolt = <950000>;
2366c38ca03SChris Morgan                    regulator-max-microvolt = <1150000>;
2376c38ca03SChris Morgan                    regulator-ramp-delay = <6001>;
2386c38ca03SChris Morgan                    regulator-always-on;
2396c38ca03SChris Morgan                    regulator-boot-on;
2406c38ca03SChris Morgan
2416c38ca03SChris Morgan                    regulator-state-mem {
2426c38ca03SChris Morgan                        regulator-on-in-suspend;
2436c38ca03SChris Morgan                        regulator-suspend-microvolt = <950000>;
2446c38ca03SChris Morgan                    };
2456c38ca03SChris Morgan                };
2466c38ca03SChris Morgan
2476c38ca03SChris Morgan                vdd_arm: DCDC_REG2 {
2486c38ca03SChris Morgan                    regulator-name = "vdd_arm";
2496c38ca03SChris Morgan                    regulator-min-microvolt = <950000>;
2506c38ca03SChris Morgan                    regulator-max-microvolt = <1350000>;
2516c38ca03SChris Morgan                    regulator-ramp-delay = <6001>;
2526c38ca03SChris Morgan                    regulator-always-on;
2536c38ca03SChris Morgan                    regulator-boot-on;
2546c38ca03SChris Morgan
2556c38ca03SChris Morgan                    regulator-state-mem {
2566c38ca03SChris Morgan                        regulator-off-in-suspend;
2576c38ca03SChris Morgan                        regulator-suspend-microvolt = <950000>;
2586c38ca03SChris Morgan                    };
2596c38ca03SChris Morgan                };
2606c38ca03SChris Morgan
2616c38ca03SChris Morgan                vcc_ddr: DCDC_REG3 {
2626c38ca03SChris Morgan                    regulator-name = "vcc_ddr";
2636c38ca03SChris Morgan                    regulator-always-on;
2646c38ca03SChris Morgan                    regulator-boot-on;
2656c38ca03SChris Morgan
2666c38ca03SChris Morgan                    regulator-state-mem {
2676c38ca03SChris Morgan                        regulator-on-in-suspend;
2686c38ca03SChris Morgan                    };
2696c38ca03SChris Morgan                };
2706c38ca03SChris Morgan
2716c38ca03SChris Morgan                vcc_3v3: DCDC_REG4 {
2726c38ca03SChris Morgan                    regulator-name = "vcc_3v3";
2736c38ca03SChris Morgan                    regulator-min-microvolt = <3300000>;
2746c38ca03SChris Morgan                    regulator-max-microvolt = <3300000>;
2756c38ca03SChris Morgan                    regulator-always-on;
2766c38ca03SChris Morgan                    regulator-boot-on;
2776c38ca03SChris Morgan
2786c38ca03SChris Morgan                    regulator-state-mem {
2796c38ca03SChris Morgan                        regulator-off-in-suspend;
2806c38ca03SChris Morgan                        regulator-suspend-microvolt = <3300000>;
2816c38ca03SChris Morgan                    };
2826c38ca03SChris Morgan                };
2836c38ca03SChris Morgan
2846c38ca03SChris Morgan                vcc_1v8: LDO_REG2 {
2856c38ca03SChris Morgan                    regulator-name = "vcc_1v8";
2866c38ca03SChris Morgan                    regulator-min-microvolt = <1800000>;
2876c38ca03SChris Morgan                    regulator-max-microvolt = <1800000>;
2886c38ca03SChris Morgan                    regulator-always-on;
2896c38ca03SChris Morgan                    regulator-boot-on;
2906c38ca03SChris Morgan
2916c38ca03SChris Morgan                    regulator-state-mem {
2926c38ca03SChris Morgan                        regulator-on-in-suspend;
2936c38ca03SChris Morgan                        regulator-suspend-microvolt = <1800000>;
2946c38ca03SChris Morgan                    };
2956c38ca03SChris Morgan                };
2966c38ca03SChris Morgan
2976c38ca03SChris Morgan                vdd_1v0: LDO_REG3 {
2986c38ca03SChris Morgan                    regulator-name = "vdd_1v0";
2996c38ca03SChris Morgan                    regulator-min-microvolt = <1000000>;
3006c38ca03SChris Morgan                    regulator-max-microvolt = <1000000>;
3016c38ca03SChris Morgan                    regulator-always-on;
3026c38ca03SChris Morgan                    regulator-boot-on;
3036c38ca03SChris Morgan
3046c38ca03SChris Morgan                    regulator-state-mem {
3056c38ca03SChris Morgan                        regulator-on-in-suspend;
3066c38ca03SChris Morgan                        regulator-suspend-microvolt = <1000000>;
3076c38ca03SChris Morgan                    };
3086c38ca03SChris Morgan                };
3096c38ca03SChris Morgan
3106c38ca03SChris Morgan                vcc3v3_pmu: LDO_REG4 {
3116c38ca03SChris Morgan                    regulator-name = "vcc3v3_pmu";
3126c38ca03SChris Morgan                    regulator-min-microvolt = <3300000>;
3136c38ca03SChris Morgan                    regulator-max-microvolt = <3300000>;
3146c38ca03SChris Morgan                    regulator-always-on;
3156c38ca03SChris Morgan                    regulator-boot-on;
3166c38ca03SChris Morgan
3176c38ca03SChris Morgan                    regulator-state-mem {
3186c38ca03SChris Morgan                        regulator-on-in-suspend;
3196c38ca03SChris Morgan                        regulator-suspend-microvolt = <3300000>;
3206c38ca03SChris Morgan                    };
3216c38ca03SChris Morgan                };
3226c38ca03SChris Morgan
3236c38ca03SChris Morgan                vccio_sd: LDO_REG5 {
3246c38ca03SChris Morgan                    regulator-name = "vccio_sd";
3256c38ca03SChris Morgan                    regulator-min-microvolt = <1800000>;
3266c38ca03SChris Morgan                    regulator-max-microvolt = <3300000>;
3276c38ca03SChris Morgan                    regulator-always-on;
3286c38ca03SChris Morgan                    regulator-boot-on;
3296c38ca03SChris Morgan
3306c38ca03SChris Morgan                    regulator-state-mem {
3316c38ca03SChris Morgan                        regulator-on-in-suspend;
3326c38ca03SChris Morgan                        regulator-suspend-microvolt = <3300000>;
3336c38ca03SChris Morgan                    };
3346c38ca03SChris Morgan                };
3356c38ca03SChris Morgan
3366c38ca03SChris Morgan                vcc_sd: LDO_REG6 {
3376c38ca03SChris Morgan                    regulator-name = "vcc_sd";
3386c38ca03SChris Morgan                    regulator-min-microvolt = <3300000>;
3396c38ca03SChris Morgan                    regulator-max-microvolt = <3300000>;
3406c38ca03SChris Morgan                    regulator-boot-on;
3416c38ca03SChris Morgan
3426c38ca03SChris Morgan                    regulator-state-mem {
3436c38ca03SChris Morgan                        regulator-on-in-suspend;
3446c38ca03SChris Morgan                        regulator-suspend-microvolt = <3300000>;
3456c38ca03SChris Morgan                    };
3466c38ca03SChris Morgan                };
3476c38ca03SChris Morgan
3486c38ca03SChris Morgan                vcc_bl: LDO_REG7 {
3496c38ca03SChris Morgan                    regulator-name = "vcc_bl";
3506c38ca03SChris Morgan                    regulator-min-microvolt = <3300000>;
3516c38ca03SChris Morgan                    regulator-max-microvolt = <3300000>;
3526c38ca03SChris Morgan
3536c38ca03SChris Morgan                    regulator-state-mem {
3546c38ca03SChris Morgan                        regulator-off-in-suspend;
3556c38ca03SChris Morgan                        regulator-suspend-microvolt = <3300000>;
3566c38ca03SChris Morgan                    };
3576c38ca03SChris Morgan                };
3586c38ca03SChris Morgan
3596c38ca03SChris Morgan                vcc_lcd: LDO_REG8 {
3606c38ca03SChris Morgan                    regulator-name = "vcc_lcd";
3616c38ca03SChris Morgan                    regulator-min-microvolt = <2800000>;
3626c38ca03SChris Morgan                    regulator-max-microvolt = <2800000>;
3636c38ca03SChris Morgan
3646c38ca03SChris Morgan                    regulator-state-mem {
3656c38ca03SChris Morgan                        regulator-off-in-suspend;
3666c38ca03SChris Morgan                        regulator-suspend-microvolt = <2800000>;
3676c38ca03SChris Morgan                    };
3686c38ca03SChris Morgan                };
3696c38ca03SChris Morgan
3706c38ca03SChris Morgan                vcc_cam: LDO_REG9 {
3716c38ca03SChris Morgan                    regulator-name = "vcc_cam";
3726c38ca03SChris Morgan                    regulator-min-microvolt = <3000000>;
3736c38ca03SChris Morgan                    regulator-max-microvolt = <3000000>;
3746c38ca03SChris Morgan
3756c38ca03SChris Morgan                    regulator-state-mem {
3766c38ca03SChris Morgan                        regulator-off-in-suspend;
3776c38ca03SChris Morgan                        regulator-suspend-microvolt = <3000000>;
3786c38ca03SChris Morgan                    };
3796c38ca03SChris Morgan                };
3806c38ca03SChris Morgan            };
3816c38ca03SChris Morgan
382a592aa3aSChris Morgan            rk817_charger: charger {
383a592aa3aSChris Morgan                monitored-battery = <&battery>;
384a592aa3aSChris Morgan                rockchip,resistor-sense-micro-ohms = <10000>;
385a592aa3aSChris Morgan                rockchip,sleep-enter-current-microamp = <300000>;
386a592aa3aSChris Morgan                rockchip,sleep-filter-current-microamp = <100000>;
387a592aa3aSChris Morgan            };
388a592aa3aSChris Morgan
3896c38ca03SChris Morgan            rk817_codec: codec {
3906c38ca03SChris Morgan                rockchip,mic-in-differential;
3916c38ca03SChris Morgan            };
3926c38ca03SChris Morgan        };
3936c38ca03SChris Morgan    };
394