xref: /linux/Documentation/devicetree/bindings/mfd/as3722.txt (revision 6e2d6b2728fcb408eabd7991804f8cb33ff59f20)
1* ams AS3722 Power management IC.
2
3Required properties:
4-------------------
5- compatible: Must be "ams,as3722".
6- reg: I2C device address.
7- interrupt-controller: AS3722 has internal interrupt controller which takes the
8  interrupt request from internal sub-blocks like RTC, regulators, GPIOs as well
9  as external input.
10- #interrupt-cells: Should be set to 2 for IRQ number and flags.
11  The first cell is the IRQ number. IRQ numbers for different interrupt source
12  of AS3722 are defined at dt-bindings/mfd/as3722.h
13  The second cell is the flags, encoded as the trigger masks from binding document
14	interrupts.txt, using dt-bindings/irq.
15
16Optional properties:
17--------------------
18- ams,enable-internal-int-pullup: Boolean property, to enable internal pullup on
19	interrupt pin. Missing this will disable internal pullup on INT pin.
20- ams,enable-internal-i2c-pullup: Boolean property, to enable internal pullup on
21	i2c scl/sda pins. Missing this will disable internal pullup on i2c
22	scl/sda lines.
23- ams,enable-ac-ok-power-on: Boolean property, to enable exit out of power off
24	mode with AC_OK pin (pin enabled in power off mode).
25
26Optional submodule and their properties:
27=======================================
28
29Pinmux and GPIO:
30===============
31Device has 8 GPIO pins which can be configured as GPIO as well as the special IO
32functions.
33
34Please refer to pinctrl-bindings.txt in this directory for details of the
35common pinctrl bindings used by client devices, including the meaning of the
36phrase "pin configuration node".
37
38Following are properties which is needed if GPIO and pinmux functionality
39is required:
40    Required properties:
41    -------------------
42	- gpio-controller: Marks the device node as a GPIO controller.
43	- #gpio-cells: Number of GPIO cells. Refer to binding document
44			gpio/gpio.txt
45
46    Optional properties:
47    --------------------
48	Following properties are require if pin control setting is required
49	at boot.
50	- pinctrl-names: A pinctrl state named "default" be defined, using the
51		bindings in pinctrl/pinctrl-bindings.txt.
52	- pinctrl[0...n]: Properties to contain the phandle that refer to
53		different nodes of pin control settings. These nodes represents
54		the pin control setting of state 0 to state n. Each of these
55		nodes contains different subnodes to represents some desired
56		configuration for a list of pins. This configuration can
57		include the mux function to select on those pin(s), and
58		various pin configuration parameters, such as pull-up,
59		open drain.
60
61		Each subnode have following properties:
62		Required properties:
63		    - pins: List of pins. Valid values of pins properties are:
64				gpio0, gpio1, gpio2, gpio3, gpio4, gpio5,
65				gpio6, gpio7
66
67		Optional properties:
68			function, bias-disable, bias-pull-up, bias-pull-down,
69			bias-high-impedance, drive-open-drain.
70
71			Valid values for function properties are:
72				gpio, interrupt-out, gpio-in-interrupt,
73				vsup-vbat-low-undebounce-out,
74				vsup-vbat-low-debounce-out,
75				voltage-in-standby, oc-pg-sd0, oc-pg-sd6,
76				powergood-out, pwm-in, pwm-out, clk32k-out,
77				watchdog-in, soft-reset-in
78
79Regulators:
80===========
81Device has multiple DCDC and LDOs. The node "regulators" is require if regulator
82functionality is needed.
83
84Following are properties of regulator subnode.
85
86    Optional properties:
87    -------------------
88	The input supply of regulators are the optional properties on the
89	regulator node. The input supply of these regulators are provided
90	through following properties:
91		vsup-sd2-supply: Input supply for SD2.
92		vsup-sd3-supply: Input supply for SD3.
93		vsup-sd4-supply: Input supply for SD4.
94		vsup-sd5-supply: Input supply for SD5.
95		vin-ldo0-supply: Input supply for LDO0.
96		vin-ldo1-6-supply: Input supply for LDO1 and LDO6.
97		vin-ldo2-5-7-supply: Input supply for LDO2, LDO5 and LDO7.
98		vin-ldo3-4-supply: Input supply for LDO3 and LDO4.
99		vin-ldo9-10-supply: Input supply for LDO9 and LDO10.
100		vin-ldo11-supply: Input supply for LDO11.
101
102    Optional sub nodes for regulators:
103    ---------------------------------
104	The subnodes name is the name of regulator and it must be one of:
105	sd[0-6], ldo[0-7], ldo[9-11]
106
107	Each sub-node should contain the constraints and initialization
108	information for that regulator. See regulator.txt for a description
109	of standard properties for these sub-nodes.
110	Additional optional custom properties  are listed below.
111		ams,ext-control: External control of the rail. The option of
112			this properties will tell which external input is
113			controlling this rail. Valid values are 0, 1, 2 ad 3.
114			0: There is no external control of this rail.
115			1: Rail is controlled by ENABLE1 input pin.
116			2: Rail is controlled by ENABLE2 input pin.
117			3: Rail is controlled by ENABLE3 input pin.
118			Missing this property on DT will be assume as no
119			external control. The external control pin macros
120			are defined @dt-bindings/mfd/as3722.h
121
122		ams,enable-tracking: Enable tracking with SD1, only supported
123			by LDO3.
124
125Power-off:
126=========
127AS3722 supports the system power off by turning off all its rails.
128The device node should have the following properties to enable this
129functionality
130ams,system-power-controller: Boolean, to enable the power off functionality
131        through this device.
132
133Example:
134--------
135#include <dt-bindings/mfd/as3722.h>
136...
137ams3722 {
138	compatible = "ams,as3722";
139	reg = <0x48>;
140
141	ams,system-power-controller;
142
143	interrupt-parent = <&intc>;
144	interrupt-controller;
145	#interrupt-cells = <2>;
146
147	gpio-controller;
148	#gpio-cells = <2>;
149
150	pinctrl-names = "default";
151	pinctrl-0 = <&as3722_default>;
152
153	as3722_default: pinmux {
154			gpio0 {
155				pins = "gpio0";
156				function = "gpio";
157				bias-pull-down;
158			};
159
160			gpio1_2_4_7 {
161				pins = "gpio1", "gpio2", "gpio4", "gpio7";
162				function = "gpio";
163				bias-pull-up;
164			};
165
166			gpio5 {
167				pins = "gpio5";
168				function = "clk32k_out";
169			};
170	}
171
172	regulators {
173			vsup-sd2-supply = <...>;
174			...
175
176			sd0 {
177				regulator-name = "vdd_cpu";
178				regulator-min-microvolt = <700000>;
179				regulator-max-microvolt = <1400000>;
180				regulator-always-on;
181				ams,ext-control = <2>;
182			};
183
184			sd1 {
185				regulator-name = "vdd_core";
186				regulator-min-microvolt = <700000>;
187				regulator-max-microvolt = <1400000>;
188				regulator-always-on;
189				ams,ext-control = <1>;
190			};
191
192			sd2 {
193				regulator-name = "vddio_ddr";
194				regulator-min-microvolt = <1350000>;
195				regulator-max-microvolt = <1350000>;
196				regulator-always-on;
197			};
198
199			sd4 {
200				regulator-name = "avdd-hdmi-pex";
201				regulator-min-microvolt = <1050000>;
202				regulator-max-microvolt = <1050000>;
203				regulator-always-on;
204			};
205
206			sd5 {
207				regulator-name = "vdd-1v8";
208				regulator-min-microvolt = <1800000>;
209				regulator-max-microvolt = <1800000>;
210				regulator-always-on;
211			};
212			....
213	};
214};
215