18c2ecf20Sopenharmony_ciBinding for Samsung S5M8767 regulator block
28c2ecf20Sopenharmony_ci===========================================
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciThis is a part of device tree bindings for S5M family multi-function devices.
58c2ecf20Sopenharmony_ciMore information can be found in bindings/mfd/sec-core.txt file.
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciThe S5M8767 device provide buck and LDO regulators.
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciTo register these with regulator framework instantiate under main device node
108c2ecf20Sopenharmony_cia sub-node named "regulators" with more sub-nodes for each regulator using the
118c2ecf20Sopenharmony_cicommon regulator binding documented in:
128c2ecf20Sopenharmony_ci - Documentation/devicetree/bindings/regulator/regulator.txt
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciRequired properties of the main device node (the parent!):
168c2ecf20Sopenharmony_ci - s5m8767,pmic-buck-ds-gpios: GPIO specifiers for three host gpio's used
178c2ecf20Sopenharmony_ci   for selecting GPIO DVS lines. It is one-to-one mapped to dvs gpio lines.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci [1] If either of the 's5m8767,pmic-buck[2/3/4]-uses-gpio-dvs' optional
208c2ecf20Sopenharmony_ci     property is specified, then all the eight voltage values for the
218c2ecf20Sopenharmony_ci     's5m8767,pmic-buck[2/3/4]-dvs-voltage' should be specified.
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ciOptional properties of the main device node (the parent!):
248c2ecf20Sopenharmony_ci - s5m8767,pmic-buck2-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
258c2ecf20Sopenharmony_ci   units for buck2 when changing voltage using gpio dvs. Refer to [1] below
268c2ecf20Sopenharmony_ci   for additional information.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci - s5m8767,pmic-buck3-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
298c2ecf20Sopenharmony_ci   units for buck3 when changing voltage using gpio dvs. Refer to [1] below
308c2ecf20Sopenharmony_ci   for additional information.
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci - s5m8767,pmic-buck4-dvs-voltage: A set of 8 voltage values in micro-volt (uV)
338c2ecf20Sopenharmony_ci   units for buck4 when changing voltage using gpio dvs. Refer to [1] below
348c2ecf20Sopenharmony_ci   for additional information.
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci - s5m8767,pmic-buck2-uses-gpio-dvs: 'buck2' can be controlled by gpio dvs.
378c2ecf20Sopenharmony_ci - s5m8767,pmic-buck3-uses-gpio-dvs: 'buck3' can be controlled by gpio dvs.
388c2ecf20Sopenharmony_ci - s5m8767,pmic-buck4-uses-gpio-dvs: 'buck4' can be controlled by gpio dvs.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciAdditional properties required if either of the optional properties are used:
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci - s5m8767,pmic-buck-default-dvs-idx: Default voltage setting selected from
438c2ecf20Sopenharmony_ci   the possible 8 options selectable by the dvs gpios. The value of this
448c2ecf20Sopenharmony_ci   property should be between 0 and 7. If not specified or if out of range, the
458c2ecf20Sopenharmony_ci   default value of this property is set to 0.
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci - s5m8767,pmic-buck-dvs-gpios: GPIO specifiers for three host gpio's used
488c2ecf20Sopenharmony_ci   for dvs. The format of the gpio specifier depends in the gpio controller.
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciNames of regulators supported by S5M8767 device:
528c2ecf20Sopenharmony_ci	- LDOn
538c2ecf20Sopenharmony_ci		  - valid values for n are 1 to 28
548c2ecf20Sopenharmony_ci		  - Example: LDO1, LDO2, LDO28
558c2ecf20Sopenharmony_ci	- BUCKn
568c2ecf20Sopenharmony_ci		  - valid values for n are 1 to 9.
578c2ecf20Sopenharmony_ci		  - Example: BUCK1, BUCK2, BUCK9
588c2ecf20Sopenharmony_ciNote: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
598c2ecf20Sopenharmony_cias per the datasheet of device.
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ciOptional properties of the nodes under "regulators" sub-node:
638c2ecf20Sopenharmony_ci - op_mode: describes the different operating modes of the LDO's with
648c2ecf20Sopenharmony_ci            power mode change in SOC. The different possible values are,
658c2ecf20Sopenharmony_ci             0 - always off mode
668c2ecf20Sopenharmony_ci             1 - on in normal mode
678c2ecf20Sopenharmony_ci             2 - low power mode
688c2ecf20Sopenharmony_ci             3 - suspend mode
698c2ecf20Sopenharmony_ci - s5m8767,pmic-ext-control-gpios: (optional) GPIO specifier for one
708c2ecf20Sopenharmony_ci                                   GPIO controlling this regulator
718c2ecf20Sopenharmony_ci                                   (enable/disable); This is valid only
728c2ecf20Sopenharmony_ci                                   for buck9.
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ciExample:
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci	s5m8767_pmic@66 {
778c2ecf20Sopenharmony_ci		compatible = "samsung,s5m8767-pmic";
788c2ecf20Sopenharmony_ci		reg = <0x66>;
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci		s5m8767,pmic-buck2-uses-gpio-dvs;
818c2ecf20Sopenharmony_ci		s5m8767,pmic-buck3-uses-gpio-dvs;
828c2ecf20Sopenharmony_ci		s5m8767,pmic-buck4-uses-gpio-dvs;
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci		s5m8767,pmic-buck-default-dvs-idx = <0>;
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci		s5m8767,pmic-buck-dvs-gpios = <&gpx0 0 0>, /* DVS1 */
878c2ecf20Sopenharmony_ci						 <&gpx0 1 0>, /* DVS2 */
888c2ecf20Sopenharmony_ci						 <&gpx0 2 0>; /* DVS3 */
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci		s5m8767,pmic-buck-ds-gpios = <&gpx2 3 0>, /* SET1 */
918c2ecf20Sopenharmony_ci						<&gpx2 4 0>, /* SET2 */
928c2ecf20Sopenharmony_ci						<&gpx2 5 0>; /* SET3 */
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci		s5m8767,pmic-buck2-dvs-voltage = <1350000>, <1300000>,
958c2ecf20Sopenharmony_ci						 <1250000>, <1200000>,
968c2ecf20Sopenharmony_ci						 <1150000>, <1100000>,
978c2ecf20Sopenharmony_ci						 <1000000>, <950000>;
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci		s5m8767,pmic-buck3-dvs-voltage = <1100000>, <1100000>,
1008c2ecf20Sopenharmony_ci						 <1100000>, <1100000>,
1018c2ecf20Sopenharmony_ci						 <1000000>, <1000000>,
1028c2ecf20Sopenharmony_ci						 <1000000>, <1000000>;
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci		s5m8767,pmic-buck4-dvs-voltage = <1200000>, <1200000>,
1058c2ecf20Sopenharmony_ci						 <1200000>, <1200000>,
1068c2ecf20Sopenharmony_ci						 <1200000>, <1200000>,
1078c2ecf20Sopenharmony_ci						 <1200000>, <1200000>;
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci		regulators {
1108c2ecf20Sopenharmony_ci			ldo1_reg: LDO1 {
1118c2ecf20Sopenharmony_ci				regulator-name = "VDD_ABB_3.3V";
1128c2ecf20Sopenharmony_ci				regulator-min-microvolt = <3300000>;
1138c2ecf20Sopenharmony_ci				regulator-max-microvolt = <3300000>;
1148c2ecf20Sopenharmony_ci				op_mode = <1>; /* Normal Mode */
1158c2ecf20Sopenharmony_ci			};
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci			ldo2_reg: LDO2 {
1188c2ecf20Sopenharmony_ci				regulator-name = "VDD_ALIVE_1.1V";
1198c2ecf20Sopenharmony_ci				regulator-min-microvolt = <1100000>;
1208c2ecf20Sopenharmony_ci				regulator-max-microvolt = <1100000>;
1218c2ecf20Sopenharmony_ci				regulator-always-on;
1228c2ecf20Sopenharmony_ci			};
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci			buck1_reg: BUCK1 {
1258c2ecf20Sopenharmony_ci				regulator-name = "VDD_MIF_1.2V";
1268c2ecf20Sopenharmony_ci				regulator-min-microvolt = <950000>;
1278c2ecf20Sopenharmony_ci				regulator-max-microvolt = <1350000>;
1288c2ecf20Sopenharmony_ci				regulator-always-on;
1298c2ecf20Sopenharmony_ci				regulator-boot-on;
1308c2ecf20Sopenharmony_ci			};
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci			vemmc_reg: BUCK9 {
1338c2ecf20Sopenharmony_ci				regulator-name = "VMEM_VDD_2.8V";
1348c2ecf20Sopenharmony_ci				regulator-min-microvolt = <2800000>;
1358c2ecf20Sopenharmony_ci				regulator-max-microvolt = <2800000>;
1368c2ecf20Sopenharmony_ci				op_mode = <3>; /* Standby Mode */
1378c2ecf20Sopenharmony_ci				s5m8767,pmic-ext-control-gpios = <&gpk0 2 0>;
1388c2ecf20Sopenharmony_ci			};
1398c2ecf20Sopenharmony_ci		};
1408c2ecf20Sopenharmony_ci	};
141