aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-12-07 01:28:35 -0500
committerFrederic Weisbecker <fweisbec@gmail.com>2009-12-07 01:29:22 -0500
commit6548698f929814375fa5d62ae1db96959b0418c1 (patch)
tree340924ae82cb0946aa15045b2b72186de52a8146 /include/linux/regulator
parent1d2c6cfd40b2dece3bb958cbbc405a2c1536ab75 (diff)
parent22763c5cf3690a681551162c15d34d935308c8d7 (diff)
Merge commit 'v2.6.32' into reiserfs/kill-bkl
Merge-reason: The tree was based 2.6.31. It's better to be up to date with 2.6.32. Although no conflicting changes were made in between, it gives benchmarking results closer to the lastest kernel behaviour.
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/consumer.h4
-rw-r--r--include/linux/regulator/driver.h7
-rw-r--r--include/linux/regulator/fixed.h24
-rw-r--r--include/linux/regulator/machine.h26
-rw-r--r--include/linux/regulator/max1586.h4
5 files changed, 58 insertions, 7 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 277f4b964df5..490c5b37b6d7 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -125,6 +125,8 @@ struct regulator_bulk_data {
125/* regulator get and put */ 125/* regulator get and put */
126struct regulator *__must_check regulator_get(struct device *dev, 126struct regulator *__must_check regulator_get(struct device *dev,
127 const char *id); 127 const char *id);
128struct regulator *__must_check regulator_get_exclusive(struct device *dev,
129 const char *id);
128void regulator_put(struct regulator *regulator); 130void regulator_put(struct regulator *regulator);
129 131
130/* regulator output control and status */ 132/* regulator output control and status */
@@ -144,6 +146,8 @@ void regulator_bulk_free(int num_consumers,
144 146
145int regulator_count_voltages(struct regulator *regulator); 147int regulator_count_voltages(struct regulator *regulator);
146int regulator_list_voltage(struct regulator *regulator, unsigned selector); 148int regulator_list_voltage(struct regulator *regulator, unsigned selector);
149int regulator_is_supported_voltage(struct regulator *regulator,
150 int min_uV, int max_uV);
147int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); 151int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV);
148int regulator_get_voltage(struct regulator *regulator); 152int regulator_get_voltage(struct regulator *regulator);
149int regulator_set_current_limit(struct regulator *regulator, 153int regulator_set_current_limit(struct regulator *regulator,
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 225f733e7533..31f2055eae28 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -37,7 +37,8 @@ enum regulator_status {
37 * 37 *
38 * @enable: Configure the regulator as enabled. 38 * @enable: Configure the regulator as enabled.
39 * @disable: Configure the regulator as disabled. 39 * @disable: Configure the regulator as disabled.
40 * @is_enabled: Return 1 if the regulator is enabled, 0 otherwise. 40 * @is_enabled: Return 1 if the regulator is enabled, 0 if not.
41 * May also return negative errno.
41 * 42 *
42 * @set_voltage: Set the voltage for the regulator within the range specified. 43 * @set_voltage: Set the voltage for the regulator within the range specified.
43 * The driver should select the voltage closest to min_uV. 44 * The driver should select the voltage closest to min_uV.
@@ -162,6 +163,8 @@ struct regulator_desc {
162struct regulator_dev { 163struct regulator_dev {
163 struct regulator_desc *desc; 164 struct regulator_desc *desc;
164 int use_count; 165 int use_count;
166 int open_count;
167 int exclusive;
165 168
166 /* lists we belong to */ 169 /* lists we belong to */
167 struct list_head list; /* list of all regulators */ 170 struct list_head list; /* list of all regulators */
@@ -193,6 +196,8 @@ void *rdev_get_drvdata(struct regulator_dev *rdev);
193struct device *rdev_get_dev(struct regulator_dev *rdev); 196struct device *rdev_get_dev(struct regulator_dev *rdev);
194int rdev_get_id(struct regulator_dev *rdev); 197int rdev_get_id(struct regulator_dev *rdev);
195 198
199int regulator_mode_to_status(unsigned int);
200
196void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); 201void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
197 202
198#endif 203#endif
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
index 91b4da31f1b5..e94a4a1c7c8a 100644
--- a/include/linux/regulator/fixed.h
+++ b/include/linux/regulator/fixed.h
@@ -5,6 +5,9 @@
5 * 5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 * 7 *
8 * Copyright (c) 2009 Nokia Corporation
9 * Roger Quadros <ext-roger.quadros@nokia.com>
10 *
8 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as 12 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the 13 * published by the Free Software Foundation; either version 2 of the
@@ -16,9 +19,30 @@
16 19
17struct regulator_init_data; 20struct regulator_init_data;
18 21
22/**
23 * struct fixed_voltage_config - fixed_voltage_config structure
24 * @supply_name: Name of the regulator supply
25 * @microvolts: Output voltage of regulator
26 * @gpio: GPIO to use for enable control
27 * set to -EINVAL if not used
28 * @enable_high: Polarity of enable GPIO
29 * 1 = Active high, 0 = Active low
30 * @enabled_at_boot: Whether regulator has been enabled at
31 * boot or not. 1 = Yes, 0 = No
32 * This is used to keep the regulator at
33 * the default state
34 * @init_data: regulator_init_data
35 *
36 * This structure contains fixed voltage regulator configuration
37 * information that must be passed by platform code to the fixed
38 * voltage regulator driver.
39 */
19struct fixed_voltage_config { 40struct fixed_voltage_config {
20 const char *supply_name; 41 const char *supply_name;
21 int microvolts; 42 int microvolts;
43 int gpio;
44 unsigned enable_high:1;
45 unsigned enabled_at_boot:1;
22 struct regulator_init_data *init_data; 46 struct regulator_init_data *init_data;
23}; 47};
24 48
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index bac64fa390f2..87f5f176d4ef 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -41,7 +41,7 @@ struct regulator;
41#define REGULATOR_CHANGE_DRMS 0x10 41#define REGULATOR_CHANGE_DRMS 0x10
42 42
43/** 43/**
44 * struct regulator_state - regulator state during low power syatem states 44 * struct regulator_state - regulator state during low power system states
45 * 45 *
46 * This describes a regulators state during a system wide low power state. 46 * This describes a regulators state during a system wide low power state.
47 * 47 *
@@ -117,25 +117,37 @@ struct regulation_constraints {
117 /* mode to set on startup */ 117 /* mode to set on startup */
118 unsigned int initial_mode; 118 unsigned int initial_mode;
119 119
120 /* constriant flags */ 120 /* constraint flags */
121 unsigned always_on:1; /* regulator never off when system is on */ 121 unsigned always_on:1; /* regulator never off when system is on */
122 unsigned boot_on:1; /* bootloader/firmware enabled regulator */ 122 unsigned boot_on:1; /* bootloader/firmware enabled regulator */
123 unsigned apply_uV:1; /* apply uV constraint iff min == max */ 123 unsigned apply_uV:1; /* apply uV constraint if min == max */
124}; 124};
125 125
126/** 126/**
127 * struct regulator_consumer_supply - supply -> device mapping 127 * struct regulator_consumer_supply - supply -> device mapping
128 * 128 *
129 * This maps a supply name to a device. 129 * This maps a supply name to a device. Only one of dev or dev_name
130 * can be specified. Use of dev_name allows support for buses which
131 * make struct device available late such as I2C and is the preferred
132 * form.
130 * 133 *
131 * @dev: Device structure for the consumer. 134 * @dev: Device structure for the consumer.
135 * @dev_name: Result of dev_name() for the consumer.
132 * @supply: Name for the supply. 136 * @supply: Name for the supply.
133 */ 137 */
134struct regulator_consumer_supply { 138struct regulator_consumer_supply {
135 struct device *dev; /* consumer */ 139 struct device *dev; /* consumer */
140 const char *dev_name; /* dev_name() for consumer */
136 const char *supply; /* consumer supply - e.g. "vcc" */ 141 const char *supply; /* consumer supply - e.g. "vcc" */
137}; 142};
138 143
144/* Initialize struct regulator_consumer_supply */
145#define REGULATOR_SUPPLY(_name, _dev_name) \
146{ \
147 .supply = _name, \
148 .dev_name = _dev_name, \
149}
150
139/** 151/**
140 * struct regulator_init_data - regulator platform initialisation data. 152 * struct regulator_init_data - regulator platform initialisation data.
141 * 153 *
@@ -166,6 +178,12 @@ struct regulator_init_data {
166 178
167int regulator_suspend_prepare(suspend_state_t state); 179int regulator_suspend_prepare(suspend_state_t state);
168 180
181#ifdef CONFIG_REGULATOR
169void regulator_has_full_constraints(void); 182void regulator_has_full_constraints(void);
183#else
184static inline void regulator_has_full_constraints(void)
185{
186}
187#endif
170 188
171#endif 189#endif
diff --git a/include/linux/regulator/max1586.h b/include/linux/regulator/max1586.h
index 44563192bf16..de9a7fae20be 100644
--- a/include/linux/regulator/max1586.h
+++ b/include/linux/regulator/max1586.h
@@ -36,7 +36,7 @@
36 * max1586_subdev_data - regulator data 36 * max1586_subdev_data - regulator data
37 * @id: regulator Id (either MAX1586_V3 or MAX1586_V6) 37 * @id: regulator Id (either MAX1586_V3 or MAX1586_V6)
38 * @name: regulator cute name (example for V3: "vcc_core") 38 * @name: regulator cute name (example for V3: "vcc_core")
39 * @platform_data: regulator init data (contraints, supplies, ...) 39 * @platform_data: regulator init data (constraints, supplies, ...)
40 */ 40 */
41struct max1586_subdev_data { 41struct max1586_subdev_data {
42 int id; 42 int id;
@@ -46,7 +46,7 @@ struct max1586_subdev_data {
46 46
47/** 47/**
48 * max1586_platform_data - platform data for max1586 48 * max1586_platform_data - platform data for max1586
49 * @num_subdevs: number of regultors used (may be 1 or 2) 49 * @num_subdevs: number of regulators used (may be 1 or 2)
50 * @subdevs: regulator used 50 * @subdevs: regulator used
51 * At most, there will be a regulator for V3 and one for V6 voltages. 51 * At most, there will be a regulator for V3 and one for V6 voltages.
52 * @v3_gain: gain on the V3 voltage output multiplied by 1e6. 52 * @v3_gain: gain on the V3 voltage output multiplied by 1e6.