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