diff options
| author | Laxman Dewangan <ldewangan@nvidia.com> | 2013-10-22 03:38:46 -0400 |
|---|---|---|
| committer | Lee Jones <lee.jones@linaro.org> | 2013-10-23 11:22:33 -0400 |
| commit | d460a6f3d67a8558fb58299518077888b7dbf5f3 (patch) | |
| tree | a6e2a066f43df97206dfa9faa1e4e5d9d425c98a | |
| parent | 71c7f93ea0036eddb86ccd268945555419bb1cbb (diff) | |
mfd: Add support for ams AS3722 PMIC
The ams AS3722 is a compact system PMU suitable for mobile phones,
tablets etc. It has 4 DC/DC step-down regulators, 3 DC/DC step-down
controller, 11 LDOs, RTC, automatic battery, temperature and
over-current monitoring, 8 GPIOs, ADC and a watchdog.
Add MFD core driver for the AS3722 to support core functionality.
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Florian Lobmaier <florian.lobmaier@ams.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
| -rw-r--r-- | Documentation/devicetree/bindings/mfd/as3722.txt | 194 | ||||
| -rw-r--r-- | drivers/mfd/Kconfig | 12 | ||||
| -rw-r--r-- | drivers/mfd/Makefile | 1 | ||||
| -rw-r--r-- | drivers/mfd/as3722.c | 449 | ||||
| -rw-r--r-- | include/dt-bindings/mfd/as3722.h | 52 | ||||
| -rw-r--r-- | include/linux/mfd/as3722.h | 423 |
6 files changed, 1131 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/mfd/as3722.txt b/Documentation/devicetree/bindings/mfd/as3722.txt new file mode 100644 index 000000000000..fc2191ecfd6b --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/as3722.txt | |||
| @@ -0,0 +1,194 @@ | |||
| 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 | |||
| 115 | Example: | ||
| 116 | -------- | ||
| 117 | #include <dt-bindings/mfd/as3722.h> | ||
| 118 | ... | ||
| 119 | ams3722 { | ||
| 120 | compatible = "ams,as3722"; | ||
| 121 | reg = <0x48>; | ||
| 122 | |||
| 123 | interrupt-parent = <&intc>; | ||
| 124 | interrupt-controller; | ||
| 125 | #interrupt-cells = <2>; | ||
| 126 | |||
| 127 | gpio-controller; | ||
| 128 | #gpio-cells = <2>; | ||
| 129 | |||
| 130 | pinctrl-names = "default"; | ||
| 131 | pinctrl-0 = <&as3722_default>; | ||
| 132 | |||
| 133 | as3722_default: pinmux { | ||
| 134 | gpio0 { | ||
| 135 | pins = "gpio0"; | ||
| 136 | function = "gpio"; | ||
| 137 | bias-pull-down; | ||
| 138 | }; | ||
| 139 | |||
| 140 | gpio1_2_4_7 { | ||
| 141 | pins = "gpio1", "gpio2", "gpio4", "gpio7"; | ||
| 142 | function = "gpio"; | ||
| 143 | bias-pull-up; | ||
| 144 | }; | ||
| 145 | |||
| 146 | gpio5 { | ||
| 147 | pins = "gpio5"; | ||
| 148 | function = "clk32k_out"; | ||
| 149 | }; | ||
| 150 | } | ||
| 151 | |||
| 152 | regulators { | ||
| 153 | vsup-sd2-supply = <...>; | ||
| 154 | ... | ||
| 155 | |||
| 156 | sd0 { | ||
| 157 | regulator-name = "vdd_cpu"; | ||
| 158 | regulator-min-microvolt = <700000>; | ||
| 159 | regulator-max-microvolt = <1400000>; | ||
| 160 | regulator-always-on; | ||
| 161 | ams,ext-control = <2>; | ||
| 162 | }; | ||
| 163 | |||
| 164 | sd1 { | ||
| 165 | regulator-name = "vdd_core"; | ||
| 166 | regulator-min-microvolt = <700000>; | ||
| 167 | regulator-max-microvolt = <1400000>; | ||
| 168 | regulator-always-on; | ||
| 169 | ams,ext-control = <1>; | ||
