162306a36Sopenharmony_ci* ams AS3722 Power management IC. 262306a36Sopenharmony_ci 362306a36Sopenharmony_ciRequired properties: 462306a36Sopenharmony_ci------------------- 562306a36Sopenharmony_ci- compatible: Must be "ams,as3722". 662306a36Sopenharmony_ci- reg: I2C device address. 762306a36Sopenharmony_ci- interrupt-controller: AS3722 has internal interrupt controller which takes the 862306a36Sopenharmony_ci interrupt request from internal sub-blocks like RTC, regulators, GPIOs as well 962306a36Sopenharmony_ci as external input. 1062306a36Sopenharmony_ci- #interrupt-cells: Should be set to 2 for IRQ number and flags. 1162306a36Sopenharmony_ci The first cell is the IRQ number. IRQ numbers for different interrupt source 1262306a36Sopenharmony_ci of AS3722 are defined at dt-bindings/mfd/as3722.h 1362306a36Sopenharmony_ci The second cell is the flags, encoded as the trigger masks from binding document 1462306a36Sopenharmony_ci interrupts.txt, using dt-bindings/irq. 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ciOptional properties: 1762306a36Sopenharmony_ci-------------------- 1862306a36Sopenharmony_ci- ams,enable-internal-int-pullup: Boolean property, to enable internal pullup on 1962306a36Sopenharmony_ci interrupt pin. Missing this will disable internal pullup on INT pin. 2062306a36Sopenharmony_ci- ams,enable-internal-i2c-pullup: Boolean property, to enable internal pullup on 2162306a36Sopenharmony_ci i2c scl/sda pins. Missing this will disable internal pullup on i2c 2262306a36Sopenharmony_ci scl/sda lines. 2362306a36Sopenharmony_ci- ams,enable-ac-ok-power-on: Boolean property, to enable exit out of power off 2462306a36Sopenharmony_ci mode with AC_OK pin (pin enabled in power off mode). 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ciOptional submodule and their properties: 2762306a36Sopenharmony_ci======================================= 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ciPinmux and GPIO: 3062306a36Sopenharmony_ci=============== 3162306a36Sopenharmony_ciDevice has 8 GPIO pins which can be configured as GPIO as well as the special IO 3262306a36Sopenharmony_cifunctions. 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ciPlease refer to pinctrl-bindings.txt in this directory for details of the 3562306a36Sopenharmony_cicommon pinctrl bindings used by client devices, including the meaning of the 3662306a36Sopenharmony_ciphrase "pin configuration node". 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ciFollowing are properties which is needed if GPIO and pinmux functionality 3962306a36Sopenharmony_ciis required: 4062306a36Sopenharmony_ci Required properties: 4162306a36Sopenharmony_ci ------------------- 4262306a36Sopenharmony_ci - gpio-controller: Marks the device node as a GPIO controller. 4362306a36Sopenharmony_ci - #gpio-cells: Number of GPIO cells. Refer to binding document 4462306a36Sopenharmony_ci gpio/gpio.txt 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ci Optional properties: 4762306a36Sopenharmony_ci -------------------- 4862306a36Sopenharmony_ci Following properties are require if pin control setting is required 4962306a36Sopenharmony_ci at boot. 5062306a36Sopenharmony_ci - pinctrl-names: A pinctrl state named "default" be defined, using the 5162306a36Sopenharmony_ci bindings in pinctrl/pinctrl-bindings.txt. 5262306a36Sopenharmony_ci - pinctrl[0...n]: Properties to contain the phandle that refer to 5362306a36Sopenharmony_ci different nodes of pin control settings. These nodes represents 5462306a36Sopenharmony_ci the pin control setting of state 0 to state n. Each of these 5562306a36Sopenharmony_ci nodes contains different subnodes to represents some desired 5662306a36Sopenharmony_ci configuration for a list of pins. This configuration can 5762306a36Sopenharmony_ci include the mux function to select on those pin(s), and 5862306a36Sopenharmony_ci various pin configuration parameters, such as pull-up, 5962306a36Sopenharmony_ci open drain. 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ci Each subnode have following properties: 6262306a36Sopenharmony_ci Required properties: 6362306a36Sopenharmony_ci - pins: List of pins. Valid values of pins properties are: 6462306a36Sopenharmony_ci gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, 6562306a36Sopenharmony_ci gpio6, gpio7 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci Optional properties: 6862306a36Sopenharmony_ci function, bias-disable, bias-pull-up, bias-pull-down, 6962306a36Sopenharmony_ci bias-high-impedance, drive-open-drain. 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci Valid values for function properties are: 7262306a36Sopenharmony_ci gpio, interrupt-out, gpio-in-interrupt, 7362306a36Sopenharmony_ci vsup-vbat-low-undebounce-out, 7462306a36Sopenharmony_ci vsup-vbat-low-debounce-out, 7562306a36Sopenharmony_ci voltage-in-standby, oc-pg-sd0, oc-pg-sd6, 7662306a36Sopenharmony_ci powergood-out, pwm-in, pwm-out, clk32k-out, 7762306a36Sopenharmony_ci watchdog-in, soft-reset-in 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ciRegulators: 8062306a36Sopenharmony_ci=========== 8162306a36Sopenharmony_ciDevice has multiple DCDC and LDOs. The node "regulators" is require if regulator 8262306a36Sopenharmony_cifunctionality is needed. 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ciFollowing are properties of regulator subnode. 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_ci Optional properties: 8762306a36Sopenharmony_ci ------------------- 8862306a36Sopenharmony_ci The input supply of regulators are the optional properties on the 8962306a36Sopenharmony_ci regulator node. The input supply of these regulators are provided 9062306a36Sopenharmony_ci through following properties: 9162306a36Sopenharmony_ci vsup-sd2-supply: Input supply for SD2. 9262306a36Sopenharmony_ci vsup-sd3-supply: Input supply for SD3. 9362306a36Sopenharmony_ci vsup-sd4-supply: Input supply for SD4. 9462306a36Sopenharmony_ci vsup-sd5-supply: Input supply for SD5. 9562306a36Sopenharmony_ci vin-ldo0-supply: Input supply for LDO0. 9662306a36Sopenharmony_ci vin-ldo1-6-supply: Input supply for LDO1 and LDO6. 9762306a36Sopenharmony_ci vin-ldo2-5-7-supply: Input supply for LDO2, LDO5 and LDO7. 9862306a36Sopenharmony_ci vin-ldo3-4-supply: Input supply for LDO3 and LDO4. 9962306a36Sopenharmony_ci vin-ldo9-10-supply: Input supply for LDO9 and LDO10. 10062306a36Sopenharmony_ci vin-ldo11-supply: Input supply for LDO11. 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ci Optional sub nodes for regulators: 10362306a36Sopenharmony_ci --------------------------------- 10462306a36Sopenharmony_ci The subnodes name is the name of regulator and it must be one of: 10562306a36Sopenharmony_ci sd[0-6], ldo[0-7], ldo[9-11] 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci Each sub-node should contain the constraints and initialization 10862306a36Sopenharmony_ci information for that regulator. See regulator.txt for a description 10962306a36Sopenharmony_ci of standard properties for these sub-nodes. 11062306a36Sopenharmony_ci Additional optional custom properties are listed below. 11162306a36Sopenharmony_ci ams,ext-control: External control of the rail. The option of 11262306a36Sopenharmony_ci this properties will tell which external input is 11362306a36Sopenharmony_ci controlling this rail. Valid values are 0, 1, 2 ad 3. 11462306a36Sopenharmony_ci 0: There is no external control of this rail. 11562306a36Sopenharmony_ci 1: Rail is controlled by ENABLE1 input pin. 11662306a36Sopenharmony_ci 2: Rail is controlled by ENABLE2 input pin. 11762306a36Sopenharmony_ci 3: Rail is controlled by ENABLE3 input pin. 11862306a36Sopenharmony_ci Missing this property on DT will be assume as no 11962306a36Sopenharmony_ci external control. The external control pin macros 12062306a36Sopenharmony_ci are defined @dt-bindings/mfd/as3722.h 12162306a36Sopenharmony_ci 12262306a36Sopenharmony_ci ams,enable-tracking: Enable tracking with SD1, only supported 12362306a36Sopenharmony_ci by LDO3. 12462306a36Sopenharmony_ci 12562306a36Sopenharmony_ciPower-off: 12662306a36Sopenharmony_ci========= 12762306a36Sopenharmony_ciAS3722 supports the system power off by turning off all its rails. 12862306a36Sopenharmony_ciThe device node should have the following properties to enable this 12962306a36Sopenharmony_cifunctionality 13062306a36Sopenharmony_ciams,system-power-controller: Boolean, to enable the power off functionality 13162306a36Sopenharmony_ci through this device. 13262306a36Sopenharmony_ci 13362306a36Sopenharmony_ciExample: 13462306a36Sopenharmony_ci-------- 13562306a36Sopenharmony_ci#include <dt-bindings/mfd/as3722.h> 13662306a36Sopenharmony_ci... 13762306a36Sopenharmony_ciams3722 { 13862306a36Sopenharmony_ci compatible = "ams,as3722"; 13962306a36Sopenharmony_ci reg = <0x48>; 14062306a36Sopenharmony_ci 14162306a36Sopenharmony_ci ams,system-power-controller; 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_ci interrupt-parent = <&intc>; 14462306a36Sopenharmony_ci interrupt-controller; 14562306a36Sopenharmony_ci #interrupt-cells = <2>; 14662306a36Sopenharmony_ci 14762306a36Sopenharmony_ci gpio-controller; 14862306a36Sopenharmony_ci #gpio-cells = <2>; 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ci pinctrl-names = "default"; 15162306a36Sopenharmony_ci pinctrl-0 = <&as3722_default>; 15262306a36Sopenharmony_ci 15362306a36Sopenharmony_ci as3722_default: pinmux { 15462306a36Sopenharmony_ci gpio0 { 15562306a36Sopenharmony_ci pins = "gpio0"; 15662306a36Sopenharmony_ci function = "gpio"; 15762306a36Sopenharmony_ci bias-pull-down; 15862306a36Sopenharmony_ci }; 15962306a36Sopenharmony_ci 16062306a36Sopenharmony_ci gpio1_2_4_7 { 16162306a36Sopenharmony_ci pins = "gpio1", "gpio2", "gpio4", "gpio7"; 16262306a36Sopenharmony_ci function = "gpio"; 16362306a36Sopenharmony_ci bias-pull-up; 16462306a36Sopenharmony_ci }; 16562306a36Sopenharmony_ci 16662306a36Sopenharmony_ci gpio5 { 16762306a36Sopenharmony_ci pins = "gpio5"; 16862306a36Sopenharmony_ci function = "clk32k_out"; 16962306a36Sopenharmony_ci }; 17062306a36Sopenharmony_ci } 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_ci regulators { 17362306a36Sopenharmony_ci vsup-sd2-supply = <...>; 17462306a36Sopenharmony_ci ... 17562306a36Sopenharmony_ci 17662306a36Sopenharmony_ci sd0 { 17762306a36Sopenharmony_ci regulator-name = "vdd_cpu"; 17862306a36Sopenharmony_ci regulator-min-microvolt = <700000>; 17962306a36Sopenharmony_ci regulator-max-microvolt = <1400000>; 18062306a36Sopenharmony_ci regulator-always-on; 18162306a36Sopenharmony_ci ams,ext-control = <2>; 18262306a36Sopenharmony_ci }; 18362306a36Sopenharmony_ci 18462306a36Sopenharmony_ci sd1 { 18562306a36Sopenharmony_ci regulator-name = "vdd_core"; 18662306a36Sopenharmony_ci regulator-min-microvolt = <700000>; 18762306a36Sopenharmony_ci regulator-max-microvolt = <1400000>; 18862306a36Sopenharmony_ci regulator-always-on; 18962306a36Sopenharmony_ci ams,ext-control = <1>; 19062306a36Sopenharmony_ci }; 19162306a36Sopenharmony_ci 19262306a36Sopenharmony_ci sd2 { 19362306a36Sopenharmony_ci regulator-name = "vddio_ddr"; 19462306a36Sopenharmony_ci regulator-min-microvolt = <1350000>; 19562306a36Sopenharmony_ci regulator-max-microvolt = <1350000>; 19662306a36Sopenharmony_ci regulator-always-on; 19762306a36Sopenharmony_ci }; 19862306a36Sopenharmony_ci 19962306a36Sopenharmony_ci sd4 { 20062306a36Sopenharmony_ci regulator-name = "avdd-hdmi-pex"; 20162306a36Sopenharmony_ci regulator-min-microvolt = <1050000>; 20262306a36Sopenharmony_ci regulator-max-microvolt = <1050000>; 20362306a36Sopenharmony_ci regulator-always-on; 20462306a36Sopenharmony_ci }; 20562306a36Sopenharmony_ci 20662306a36Sopenharmony_ci sd5 { 20762306a36Sopenharmony_ci regulator-name = "vdd-1v8"; 20862306a36Sopenharmony_ci regulator-min-microvolt = <1800000>; 20962306a36Sopenharmony_ci regulator-max-microvolt = <1800000>; 21062306a36Sopenharmony_ci regulator-always-on; 21162306a36Sopenharmony_ci }; 21262306a36Sopenharmony_ci .... 21362306a36Sopenharmony_ci }; 21462306a36Sopenharmony_ci}; 215