diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2016-04-28 05:58:55 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2016-05-09 10:42:08 -0400 |
commit | e5e3dea890804134f65d51eb42963b8659908d40 (patch) | |
tree | 2f14931890343538982eaaed8bfe7021023ae81b | |
parent | 327156c593600e0f08575621c2a56f311d482e7a (diff) |
mfd: Add device-tree binding doc for PMIC MAX77620/MAX20024
The MAXIM PMIC MAX77620 and MAX20024 are power management IC
which supports RTC, GPIO, DCDC/LDO regulators, interrupt,
watchdog etc.
Add DT binding document for the different functionality of
this device.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | Documentation/devicetree/bindings/mfd/max77620.txt | 143 | ||||
-rw-r--r-- | include/dt-bindings/mfd/max77620.h | 39 |
2 files changed, 182 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/mfd/max77620.txt b/Documentation/devicetree/bindings/mfd/max77620.txt new file mode 100644 index 000000000000..2ad44f7e4880 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/max77620.txt | |||
@@ -0,0 +1,143 @@ | |||
1 | MAX77620 Power management IC from Maxim Semiconductor. | ||
2 | |||
3 | Required properties: | ||
4 | ------------------- | ||
5 | - compatible: Must be one of | ||
6 | "maxim,max77620" | ||
7 | "maxim,max20024". | ||
8 | - reg: I2C device address. | ||
9 | |||
10 | Optional properties: | ||
11 | ------------------- | ||
12 | - interrupts: The interrupt on the parent the controller is | ||
13 | connected to. | ||
14 | - interrupt-controller: Marks the device node as an interrupt controller. | ||
15 | - #interrupt-cells: is <2> and their usage is compliant to the 2 cells | ||
16 | variant of <../interrupt-controller/interrupts.txt> | ||
17 | IRQ numbers for different interrupt source of MAX77620 | ||
18 | are defined at dt-bindings/mfd/max77620.h. | ||
19 | |||
20 | Optional subnodes and their properties: | ||
21 | ======================================= | ||
22 | |||
23 | Flexible power sequence configurations: | ||
24 | -------------------------------------- | ||
25 | The Flexible Power Sequencer (FPS) allows each regulator to power up under | ||
26 | hardware or software control. Additionally, each regulator can power on | ||
27 | independently or among a group of other regulators with an adjustable power-up | ||
28 | and power-down delays (sequencing). GPIO1, GPIO2, and GPIO3 can be programmed | ||
29 | to be part of a sequence allowing external regulators to be sequenced along | ||
30 | with internal regulators. 32KHz clock can be programmed to be part of a | ||
31 | sequence. | ||
32 | |||
33 | The flexible sequencing structure consists of two hardware enable inputs | ||
34 | (EN0, EN1), and 3 master sequencing timers called FPS0, FPS1 and FPS2. | ||
35 | Each master sequencing timer is programmable through its configuration | ||
36 | register to have a hardware enable source (EN1 or EN2) or a software enable | ||
37 | source (SW). When enabled/disabled, the master sequencing timer generates | ||
38 | eight sequencing events on different time periods called slots. The time | ||
39 | period between each event is programmable within the configuration register. | ||
40 | Each regulator, GPIO1, GPIO2, GPIO3, and 32KHz clock has a flexible power | ||
41 | sequence slave register which allows its enable source to be specified as | ||
42 | a flexible power sequencer timer or a software bit. When a FPS source of | ||
43 | regulators, GPIOs and clocks specifies the enable source to be a flexible | ||
44 | power sequencer, the power up and power down delays can be specified in | ||
45 | the regulators, GPIOs and clocks flexible power sequencer configuration | ||
46 | registers. | ||
47 | |||
48 | When FPS event cleared (set to LOW), regulators, GPIOs and 32KHz | ||
49 | clock are set into following state at the sequencing event that | ||
50 | corresponds to its flexible sequencer configuration register. | ||
51 | Sleep state: In this state, regulators, GPIOs | ||
52 | and 32KHz clock get disabled at | ||
53 | the sequencing event. | ||
54 | Global Low Power Mode (GLPM): In this state, regulators are set in | ||
55 | low power mode at the sequencing event. | ||
56 | |||
57 | The configuration parameters of FPS is provided through sub-node "fps" | ||
58 | and their child for FPS specific. The child node name for FPS are "fps0", | ||
59 | "fps1", and "fps2" for FPS0, FPS1 and FPS2 respectively. | ||
60 | |||
61 | The FPS configurations like FPS source, power up and power down slots for | ||
62 | regulators, GPIOs and 32kHz clocks are provided in their respective | ||
63 | configuration nodes which is explained in respective sub-system DT | ||
64 | binding document. | ||
65 | |||
66 | There is need for different FPS configuration parameters based on system | ||
67 | state like when system state changed from active to suspend or active to | ||
68 | power off (shutdown). | ||
69 | |||
70 | Optional properties: | ||
71 | ------------------- | ||
72 | -maxim,fps-event-source: u32, FPS event source like external | ||
73 | hardware input to PMIC i.e. EN0, EN1 or | ||
74 | software (SW). | ||
75 | The macros are defined on | ||
76 | dt-bindings/mfd/max77620.h | ||
77 | for different control source. | ||
78 | - MAX77620_FPS_EVENT_SRC_EN0 | ||
79 | for hardware input pin EN0. | ||
80 | - MAX77620_FPS_EVENT_SRC_EN1 | ||
81 | for hardware input pin EN1. | ||
82 | - MAX77620_FPS_EVENT_SRC_SW | ||
83 | for software control. | ||
84 | |||
85 | -maxim,shutdown-fps-time-period-us: u32, FPS time period in microseconds | ||
86 | when system enters in to shutdown | ||
87 | state. | ||
88 | |||
89 | -maxim,suspend-fps-time-period-us: u32, FPS time period in microseconds | ||
90 | when system enters in to suspend state. | ||
91 | |||
92 | -maxim,device-state-on-disabled-event: u32, describe the PMIC state when FPS | ||
93 | event cleared (set to LOW) whether it | ||
94 | should go to sleep state or low-power | ||
95 | state. Following are valid values: | ||
96 | - MAX77620_FPS_INACTIVE_STATE_SLEEP | ||
97 | to set the PMIC state to sleep. | ||
98 | - MAX77620_FPS_INACTIVE_STATE_LOW_POWER | ||
99 | to set the PMIC state to low | ||
100 | power. | ||
101 | Absence of this property or other value | ||
102 | will not change device state when FPS | ||
103 | event get cleared. | ||
104 | |||
105 | Here supported time periods by device in microseconds are as follows: | ||
106 | MAX77620 supports 40, 80, 160, 320, 640, 1280, 2560 and 5120 microseconds. | ||
107 | MAX20024 supports 20, 40, 80, 160, 320, 640, 1280 and 2540 microseconds. | ||
108 | |||
109 | For DT binding details of different sub modules like GPIO, pincontrol, | ||
110 | regulator, power, please refer respective device-tree binding document | ||
111 | under their respective sub-system directories. | ||
112 | |||
113 | Example: | ||
114 | -------- | ||
115 | #include <dt-bindings/mfd/max77620.h> | ||
116 | |||
117 | max77620@3c { | ||
118 | compatible = "maxim,max77620"; | ||
119 | reg = <0x3c>; | ||
120 | |||
121 | interrupt-parent = <&intc>; | ||
122 | interrupts = <0 86 IRQ_TYPE_NONE>; | ||
123 | |||
124 | interrupt-controller; | ||
125 | #interrupt-cells = <2>; | ||
126 | |||
127 | fps { | ||
128 | fps0 { | ||
129 | maxim,shutdown-fps-time-period-us = <1280>; | ||
130 | maxim,fps-event-source = <MAX77620_FPS_EVENT_SRC_EN1>; | ||
131 | }; | ||
132 | |||
133 | fps1 { | ||
134 | maxim,shutdown-fps-time-period-us = <1280>; | ||
135 | maxim,fps-event-source = <MAX77620_FPS_EVENT_SRC_EN0>; | ||
136 | }; | ||
137 | |||
138 | fps2 { | ||
139 | maxim,shutdown-fps-time-period-us = <1280>; | ||
140 | maxim,fps-event-source = <MAX77620_FPS_EVENT_SRC_SW>; | ||
141 | }; | ||
142 | }; | ||
143 | }; | ||
diff --git a/include/dt-bindings/mfd/max77620.h b/include/dt-bindings/mfd/max77620.h new file mode 100644 index 000000000000..b911a0720ccd --- /dev/null +++ b/include/dt-bindings/mfd/max77620.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * This header provides macros for MAXIM MAX77620 device bindings. | ||
3 | * | ||
4 | * Copyright (c) 2016, NVIDIA Corporation. | ||
5 | * Author: Laxman Dewangan <ldewangan@nvidia.com> | ||
6 | */ | ||
7 | |||
8 | #ifndef _DT_BINDINGS_MFD_MAX77620_H | ||
9 | #define _DT_BINDINGS_MFD_MAX77620_H | ||
10 | |||
11 | /* MAX77620 interrupts */ | ||
12 | #define MAX77620_IRQ_TOP_GLBL 0 /* Low-Battery */ | ||
13 | #define MAX77620_IRQ_TOP_SD 1 /* SD power fail */ | ||
14 | #define MAX77620_IRQ_TOP_LDO 2 /* LDO power fail */ | ||
15 | #define MAX77620_IRQ_TOP_GPIO 3 /* GPIO internal int to MAX77620 */ | ||
16 | #define MAX77620_IRQ_TOP_RTC 4 /* RTC */ | ||
17 | #define MAX77620_IRQ_TOP_32K 5 /* 32kHz oscillator */ | ||
18 | #define MAX77620_IRQ_TOP_ONOFF 6 /* ON/OFF oscillator */ | ||
19 | #define MAX77620_IRQ_LBT_MBATLOW 7 /* Thermal alarm status, > 120C */ | ||
20 | #define MAX77620_IRQ_LBT_TJALRM1 8 /* Thermal alarm status, > 120C */ | ||
21 | #define MAX77620_IRQ_LBT_TJALRM2 9 /* Thermal alarm status, > 140C */ | ||
22 | |||
23 | /* FPS event source */ | ||
24 | #define MAX77620_FPS_EVENT_SRC_EN0 0 | ||
25 | #define MAX77620_FPS_EVENT_SRC_EN1 1 | ||
26 | #define MAX77620_FPS_EVENT_SRC_SW 2 | ||
27 | |||
28 | /* Device state when FPS event LOW */ | ||
29 | #define MAX77620_FPS_INACTIVE_STATE_SLEEP 0 | ||
30 | #define MAX77620_FPS_INACTIVE_STATE_LOW_POWER 1 | ||
31 | |||
32 | /* FPS source */ | ||
33 | #define MAX77620_FPS_SRC_0 0 | ||
34 | #define MAX77620_FPS_SRC_1 1 | ||
35 | #define MAX77620_FPS_SRC_2 2 | ||
36 | #define MAX77620_FPS_SRC_NONE 3 | ||
37 | #define MAX77620_FPS_SRC_DEF 4 | ||
38 | |||
39 | #endif | ||