diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-14 15:28:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-14 15:28:55 -0400 |
commit | c269bc00fcb876ae3b85f178f1e34601185c8ccc (patch) | |
tree | cae61de48c631301984a5e8be345be220adabb82 /Documentation | |
parent | 2d51b75370d83535883c66521b03fcd6a1f1f68d (diff) | |
parent | caf1859199e4360ffa826179bc0e881b0348f3ce (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (26 commits)
mfd: Fix warning in WM8350
mfd: Add placeholders for WM8350 client devices
da903x: add regulator support for DA9030/DA9034
mfd: Add WM8350 subdevice registration helper
regulator: Add WM8350 regulator support
mfd: Add WM8350 interrupt support
mfd: Add initialisation callback for WM8350
mfd: Add GPIO pin configuration support for WM8350
mfd: Add I2C control support for WM8350
mfd: Core support for the WM8350 AudioPlus PMIC
mfd: Add WM8350 watchdog register definitions
mfd: Add WM8350 RTC register definitions
mfd: Add WM8350 comparator register definitions
mfd: Add WM8350 PMU register definitions
mfd: Add WM8350 PMIC register definitions
mfd: Add WM8350 GPIO register definitions
mfd: Add WM8350 audio register definitions
regulator: Export regulator name via sysfs
regulator: Add WM8400 regulator support
mfd: Core support for the WM8400 AudioPlus HiFi CODEC and PMU
...
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/testing/sysfs-class-regulator | 55 | ||||
-rw-r--r-- | Documentation/power/regulator/machine.txt | 140 | ||||
-rw-r--r-- | Documentation/power/regulator/regulator.txt | 8 |
3 files changed, 104 insertions, 99 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-regulator b/Documentation/ABI/testing/sysfs-class-regulator index 79a4a75b2d2c..3731f6f29bcb 100644 --- a/Documentation/ABI/testing/sysfs-class-regulator +++ b/Documentation/ABI/testing/sysfs-class-regulator | |||
@@ -1,7 +1,7 @@ | |||
1 | What: /sys/class/regulator/.../state | 1 | What: /sys/class/regulator/.../state |
2 | Date: April 2008 | 2 | Date: April 2008 |
3 | KernelVersion: 2.6.26 | 3 | KernelVersion: 2.6.26 |
4 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 4 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
5 | Description: | 5 | Description: |
6 | Each regulator directory will contain a field called | 6 | Each regulator directory will contain a field called |
7 | state. This holds the regulator output state. | 7 | state. This holds the regulator output state. |
@@ -27,7 +27,7 @@ Description: | |||
27 | What: /sys/class/regulator/.../type | 27 | What: /sys/class/regulator/.../type |
28 | Date: April 2008 | 28 | Date: April 2008 |
29 | KernelVersion: 2.6.26 | 29 | KernelVersion: 2.6.26 |
30 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 30 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
31 | Description: | 31 | Description: |
32 | Each regulator directory will contain a field called | 32 | Each regulator directory will contain a field called |
33 | type. This holds the regulator type. | 33 | type. This holds the regulator type. |
@@ -51,7 +51,7 @@ Description: | |||
51 | What: /sys/class/regulator/.../microvolts | 51 | What: /sys/class/regulator/.../microvolts |
52 | Date: April 2008 | 52 | Date: April 2008 |
53 | KernelVersion: 2.6.26 | 53 | KernelVersion: 2.6.26 |
54 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 54 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
55 | Description: | 55 | Description: |
56 | Each regulator directory will contain a field called | 56 | Each regulator directory will contain a field called |
57 | microvolts. This holds the regulator output voltage setting | 57 | microvolts. This holds the regulator output voltage setting |
@@ -65,7 +65,7 @@ Description: | |||
65 | What: /sys/class/regulator/.../microamps | 65 | What: /sys/class/regulator/.../microamps |
66 | Date: April 2008 | 66 | Date: April 2008 |
67 | KernelVersion: 2.6.26 | 67 | KernelVersion: 2.6.26 |
68 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 68 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
69 | Description: | 69 | Description: |
70 | Each regulator directory will contain a field called | 70 | Each regulator directory will contain a field called |
71 | microamps. This holds the regulator output current limit | 71 | microamps. This holds the regulator output current limit |
@@ -79,7 +79,7 @@ Description: | |||
79 | What: /sys/class/regulator/.../opmode | 79 | What: /sys/class/regulator/.../opmode |
80 | Date: April 2008 | 80 | Date: April 2008 |
81 | KernelVersion: 2.6.26 | 81 | KernelVersion: 2.6.26 |
82 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 82 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
83 | Description: | 83 | Description: |
84 | Each regulator directory will contain a field called | 84 | Each regulator directory will contain a field called |
85 | opmode. This holds the regulator operating mode setting. | 85 | opmode. This holds the regulator operating mode setting. |
@@ -102,7 +102,7 @@ Description: | |||
102 | What: /sys/class/regulator/.../min_microvolts | 102 | What: /sys/class/regulator/.../min_microvolts |
103 | Date: April 2008 | 103 | Date: April 2008 |
104 | KernelVersion: 2.6.26 | 104 | KernelVersion: 2.6.26 |
105 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 105 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
106 | Description: | 106 | Description: |
107 | Each regulator directory will contain a field called | 107 | Each regulator directory will contain a field called |
108 | min_microvolts. This holds the minimum safe working regulator | 108 | min_microvolts. This holds the minimum safe working regulator |
@@ -116,7 +116,7 @@ Description: | |||
116 | What: /sys/class/regulator/.../max_microvolts | 116 | What: /sys/class/regulator/.../max_microvolts |
117 | Date: April 2008 | 117 | Date: April 2008 |
118 | KernelVersion: 2.6.26 | 118 | KernelVersion: 2.6.26 |
119 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 119 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
120 | Description: | 120 | Description: |
121 | Each regulator directory will contain a field called | 121 | Each regulator directory will contain a field called |
122 | max_microvolts. This holds the maximum safe working regulator | 122 | max_microvolts. This holds the maximum safe working regulator |
@@ -130,7 +130,7 @@ Description: | |||
130 | What: /sys/class/regulator/.../min_microamps | 130 | What: /sys/class/regulator/.../min_microamps |
131 | Date: April 2008 | 131 | Date: April 2008 |
132 | KernelVersion: 2.6.26 | 132 | KernelVersion: 2.6.26 |
133 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 133 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
134 | Description: | 134 | Description: |
135 | Each regulator directory will contain a field called | 135 | Each regulator directory will contain a field called |
136 | min_microamps. This holds the minimum safe working regulator | 136 | min_microamps. This holds the minimum safe working regulator |
@@ -145,7 +145,7 @@ Description: | |||
145 | What: /sys/class/regulator/.../max_microamps | 145 | What: /sys/class/regulator/.../max_microamps |
146 | Date: April 2008 | 146 | Date: April 2008 |
147 | KernelVersion: 2.6.26 | 147 | KernelVersion: 2.6.26 |
148 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 148 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
149 | Description: | 149 | Description: |
150 | Each regulator directory will contain a field called | 150 | Each regulator directory will contain a field called |
151 | max_microamps. This holds the maximum safe working regulator | 151 | max_microamps. This holds the maximum safe working regulator |
@@ -157,10 +157,23 @@ Description: | |||
157 | platform code. | 157 | platform code. |
158 | 158 | ||
159 | 159 | ||
160 | What: /sys/class/regulator/.../name | ||
161 | Date: October 2008 | ||
162 | KernelVersion: 2.6.28 | ||
163 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> | ||
164 | Description: | ||
165 | Each regulator directory will contain a field called | ||
166 | name. This holds a string identifying the regulator for | ||
167 | display purposes. | ||
168 | |||
169 | NOTE: this will be empty if no suitable name is provided | ||
170 | by platform or regulator drivers. | ||
171 | |||
172 | |||
160 | What: /sys/class/regulator/.../num_users | 173 | What: /sys/class/regulator/.../num_users |
161 | Date: April 2008 | 174 | Date: April 2008 |
162 | KernelVersion: 2.6.26 | 175 | KernelVersion: 2.6.26 |
163 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 176 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
164 | Description: | 177 | Description: |
165 | Each regulator directory will contain a field called | 178 | Each regulator directory will contain a field called |
166 | num_users. This holds the number of consumer devices that | 179 | num_users. This holds the number of consumer devices that |
@@ -170,7 +183,7 @@ Description: | |||
170 | What: /sys/class/regulator/.../requested_microamps | 183 | What: /sys/class/regulator/.../requested_microamps |
171 | Date: April 2008 | 184 | Date: April 2008 |
172 | KernelVersion: 2.6.26 | 185 | KernelVersion: 2.6.26 |
173 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 186 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
174 | Description: | 187 | Description: |
175 | Each regulator directory will contain a field called | 188 | Each regulator directory will contain a field called |
176 | requested_microamps. This holds the total requested load | 189 | requested_microamps. This holds the total requested load |
@@ -181,7 +194,7 @@ Description: | |||
181 | What: /sys/class/regulator/.../parent | 194 | What: /sys/class/regulator/.../parent |
182 | Date: April 2008 | 195 | Date: April 2008 |
183 | KernelVersion: 2.6.26 | 196 | KernelVersion: 2.6.26 |
184 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 197 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
185 | Description: | 198 | Description: |
186 | Some regulator directories will contain a link called parent. | 199 | Some regulator directories will contain a link called parent. |
187 | This points to the parent or supply regulator if one exists. | 200 | This points to the parent or supply regulator if one exists. |
@@ -189,7 +202,7 @@ Description: | |||
189 | What: /sys/class/regulator/.../suspend_mem_microvolts | 202 | What: /sys/class/regulator/.../suspend_mem_microvolts |
190 | Date: May 2008 | 203 | Date: May 2008 |
191 | KernelVersion: 2.6.26 | 204 | KernelVersion: 2.6.26 |
192 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 205 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
193 | Description: | 206 | Description: |
194 | Each regulator directory will contain a field called | 207 | Each regulator directory will contain a field called |
195 | suspend_mem_microvolts. This holds the regulator output | 208 | suspend_mem_microvolts. This holds the regulator output |
@@ -203,7 +216,7 @@ Description: | |||
203 | What: /sys/class/regulator/.../suspend_disk_microvolts | 216 | What: /sys/class/regulator/.../suspend_disk_microvolts |
204 | Date: May 2008 | 217 | Date: May 2008 |
205 | KernelVersion: 2.6.26 | 218 | KernelVersion: 2.6.26 |
206 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 219 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
207 | Description: | 220 | Description: |
208 | Each regulator directory will contain a field called | 221 | Each regulator directory will contain a field called |
209 | suspend_disk_microvolts. This holds the regulator output | 222 | suspend_disk_microvolts. This holds the regulator output |
@@ -217,7 +230,7 @@ Description: | |||
217 | What: /sys/class/regulator/.../suspend_standby_microvolts | 230 | What: /sys/class/regulator/.../suspend_standby_microvolts |
218 | Date: May 2008 | 231 | Date: May 2008 |
219 | KernelVersion: 2.6.26 | 232 | KernelVersion: 2.6.26 |
220 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 233 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
221 | Description: | 234 | Description: |
222 | Each regulator directory will contain a field called | 235 | Each regulator directory will contain a field called |
223 | suspend_standby_microvolts. This holds the regulator output | 236 | suspend_standby_microvolts. This holds the regulator output |
@@ -231,7 +244,7 @@ Description: | |||
231 | What: /sys/class/regulator/.../suspend_mem_mode | 244 | What: /sys/class/regulator/.../suspend_mem_mode |
232 | Date: May 2008 | 245 | Date: May 2008 |
233 | KernelVersion: 2.6.26 | 246 | KernelVersion: 2.6.26 |
234 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 247 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
235 | Description: | 248 | Description: |
236 | Each regulator directory will contain a field called | 249 | Each regulator directory will contain a field called |
237 | suspend_mem_mode. This holds the regulator operating mode | 250 | suspend_mem_mode. This holds the regulator operating mode |
@@ -245,7 +258,7 @@ Description: | |||
245 | What: /sys/class/regulator/.../suspend_disk_mode | 258 | What: /sys/class/regulator/.../suspend_disk_mode |
246 | Date: May 2008 | 259 | Date: May 2008 |
247 | KernelVersion: 2.6.26 | 260 | KernelVersion: 2.6.26 |
248 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 261 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
249 | Description: | 262 | Description: |
250 | Each regulator directory will contain a field called | 263 | Each regulator directory will contain a field called |
251 | suspend_disk_mode. This holds the regulator operating mode | 264 | suspend_disk_mode. This holds the regulator operating mode |
@@ -258,7 +271,7 @@ Description: | |||
258 | What: /sys/class/regulator/.../suspend_standby_mode | 271 | What: /sys/class/regulator/.../suspend_standby_mode |
259 | Date: May 2008 | 272 | Date: May 2008 |
260 | KernelVersion: 2.6.26 | 273 | KernelVersion: 2.6.26 |
261 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 274 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
262 | Description: | 275 | Description: |
263 | Each regulator directory will contain a field called | 276 | Each regulator directory will contain a field called |
264 | suspend_standby_mode. This holds the regulator operating mode | 277 | suspend_standby_mode. This holds the regulator operating mode |
@@ -272,7 +285,7 @@ Description: | |||
272 | What: /sys/class/regulator/.../suspend_mem_state | 285 | What: /sys/class/regulator/.../suspend_mem_state |
273 | Date: May 2008 | 286 | Date: May 2008 |
274 | KernelVersion: 2.6.26 | 287 | KernelVersion: 2.6.26 |
275 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 288 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
276 | Description: | 289 | Description: |
277 | Each regulator directory will contain a field called | 290 | Each regulator directory will contain a field called |
278 | suspend_mem_state. This holds the regulator operating state | 291 | suspend_mem_state. This holds the regulator operating state |
@@ -287,7 +300,7 @@ Description: | |||
287 | What: /sys/class/regulator/.../suspend_disk_state | 300 | What: /sys/class/regulator/.../suspend_disk_state |
288 | Date: May 2008 | 301 | Date: May 2008 |
289 | KernelVersion: 2.6.26 | 302 | KernelVersion: 2.6.26 |
290 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 303 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
291 | Description: | 304 | Description: |
292 | Each regulator directory will contain a field called | 305 | Each regulator directory will contain a field called |
293 | suspend_disk_state. This holds the regulator operating state | 306 | suspend_disk_state. This holds the regulator operating state |
@@ -302,7 +315,7 @@ Description: | |||
302 | What: /sys/class/regulator/.../suspend_standby_state | 315 | What: /sys/class/regulator/.../suspend_standby_state |
303 | Date: May 2008 | 316 | Date: May 2008 |
304 | KernelVersion: 2.6.26 | 317 | KernelVersion: 2.6.26 |
305 | Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com> | 318 | Contact: Liam Girdwood <lrg@slimlogic.co.uk> |
306 | Description: | 319 | Description: |
307 | Each regulator directory will contain a field called | 320 | Each regulator directory will contain a field called |
308 | suspend_standby_state. This holds the regulator operating | 321 | suspend_standby_state. This holds the regulator operating |
diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt index c9a35665cf70..ce3487d99abe 100644 --- a/Documentation/power/regulator/machine.txt +++ b/Documentation/power/regulator/machine.txt | |||
@@ -2,17 +2,8 @@ Regulator Machine Driver Interface | |||
2 | =================================== | 2 | =================================== |
3 | 3 | ||
4 | The regulator machine driver interface is intended for board/machine specific | 4 | The regulator machine driver interface is intended for board/machine specific |
5 | initialisation code to configure the regulator subsystem. Typical things that | 5 | initialisation code to configure the regulator subsystem. |
6 | machine drivers would do are :- | ||
7 | 6 | ||
8 | 1. Regulator -> Device mapping. | ||
9 | 2. Regulator supply configuration. | ||
10 | 3. Power Domain constraint setting. | ||
11 | |||
12 | |||
13 | |||
14 | 1. Regulator -> device mapping | ||
15 | ============================== | ||
16 | Consider the following machine :- | 7 | Consider the following machine :- |
17 | 8 | ||
18 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] | 9 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] |
@@ -21,81 +12,82 @@ Consider the following machine :- | |||
21 | 12 | ||
22 | The drivers for consumers A & B must be mapped to the correct regulator in | 13 | The drivers for consumers A & B must be mapped to the correct regulator in |
23 | order to control their power supply. This mapping can be achieved in machine | 14 | order to control their power supply. This mapping can be achieved in machine |
24 | initialisation code by calling :- | 15 | initialisation code by creating a struct regulator_consumer_supply for |
16 | each regulator. | ||
17 | |||
18 | struct regulator_consumer_supply { | ||
19 | struct device *dev; /* consumer */ | ||
20 | const char *supply; /* consumer supply - e.g. "vcc" */ | ||
21 | }; | ||
25 | 22 | ||
26 | int regulator_set_device_supply(const char *regulator, struct device *dev, | 23 | e.g. for the machine above |
27 | const char *supply); | ||
28 | 24 | ||
29 | and is shown with the following code :- | 25 | static struct regulator_consumer_supply regulator1_consumers[] = { |
26 | { | ||
27 | .dev = &platform_consumerB_device.dev, | ||
28 | .supply = "Vcc", | ||
29 | },}; | ||
30 | 30 | ||
31 | regulator_set_device_supply("Regulator-1", devB, "Vcc"); | 31 | static struct regulator_consumer_supply regulator2_consumers[] = { |
32 | regulator_set_device_supply("Regulator-2", devA, "Vcc"); | 32 | { |
33 | .dev = &platform_consumerA_device.dev, | ||
34 | .supply = "Vcc", | ||
35 | },}; | ||
33 | 36 | ||
34 | This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2 | 37 | This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2 |
35 | to the 'Vcc' supply for Consumer A. | 38 | to the 'Vcc' supply for Consumer A. |
36 | 39 | ||
37 | 40 | Constraints can now be registered by defining a struct regulator_init_data | |
38 | 2. Regulator supply configuration. | 41 | for each regulator power domain. This structure also maps the consumers |
39 | ================================== | 42 | to their supply regulator :- |
40 | Consider the following machine (again) :- | 43 | |
41 | 44 | static struct regulator_init_data regulator1_data = { | |
42 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] | 45 | .constraints = { |
43 | | | 46 | .min_uV = 3300000, |
44 | +-> [Consumer B @ 3.3V] | 47 | .max_uV = 3300000, |
48 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
49 | }, | ||
50 | .num_consumer_supplies = ARRAY_SIZE(regulator1_consumers), | ||
51 | .consumer_supplies = regulator1_consumers, | ||
52 | }; | ||
45 | 53 | ||
46 | Regulator-1 supplies power to Regulator-2. This relationship must be registered | 54 | Regulator-1 supplies power to Regulator-2. This relationship must be registered |
47 | with the core so that Regulator-1 is also enabled when Consumer A enables it's | 55 | with the core so that Regulator-1 is also enabled when Consumer A enables it's |
48 | supply (Regulator-2). | 56 | supply (Regulator-2). The supply regulator is set by the supply_regulator_dev |
49 | 57 | field below:- | |
50 | This relationship can be register with the core via :- | 58 | |
51 | 59 | static struct regulator_init_data regulator2_data = { | |
52 | int regulator_set_supply(const char *regulator, const char *regulator_supply); | 60 | .supply_regulator_dev = &platform_regulator1_device.dev, |
53 | 61 | .constraints = { | |
54 | In this example we would use the following code :- | 62 | .min_uV = 1800000, |
55 | 63 | .max_uV = 2000000, | |
56 | regulator_set_supply("Regulator-2", "Regulator-1"); | 64 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, |
57 | 65 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | |
58 | Relationships can be queried by calling :- | 66 | }, |
59 | 67 | .num_consumer_supplies = ARRAY_SIZE(regulator2_consumers), | |
60 | const char *regulator_get_supply(const char *regulator); | 68 | .consumer_supplies = regulator2_consumers, |
61 | |||
62 | |||
63 | 3. Power Domain constraint setting. | ||
64 | =================================== | ||
65 | Each power domain within a system has physical constraints on voltage and | ||
66 | current. This must be defined in software so that the power domain is always | ||
67 | operated within specifications. | ||
68 | |||
69 | Consider the following machine (again) :- | ||
70 | |||
71 | Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V] | ||
72 | | | ||
73 | +-> [Consumer B @ 3.3V] | ||
74 | |||
75 | This gives us two regulators and two power domains: | ||
76 | |||
77 | Domain 1: Regulator-2, Consumer B. | ||
78 | Domain 2: Consumer A. | ||
79 | |||
80 | Constraints can be registered by calling :- | ||
81 | |||
82 | int regulator_set_platform_constraints(const char *regulator, | ||
83 | struct regulation_constraints *constraints); | ||
84 | |||
85 | The example is defined as follows :- | ||
86 | |||
87 | struct regulation_constraints domain_1 = { | ||
88 | .min_uV = 3300000, | ||
89 | .max_uV = 3300000, | ||
90 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | ||
91 | }; | 69 | }; |
92 | 70 | ||
93 | struct regulation_constraints domain_2 = { | 71 | Finally the regulator devices must be registered in the usual manner. |
94 | .min_uV = 1800000, | 72 | |
95 | .max_uV = 2000000, | 73 | static struct platform_device regulator_devices[] = { |
96 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | 74 | { |
97 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 75 | .name = "regulator", |
76 | .id = DCDC_1, | ||
77 | .dev = { | ||
78 | .platform_data = ®ulator1_data, | ||
79 | }, | ||
80 | }, | ||
81 | { | ||
82 | .name = "regulator", | ||
83 | .id = DCDC_2, | ||
84 | .dev = { | ||
85 | .platform_data = ®ulator2_data, | ||
86 | }, | ||
87 | }, | ||
98 | }; | 88 | }; |
89 | /* register regulator 1 device */ | ||
90 | platform_device_register(&wm8350_regulator_devices[0]); | ||
99 | 91 | ||
100 | regulator_set_platform_constraints("Regulator-1", &domain_1); | 92 | /* register regulator 2 device */ |
101 | regulator_set_platform_constraints("Regulator-2", &domain_2); | 93 | platform_device_register(&wm8350_regulator_devices[1]); |
diff --git a/Documentation/power/regulator/regulator.txt b/Documentation/power/regulator/regulator.txt index a69050143592..4200accb9bba 100644 --- a/Documentation/power/regulator/regulator.txt +++ b/Documentation/power/regulator/regulator.txt | |||
@@ -10,11 +10,11 @@ Registration | |||
10 | 10 | ||
11 | Drivers can register a regulator by calling :- | 11 | Drivers can register a regulator by calling :- |
12 | 12 | ||
13 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | 13 | struct regulator_dev *regulator_register(struct device *dev, |
14 | void *reg_data); | 14 | struct regulator_desc *regulator_desc); |
15 | 15 | ||
16 | This will register the regulators capabilities and operations the regulator | 16 | This will register the regulators capabilities and operations to the regulator |
17 | core. The core does not touch reg_data (private to regulator driver). | 17 | core. |
18 | 18 | ||
19 | Regulators can be unregistered by calling :- | 19 | Regulators can be unregistered by calling :- |
20 | 20 | ||