162306a36Sopenharmony_ci* Maxim MAX8998, National/TI LP3974 multi-function device
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciThe Maxim MAX8998 is a multi-function device which includes voltage/current
462306a36Sopenharmony_ciregulators, real time clock, battery charging controller and several
562306a36Sopenharmony_ciother sub-blocks. It is interfaced using an I2C interface. Each sub-block
662306a36Sopenharmony_ciis addressed by the host system using different i2c slave address.
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciPMIC sub-block
962306a36Sopenharmony_ci--------------
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ciThe PMIC sub-block contains a number of voltage and current regulators,
1262306a36Sopenharmony_ciwith controllable parameters and dynamic voltage scaling capability.
1362306a36Sopenharmony_ciIn addition, it includes a real time clock and battery charging controller
1462306a36Sopenharmony_cias well. It is accessible at I2C address 0x66.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciRequired properties:
1762306a36Sopenharmony_ci- compatible: Should be one of the following:
1862306a36Sopenharmony_ci    - "maxim,max8998" for Maxim MAX8998
1962306a36Sopenharmony_ci    - "national,lp3974" or "ti,lp3974" for National/TI LP3974.
2062306a36Sopenharmony_ci- reg: Specifies the i2c slave address of the pmic block. It should be 0x66.
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ciOptional properties:
2362306a36Sopenharmony_ci- interrupts: Interrupt specifiers for two interrupt sources.
2462306a36Sopenharmony_ci  - First interrupt specifier is for main interrupt.
2562306a36Sopenharmony_ci  - Second interrupt specifier is for power-on/-off interrupt.
2662306a36Sopenharmony_ci- max8998,pmic-buck1-dvs-gpios: GPIO specifiers for two host gpios used
2762306a36Sopenharmony_ci  for buck 1 dvs. The format of the gpio specifier depends on the gpio
2862306a36Sopenharmony_ci  controller.
2962306a36Sopenharmony_ci- max8998,pmic-buck2-dvs-gpio: GPIO specifier for host gpio used
3062306a36Sopenharmony_ci  for buck 2 dvs. The format of the gpio specifier depends on the gpio
3162306a36Sopenharmony_ci  controller.
3262306a36Sopenharmony_ci- max8998,pmic-buck1-default-dvs-idx: Default voltage setting selected from
3362306a36Sopenharmony_ci  the possible 4 options selectable by the dvs gpios. The value of this
3462306a36Sopenharmony_ci  property should be 0, 1, 2 or 3. If not specified or out of range,
3562306a36Sopenharmony_ci  a default value of 0 is taken.
3662306a36Sopenharmony_ci- max8998,pmic-buck2-default-dvs-idx: Default voltage setting selected from
3762306a36Sopenharmony_ci  the possible 2 options selectable by the dvs gpios. The value of this
3862306a36Sopenharmony_ci  property should be 0 or 1. If not specified or out of range, a default
3962306a36Sopenharmony_ci  value of 0 is taken.
4062306a36Sopenharmony_ci- max8998,pmic-buck-voltage-lock: If present, disallows changing of
4162306a36Sopenharmony_ci  preprogrammed buck dvfs voltages.
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ciAdditional properties required if max8998,pmic-buck1-dvs-gpios is defined:
4462306a36Sopenharmony_ci- max8998,pmic-buck1-dvs-voltage: An array of 4 voltage values in microvolts
4562306a36Sopenharmony_ci  for buck1 regulator that can be selected using dvs gpio.
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ciAdditional properties required if max8998,pmic-buck2-dvs-gpio is defined:
4862306a36Sopenharmony_ci- max8998,pmic-buck2-dvs-voltage: An array of 2 voltage values in microvolts
4962306a36Sopenharmony_ci  for buck2 regulator that can be selected using dvs gpio.
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ciRegulators: All the regulators of MAX8998 to be instantiated shall be
5262306a36Sopenharmony_cilisted in a child node named 'regulators'. Each regulator is represented
5362306a36Sopenharmony_ciby a child node of the 'regulators' node.
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci	regulator-name {
5662306a36Sopenharmony_ci		/* standard regulator bindings here */
5762306a36Sopenharmony_ci	};
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ciFollowing regulators of the MAX8998 PMIC block are supported. Note that
6062306a36Sopenharmony_cithe 'n' in regulator name, as in LDOn or BUCKn, represents the LDO or BUCK
6162306a36Sopenharmony_cinumber as described in MAX8998 datasheet.
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci	- LDOn
6462306a36Sopenharmony_ci		  - valid values for n are 2 to 17
6562306a36Sopenharmony_ci		  - Example: LDO2, LDO10, LDO17
6662306a36Sopenharmony_ci	- BUCKn
6762306a36Sopenharmony_ci		  - valid values for n are 1 to 4.
6862306a36Sopenharmony_ci		  - Example: BUCK1, BUCK2, BUCK3, BUCK4
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci	- ENVICHG: Battery Charging Current Monitor Output. This is a fixed
7162306a36Sopenharmony_ci		   voltage type regulator
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci	- ESAFEOUT1: (ldo19)
7462306a36Sopenharmony_ci	- ESAFEOUT2: (ld020)
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci	- CHARGER: main battery charger current control
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ciStandard regulator bindings are used inside regulator subnodes. Check
7962306a36Sopenharmony_ci  Documentation/devicetree/bindings/regulator/regulator.txt
8062306a36Sopenharmony_cifor more details.
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ciExample:
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci	pmic@66 {
8562306a36Sopenharmony_ci		compatible = "maxim,max8998-pmic";
8662306a36Sopenharmony_ci		reg = <0x66>;
8762306a36Sopenharmony_ci		interrupt-parent = <&wakeup_eint>;
8862306a36Sopenharmony_ci		interrupts = <4 0>, <3 0>;
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci		/* Buck 1 DVS settings */
9162306a36Sopenharmony_ci		max8998,pmic-buck1-default-dvs-idx = <0>;
9262306a36Sopenharmony_ci		max8998,pmic-buck1-dvs-gpios = <&gpx0 0 1 0 0>, /* SET1 */
9362306a36Sopenharmony_ci					       <&gpx0 1 1 0 0>; /* SET2 */
9462306a36Sopenharmony_ci		max8998,pmic-buck1-dvs-voltage = <1350000>, <1300000>,
9562306a36Sopenharmony_ci						 <1000000>, <950000>;
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci		/* Buck 2 DVS settings */
9862306a36Sopenharmony_ci		max8998,pmic-buck2-default-dvs-idx = <0>;
9962306a36Sopenharmony_ci		max8998,pmic-buck2-dvs-gpio = <&gpx0 0 3 0 0>; /* SET3 */
10062306a36Sopenharmony_ci		max8998,pmic-buck2-dvs-voltage = <1350000>, <1300000>;
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci		/* Regulators to instantiate */
10362306a36Sopenharmony_ci		regulators {
10462306a36Sopenharmony_ci			ldo2_reg: LDO2 {
10562306a36Sopenharmony_ci				regulator-name = "VDD_ALIVE_1.1V";
10662306a36Sopenharmony_ci				regulator-min-microvolt = <1100000>;
10762306a36Sopenharmony_ci				regulator-max-microvolt = <1100000>;
10862306a36Sopenharmony_ci				regulator-always-on;
10962306a36Sopenharmony_ci			};
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci			buck1_reg: BUCK1 {
11262306a36Sopenharmony_ci				regulator-name = "VDD_ARM_1.2V";
11362306a36Sopenharmony_ci				regulator-min-microvolt = <950000>;
11462306a36Sopenharmony_ci				regulator-max-microvolt = <1350000>;
11562306a36Sopenharmony_ci				regulator-always-on;
11662306a36Sopenharmony_ci				regulator-boot-on;
11762306a36Sopenharmony_ci			};
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci			charger_reg: CHARGER {
12062306a36Sopenharmony_ci				regulator-name = "CHARGER";
12162306a36Sopenharmony_ci				regulator-min-microamp = <90000>;
12262306a36Sopenharmony_ci				regulator-max-microamp = <800000>;
12362306a36Sopenharmony_ci			};
12462306a36Sopenharmony_ci		};
12562306a36Sopenharmony_ci	};
126