18c2ecf20Sopenharmony_ciQualcomm Resource Power Manager (RPM)
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThis driver is used to interface with the Resource Power Manager (RPM) found in
48c2ecf20Sopenharmony_civarious Qualcomm platforms. The RPM allows each component in the system to vote
58c2ecf20Sopenharmony_cifor state of the system resources, such as clocks, regulators and bus
68c2ecf20Sopenharmony_cifrequencies.
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci- compatible:
98c2ecf20Sopenharmony_ci	Usage: required
108c2ecf20Sopenharmony_ci	Value type: <string>
118c2ecf20Sopenharmony_ci	Definition: must be one of:
128c2ecf20Sopenharmony_ci		    "qcom,rpm-apq8064"
138c2ecf20Sopenharmony_ci		    "qcom,rpm-msm8660"
148c2ecf20Sopenharmony_ci		    "qcom,rpm-msm8960"
158c2ecf20Sopenharmony_ci		    "qcom,rpm-ipq8064"
168c2ecf20Sopenharmony_ci		    "qcom,rpm-mdm9615"
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci- reg:
198c2ecf20Sopenharmony_ci	Usage: required
208c2ecf20Sopenharmony_ci	Value type: <prop-encoded-array>
218c2ecf20Sopenharmony_ci	Definition: base address and size of the RPM's message ram
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci- interrupts:
248c2ecf20Sopenharmony_ci	Usage: required
258c2ecf20Sopenharmony_ci	Value type: <prop-encoded-array>
268c2ecf20Sopenharmony_ci	Definition: three entries specifying the RPM's:
278c2ecf20Sopenharmony_ci		    1. acknowledgement interrupt
288c2ecf20Sopenharmony_ci		    2. error interrupt
298c2ecf20Sopenharmony_ci		    3. wakeup interrupt
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci- interrupt-names:
328c2ecf20Sopenharmony_ci	Usage: required
338c2ecf20Sopenharmony_ci	Value type: <string-array>
348c2ecf20Sopenharmony_ci	Definition: must be the three strings "ack", "err" and "wakeup", in order
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci- qcom,ipc:
378c2ecf20Sopenharmony_ci	Usage: required
388c2ecf20Sopenharmony_ci	Value type: <prop-encoded-array>
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci	Definition: three entries specifying the outgoing ipc bit used for
418c2ecf20Sopenharmony_ci		    signaling the RPM:
428c2ecf20Sopenharmony_ci		    - phandle to a syscon node representing the apcs registers
438c2ecf20Sopenharmony_ci		    - u32 representing offset to the register within the syscon
448c2ecf20Sopenharmony_ci		    - u32 representing the ipc bit within the register
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci= SUBNODES
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciThe RPM exposes resources to its subnodes. The below bindings specify the set
508c2ecf20Sopenharmony_ciof valid subnodes that can operate on these resources.
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci== Regulators
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ciRegulator nodes are identified by their compatible:
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci- compatible:
578c2ecf20Sopenharmony_ci	Usage: required
588c2ecf20Sopenharmony_ci	Value type: <string>
598c2ecf20Sopenharmony_ci	Definition: must be one of:
608c2ecf20Sopenharmony_ci		    "qcom,rpm-pm8058-regulators"
618c2ecf20Sopenharmony_ci		    "qcom,rpm-pm8901-regulators"
628c2ecf20Sopenharmony_ci		    "qcom,rpm-pm8921-regulators"
638c2ecf20Sopenharmony_ci		    "qcom,rpm-pm8018-regulators"
648c2ecf20Sopenharmony_ci		    "qcom,rpm-smb208-regulators"
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci- vdd_l0_l1_lvs-supply:
678c2ecf20Sopenharmony_ci- vdd_l2_l11_l12-supply:
688c2ecf20Sopenharmony_ci- vdd_l3_l4_l5-supply:
698c2ecf20Sopenharmony_ci- vdd_l6_l7-supply:
708c2ecf20Sopenharmony_ci- vdd_l8-supply:
718c2ecf20Sopenharmony_ci- vdd_l9-supply:
728c2ecf20Sopenharmony_ci- vdd_l10-supply:
738c2ecf20Sopenharmony_ci- vdd_l13_l16-supply:
748c2ecf20Sopenharmony_ci- vdd_l14_l15-supply:
758c2ecf20Sopenharmony_ci- vdd_l17_l18-supply:
768c2ecf20Sopenharmony_ci- vdd_l19_l20-supply:
778c2ecf20Sopenharmony_ci- vdd_l21-supply:
788c2ecf20Sopenharmony_ci- vdd_l22-supply:
798c2ecf20Sopenharmony_ci- vdd_l23_l24_l25-supply:
808c2ecf20Sopenharmony_ci- vdd_ncp-supply:
818c2ecf20Sopenharmony_ci- vdd_s0-supply:
828c2ecf20Sopenharmony_ci- vdd_s1-supply:
838c2ecf20Sopenharmony_ci- vdd_s2-supply:
848c2ecf20Sopenharmony_ci- vdd_s3-supply:
858c2ecf20Sopenharmony_ci- vdd_s4-supply:
868c2ecf20Sopenharmony_ci	Usage: optional (pm8058 only)
878c2ecf20Sopenharmony_ci	Value type: <phandle>
888c2ecf20Sopenharmony_ci	Definition: reference to regulator supplying the input pin, as
898c2ecf20Sopenharmony_ci		    described in the data sheet
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci- lvs0_in-supply:
928c2ecf20Sopenharmony_ci- lvs1_in-supply:
938c2ecf20Sopenharmony_ci- lvs2_in-supply:
948c2ecf20Sopenharmony_ci- lvs3_in-supply:
958c2ecf20Sopenharmony_ci- mvs_in-supply:
968c2ecf20Sopenharmony_ci- vdd_l0-supply:
978c2ecf20Sopenharmony_ci- vdd_l1-supply:
988c2ecf20Sopenharmony_ci- vdd_l2-supply:
998c2ecf20Sopenharmony_ci- vdd_l3-supply:
1008c2ecf20Sopenharmony_ci- vdd_l4-supply:
1018c2ecf20Sopenharmony_ci- vdd_l5-supply:
1028c2ecf20Sopenharmony_ci- vdd_l6-supply:
1038c2ecf20Sopenharmony_ci- vdd_s0-supply:
1048c2ecf20Sopenharmony_ci- vdd_s1-supply:
1058c2ecf20Sopenharmony_ci- vdd_s2-supply:
1068c2ecf20Sopenharmony_ci- vdd_s3-supply:
1078c2ecf20Sopenharmony_ci- vdd_s4-supply:
1088c2ecf20Sopenharmony_ci	Usage: optional (pm8901 only)
1098c2ecf20Sopenharmony_ci	Value type: <phandle>
1108c2ecf20Sopenharmony_ci	Definition: reference to regulator supplying the input pin, as
1118c2ecf20Sopenharmony_ci		    described in the data sheet
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci- vdd_l1_l2_l12_l18-supply:
1148c2ecf20Sopenharmony_ci- vdd_l3_l15_l17-supply:
1158c2ecf20Sopenharmony_ci- vdd_l4_l14-supply:
1168c2ecf20Sopenharmony_ci- vdd_l5_l8_l16-supply:
1178c2ecf20Sopenharmony_ci- vdd_l6_l7-supply:
1188c2ecf20Sopenharmony_ci- vdd_l9_l11-supply:
1198c2ecf20Sopenharmony_ci- vdd_l10_l22-supply:
1208c2ecf20Sopenharmony_ci- vdd_l21_l23_l29-supply:
1218c2ecf20Sopenharmony_ci- vdd_l24-supply:
1228c2ecf20Sopenharmony_ci- vdd_l25-supply:
1238c2ecf20Sopenharmony_ci- vdd_l26-supply:
1248c2ecf20Sopenharmony_ci- vdd_l27-supply:
1258c2ecf20Sopenharmony_ci- vdd_l28-supply:
1268c2ecf20Sopenharmony_ci- vdd_ncp-supply:
1278c2ecf20Sopenharmony_ci- vdd_s1-supply:
1288c2ecf20Sopenharmony_ci- vdd_s2-supply:
1298c2ecf20Sopenharmony_ci- vdd_s4-supply:
1308c2ecf20Sopenharmony_ci- vdd_s5-supply:
1318c2ecf20Sopenharmony_ci- vdd_s6-supply:
1328c2ecf20Sopenharmony_ci- vdd_s7-supply:
1338c2ecf20Sopenharmony_ci- vdd_s8-supply:
1348c2ecf20Sopenharmony_ci- vin_5vs-supply:
1358c2ecf20Sopenharmony_ci- vin_lvs1_3_6-supply:
1368c2ecf20Sopenharmony_ci- vin_lvs2-supply:
1378c2ecf20Sopenharmony_ci- vin_lvs4_5_7-supply:
1388c2ecf20Sopenharmony_ci	Usage: optional (pm8921 only)
1398c2ecf20Sopenharmony_ci	Value type: <phandle>
1408c2ecf20Sopenharmony_ci	Definition: reference to regulator supplying the input pin, as
1418c2ecf20Sopenharmony_ci		    described in the data sheet
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci- vin_lvs1-supply:
1448c2ecf20Sopenharmony_ci- vdd_l7-supply:
1458c2ecf20Sopenharmony_ci- vdd_l8-supply:
1468c2ecf20Sopenharmony_ci- vdd_l9_l10_l11_l12-supply:
1478c2ecf20Sopenharmony_ci	Usage: optional (pm8018 only)
1488c2ecf20Sopenharmony_ci	Value type: <phandle>
1498c2ecf20Sopenharmony_ci	Definition: reference to regulator supplying the input pin, as
1508c2ecf20Sopenharmony_ci		    described in the data sheet
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ciThe regulator node houses sub-nodes for each regulator within the device. Each
1538c2ecf20Sopenharmony_cisub-node is identified using the node's name, with valid values listed for each
1548c2ecf20Sopenharmony_ciof the pmics below.
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_cipm8058:
1578c2ecf20Sopenharmony_ci	l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15,
1588c2ecf20Sopenharmony_ci	l16, l17, l18, l19, l20, l21, l22, l23, l24, l25, s0, s1, s2, s3, s4,
1598c2ecf20Sopenharmony_ci	lvs0, lvs1, ncp
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_cipm8901:
1628c2ecf20Sopenharmony_ci	l0, l1, l2, l3, l4, l5, l6, s0, s1, s2, s3, s4, lvs0, lvs1, lvs2, lvs3,
1638c2ecf20Sopenharmony_ci	mvs
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_cipm8921:
1668c2ecf20Sopenharmony_ci	s1, s2, s3, s4, s7, s8, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
1678c2ecf20Sopenharmony_ci	l12, l14, l15, l16, l17, l18, l21, l22, l23, l24, l25, l26, l27, l28,
1688c2ecf20Sopenharmony_ci	l29, lvs1, lvs2, lvs3, lvs4, lvs5, lvs6, lvs7, usb-switch, hdmi-switch,
1698c2ecf20Sopenharmony_ci	ncp
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_cipm8018:
1728c2ecf20Sopenharmony_ci	s1, s2, s3, s4, s5, , l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
1738c2ecf20Sopenharmony_ci	l12, l14, lvs1
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_cismb208:
1768c2ecf20Sopenharmony_ci	s1a, s1b, s2a, s2b
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ciThe content of each sub-node is defined by the standard binding for regulators -
1798c2ecf20Sopenharmony_cisee regulator.txt - with additional custom properties described below:
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci=== Switch-mode Power Supply regulator custom properties
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci- bias-pull-down:
1848c2ecf20Sopenharmony_ci	Usage: optional
1858c2ecf20Sopenharmony_ci	Value type: <empty>
1868c2ecf20Sopenharmony_ci	Definition: enable pull down of the regulator when inactive
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci- qcom,switch-mode-frequency:
1898c2ecf20Sopenharmony_ci	Usage: required
1908c2ecf20Sopenharmony_ci	Value type: <u32>
1918c2ecf20Sopenharmony_ci	Definition: Frequency (Hz) of the switch-mode power supply;
1928c2ecf20Sopenharmony_ci		    must be one of:
1938c2ecf20Sopenharmony_ci		    19200000, 9600000, 6400000, 4800000, 3840000, 3200000,
1948c2ecf20Sopenharmony_ci		    2740000, 2400000, 2130000, 1920000, 1750000, 1600000,
1958c2ecf20Sopenharmony_ci		    1480000, 1370000, 1280000, 1200000
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci- qcom,force-mode:
1988c2ecf20Sopenharmony_ci	Usage: optional (default if no other qcom,force-mode is specified)
1998c2ecf20Sopenharmony_ci	Value type: <u32>
2008c2ecf20Sopenharmony_ci	Definition: indicates that the regulator should be forced to a
2018c2ecf20Sopenharmony_ci		   particular mode, valid values are:
2028c2ecf20Sopenharmony_ci		   QCOM_RPM_FORCE_MODE_NONE - do not force any mode
2038c2ecf20Sopenharmony_ci		   QCOM_RPM_FORCE_MODE_LPM - force into low power mode
2048c2ecf20Sopenharmony_ci		   QCOM_RPM_FORCE_MODE_HPM - force into high power mode
2058c2ecf20Sopenharmony_ci		   QCOM_RPM_FORCE_MODE_AUTO - allow regulator to automatically
2068c2ecf20Sopenharmony_ci					      select its own mode based on
2078c2ecf20Sopenharmony_ci					      realtime current draw, only for:
2088c2ecf20Sopenharmony_ci					      pm8921 smps and ftsmps
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci- qcom,power-mode-hysteretic:
2118c2ecf20Sopenharmony_ci	Usage: optional
2128c2ecf20Sopenharmony_ci	Value type: <empty>
2138c2ecf20Sopenharmony_ci	Definition: select that the power supply should operate in hysteretic
2148c2ecf20Sopenharmony_ci		    mode, instead of the default pwm mode
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci=== Low-dropout regulator custom properties
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci- bias-pull-down:
2198c2ecf20Sopenharmony_ci	Usage: optional
2208c2ecf20Sopenharmony_ci	Value type: <empty>
2218c2ecf20Sopenharmony_ci	Definition: enable pull down of the regulator when inactive
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci- qcom,force-mode:
2248c2ecf20Sopenharmony_ci	Usage: optional
2258c2ecf20Sopenharmony_ci	Value type: <u32>
2268c2ecf20Sopenharmony_ci	Definition: indicates that the regulator should not be forced to any
2278c2ecf20Sopenharmony_ci		   particular mode, valid values are:
2288c2ecf20Sopenharmony_ci		   QCOM_RPM_FORCE_MODE_NONE - do not force any mode
2298c2ecf20Sopenharmony_ci		   QCOM_RPM_FORCE_MODE_LPM - force into low power mode
2308c2ecf20Sopenharmony_ci		   QCOM_RPM_FORCE_MODE_HPM - force into high power mode
2318c2ecf20Sopenharmony_ci		   QCOM_RPM_FORCE_MODE_BYPASS - set regulator to use bypass
2328c2ecf20Sopenharmony_ci						mode, i.e.  to act as a switch
2338c2ecf20Sopenharmony_ci						and not regulate, only for:
2348c2ecf20Sopenharmony_ci						pm8921 pldo, nldo and nldo1200
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci=== Negative Charge Pump custom properties
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci- qcom,switch-mode-frequency:
2398c2ecf20Sopenharmony_ci	Usage: required
2408c2ecf20Sopenharmony_ci	Value type: <u32>
2418c2ecf20Sopenharmony_ci	Definition: Frequency (Hz) of the switch mode power supply;
2428c2ecf20Sopenharmony_ci		    must be one of:
2438c2ecf20Sopenharmony_ci		    19200000, 9600000, 6400000, 4800000, 3840000, 3200000,
2448c2ecf20Sopenharmony_ci		    2740000, 2400000, 2130000, 1920000, 1750000, 1600000,
2458c2ecf20Sopenharmony_ci		    1480000, 1370000, 1280000, 1200000
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci= EXAMPLE
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci	#include <dt-bindings/mfd/qcom-rpm.h>
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci	rpm@108000 {
2528c2ecf20Sopenharmony_ci		compatible = "qcom,rpm-msm8960";
2538c2ecf20Sopenharmony_ci		reg = <0x108000 0x1000>;
2548c2ecf20Sopenharmony_ci		qcom,ipc = <&apcs 0x8 2>;
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci		interrupts = <0 19 0>, <0 21 0>, <0 22 0>;
2578c2ecf20Sopenharmony_ci		interrupt-names = "ack", "err", "wakeup";
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci		regulators {
2608c2ecf20Sopenharmony_ci			compatible = "qcom,rpm-pm8921-regulators";
2618c2ecf20Sopenharmony_ci			vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci			s1 {
2648c2ecf20Sopenharmony_ci				regulator-min-microvolt = <1225000>;
2658c2ecf20Sopenharmony_ci				regulator-max-microvolt = <1225000>;
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci				bias-pull-down;
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ci				qcom,switch-mode-frequency = <3200000>;
2708c2ecf20Sopenharmony_ci			};
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ci			pm8921_s4: s4 {
2738c2ecf20Sopenharmony_ci				regulator-min-microvolt = <1800000>;
2748c2ecf20Sopenharmony_ci				regulator-max-microvolt = <1800000>;
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_ci				qcom,switch-mode-frequency = <1600000>;
2778c2ecf20Sopenharmony_ci				bias-pull-down;
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci				qcom,force-mode = <QCOM_RPM_FORCE_MODE_AUTO>;
2808c2ecf20Sopenharmony_ci			};
2818c2ecf20Sopenharmony_ci		};
2828c2ecf20Sopenharmony_ci	};
2838c2ecf20Sopenharmony_ci
284