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