aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-03 13:09:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-03 13:09:29 -0400
commitec1882a9391c55332ebf3d1654f40b76e4a6c010 (patch)
treea72da16d78b1a62e6f4ee01444dd93f0d7a296c1 /include
parent5d3fed701d75ac6888f892ea2eb7c5dcc7831750 (diff)
parenta584862221426f461f56674d30fe0d712ee63d00 (diff)
Merge tag 'regulator-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "Not much exciting going on with the regulator API this time around, lots of driver fixes and enhancements - the main thing is the addition of a new API to help make the stubbing code do the right thing for missing regulator mappings. Highlights: - A new regulator_get_optional() API call for regulators that can be absent in normal operation. This currently does nothing but will be used to improve the stubbing code for unspecified regulators, helping avoid some of the issues we've seen with adding new regulator support. - Helpers for devices with multiple linear ranges of voltages in the same regulator. - Moved the helpers into a separate file since core.c is getting rather large. - New drivers for Dialog DA9210 and DA9063, Freescale pfuze100 and Marvell 88pm800" * tag 'regulator-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (70 commits) regulator: da9063: Statize da9063_ldo_lim_event regulator: lp872x: Make REGULATOR_LP872X depend on I2C rather than I2C=y regulator: tps65217: Convert to use linear ranges regulator: da9063: Use IS_ERR to check return value of regulator_register() regulator: da9063: Optimize da9063_set_current_limit implementation regulator: build: Allow most regulators to be built as modules regulator: Add devm_regulator_get_exclusive() regulator: da9063: Add Dialog DA9063 voltage regulators support. regulator: ti-abb: simplify platform_get_resource_byname/devm_ioremap_resource hwmon: (sht15) Use devm_regulator_get_optional() regulator: core: Use bool for exclusivitity flag regulator: 88pm800: forever loop in pm800_regulator_probe() cpufreq: cpufreq-cpu0: Use devm_regulator_get_optional() regulator: da9210: Remove redundant MODULE_ALIAS regulator: 88pm800: Fix checking whether num_regulator is valid regulator: s2mps11: Fix setting ramp_delay regulator: s2mps11: Fix wrong arguments for regmap_update_bits() call regulator: palmas: Update the DT binding doc for smps10 out1 and out2 regulator: palmas: model SMPS10 as two regulators regulator: core: Move list_voltage_{linear,linear_range,table} to helpers.c ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/palmas.h9
-rw-r--r--include/linux/mfd/samsung/s2mps11.h11
-rw-r--r--include/linux/mfd/tps65217.h19
-rw-r--r--include/linux/regulator/consumer.h32
-rw-r--r--include/linux/regulator/driver.h25
-rw-r--r--include/linux/regulator/fan53555.h1
-rw-r--r--include/linux/regulator/machine.h1
-rw-r--r--include/linux/regulator/max8660.h2
-rw-r--r--include/linux/regulator/pfuze100.h44
9 files changed, 118 insertions, 26 deletions
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 1a8dd7afe084..c06d78af3342 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -160,7 +160,8 @@ enum palmas_regulators {
160 PALMAS_REG_SMPS7, 160 PALMAS_REG_SMPS7,
161 PALMAS_REG_SMPS8, 161 PALMAS_REG_SMPS8,
162 PALMAS_REG_SMPS9, 162 PALMAS_REG_SMPS9,
163 PALMAS_REG_SMPS10, 163 PALMAS_REG_SMPS10_OUT2,
164 PALMAS_REG_SMPS10_OUT1,
164 /* LDO regulators */ 165 /* LDO regulators */
165 PALMAS_REG_LDO1, 166 PALMAS_REG_LDO1,
166 PALMAS_REG_LDO2, 167 PALMAS_REG_LDO2,
@@ -355,9 +356,9 @@ struct palmas_pmic {
355 int smps123; 356 int smps123;
356 int smps457; 357 int smps457;
357 358
358 int range[PALMAS_REG_SMPS10]; 359 int range[PALMAS_REG_SMPS10_OUT1];
359 unsigned int ramp_delay[PALMAS_REG_SMPS10]; 360 unsigned int ramp_delay[PALMAS_REG_SMPS10_OUT1];
360 unsigned int current_reg_mode[PALMAS_REG_SMPS10]; 361 unsigned int current_reg_mode[PALMAS_REG_SMPS10_OUT1];
361}; 362};
362 363
363struct palmas_resource { 364struct palmas_resource {
diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h
index 4e94dc65f987..d0d52ea60074 100644
--- a/include/linux/mfd/samsung/s2mps11.h
+++ b/include/linux/mfd/samsung/s2mps11.h
@@ -191,6 +191,17 @@ enum s2mps11_regulators {
191#define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) 191#define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1)
192#define S2MPS11_RAMP_DELAY 25000 /* uV/us */ 192#define S2MPS11_RAMP_DELAY 25000 /* uV/us */
193 193
194
195#define S2MPS11_BUCK2_RAMP_SHIFT 6
196#define S2MPS11_BUCK34_RAMP_SHIFT 4
197#define S2MPS11_BUCK5_RAMP_SHIFT 6
198#define S2MPS11_BUCK16_RAMP_SHIFT 4
199#define S2MPS11_BUCK7810_RAMP_SHIFT 2
200#define S2MPS11_BUCK9_RAMP_SHIFT 0
201#define S2MPS11_BUCK2_RAMP_EN_SHIFT 3
202#define S2MPS11_BUCK3_RAMP_EN_SHIFT 2
203#define S2MPS11_BUCK4_RAMP_EN_SHIFT 1
204#define S2MPS11_BUCK6_RAMP_EN_SHIFT 0
194#define S2MPS11_PMIC_EN_SHIFT 6 205#define S2MPS11_PMIC_EN_SHIFT 6
195#define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3) 206#define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3)
196 207
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index 29eab2bd3dfa..a5a7f0130e96 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -244,24 +244,6 @@ struct tps65217_board {
244}; 244};
245 245
246/** 246/**
247 * struct tps_info - packages regulator constraints
248 * @name: Voltage regulator name
249 * @min_uV: minimum micro volts
250 * @max_uV: minimum micro volts
251 * @vsel_to_uv: Function pointer to get voltage from selector
252 * @uv_to_vsel: Function pointer to get selector from voltage
253 *
254 * This data is used to check the regualtor voltage limits while setting.
255 */
256struct tps_info {
257 const char *name;
258 int min_uV;
259 int max_uV;
260 int (*vsel_to_uv)(unsigned int vsel);
261 int (*uv_to_vsel)(int uV, unsigned int *vsel);
262};
263
264/**
265 * struct tps65217 - tps65217 sub-driver chip access routines 247 * struct tps65217 - tps65217 sub-driver chip access routines
266 * 248 *
267 * Device data may be used to access the TPS65217 chip 249 * Device data may be used to access the TPS65217 chip
@@ -273,7 +255,6 @@ struct tps65217 {
273 unsigned int id; 255 unsigned int id;
274 struct regulator_desc desc[TPS65217_NUM_REGULATOR]; 256 struct regulator_desc desc[TPS65217_NUM_REGULATOR];
275 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; 257 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR];
276 struct tps_info *info[TPS65217_NUM_REGULATOR];
277 struct regmap *regmap; 258 struct regmap *regmap;
278}; 259};
279 260
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 3a76389c6aaa..27be915caa96 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -137,6 +137,12 @@ struct regulator *__must_check devm_regulator_get(struct device *dev,
137 const char *id); 137 const char *id);
138struct regulator *__must_check regulator_get_exclusive(struct device *dev, 138struct regulator *__must_check regulator_get_exclusive(struct device *dev,
139 const char *id); 139 const char *id);
140struct regulator *__must_check devm_regulator_get_exclusive(struct device *dev,
141 const char *id);
142struct regulator *__must_check regulator_get_optional(struct device *dev,
143 const char *id);
144struct regulator *__must_check devm_regulator_get_optional(struct device *dev,
145 const char *id);
140void regulator_put(struct regulator *regulator); 146void regulator_put(struct regulator *regulator);
141void devm_regulator_put(struct regulator *regulator); 147void devm_regulator_put(struct regulator *regulator);
142 148
@@ -217,6 +223,25 @@ devm_regulator_get(struct device *dev, const char *id)
217 return NULL; 223 return NULL;
218} 224}
219 225
226static inline struct regulator *__must_check
227regulator_get_exclusive(struct device *dev, const char *id)
228{
229 return NULL;
230}
231
232static inline struct regulator *__must_check
233regulator_get_optional(struct device *dev, const char *id)
234{
235 return NULL;
236}
237
238
239static inline struct regulator *__must_check
240devm_regulator_get_optional(struct device *dev, const char *id)
241{
242 return NULL;
243}
244
220static inline void regulator_put(struct regulator *regulator) 245static inline void regulator_put(struct regulator *regulator)
221{ 246{
222} 247}
@@ -369,8 +394,11 @@ static inline int regulator_count_voltages(struct regulator *regulator)
369static inline int regulator_set_voltage_tol(struct regulator *regulator, 394static inline int regulator_set_voltage_tol(struct regulator *regulator,
370 int new_uV, int tol_uV) 395 int new_uV, int tol_uV)
371{ 396{
372 return regulator_set_voltage(regulator, 397 if (regulator_set_voltage(regulator, new_uV, new_uV + tol_uV) == 0)
373 new_uV - tol_uV, new_uV + tol_uV); 398 return 0;
399 else
400 return regulator_set_voltage(regulator,
401 new_uV - tol_uV, new_uV + tol_uV);
374} 402}
375 403
376static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, 404static inline int regulator_is_supported_voltage_tol(struct regulator *regulator,
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 6700cc94bdd1..67e13aa5a478 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -40,6 +40,24 @@ enum regulator_status {
40}; 40};
41 41
42/** 42/**
43 * Specify a range of voltages for regulator_map_linar_range() and
44 * regulator_list_linear_range().
45 *
46 * @min_uV: Lowest voltage in range
47 * @max_uV: Highest voltage in range
48 * @min_sel: Lowest selector for range
49 * @max_sel: Highest selector for range
50 * @uV_step: Step size
51 */
52struct regulator_linear_range {
53 unsigned int min_uV;
54 unsigned int max_uV;
55 unsigned int min_sel;
56 unsigned int max_sel;
57 unsigned int uV_step;
58};
59
60/**
43 * struct regulator_ops - regulator operations. 61 * struct regulator_ops - regulator operations.
44 * 62 *
45 * @enable: Configure the regulator as enabled. 63 * @enable: Configure the regulator as enabled.
@@ -223,6 +241,9 @@ struct regulator_desc {
223 unsigned int linear_min_sel; 241 unsigned int linear_min_sel;
224 unsigned int ramp_delay; 242 unsigned int ramp_delay;
225 243
244 const struct regulator_linear_range *linear_ranges;
245 int n_linear_ranges;
246
226 const unsigned int *volt_table; 247 const unsigned int *volt_table;
227 248
228 unsigned int vsel_reg; 249 unsigned int vsel_reg;
@@ -326,10 +347,14 @@ int regulator_mode_to_status(unsigned int);
326 347
327int regulator_list_voltage_linear(struct regulator_dev *rdev, 348int regulator_list_voltage_linear(struct regulator_dev *rdev,
328 unsigned int selector); 349 unsigned int selector);
350int regulator_list_voltage_linear_range(struct regulator_dev *rdev,
351 unsigned int selector);
329int regulator_list_voltage_table(struct regulator_dev *rdev, 352int regulator_list_voltage_table(struct regulator_dev *rdev,
330 unsigned int selector); 353 unsigned int selector);
331int regulator_map_voltage_linear(struct regulator_dev *rdev, 354int regulator_map_voltage_linear(struct regulator_dev *rdev,
332 int min_uV, int max_uV); 355 int min_uV, int max_uV);
356int regulator_map_voltage_linear_range(struct regulator_dev *rdev,
357 int min_uV, int max_uV);
333int regulator_map_voltage_iterate(struct regulator_dev *rdev, 358int regulator_map_voltage_iterate(struct regulator_dev *rdev,
334 int min_uV, int max_uV); 359 int min_uV, int max_uV);
335int regulator_map_voltage_ascend(struct regulator_dev *rdev, 360int regulator_map_voltage_ascend(struct regulator_dev *rdev,
diff --git a/include/linux/regulator/fan53555.h b/include/linux/regulator/fan53555.h
index 5c45c85d52ca..f13880e84d85 100644
--- a/include/linux/regulator/fan53555.h
+++ b/include/linux/regulator/fan53555.h
@@ -11,6 +11,7 @@
11 */ 11 */
12 12
13#ifndef __FAN53555_H__ 13#ifndef __FAN53555_H__
14#define __FAN53555_H__
14 15
15/* VSEL ID */ 16/* VSEL ID */
16enum { 17enum {
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 36adbc82de6a..999b20ce06cf 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -134,6 +134,7 @@ struct regulation_constraints {
134 unsigned always_on:1; /* regulator never off when system is on */ 134 unsigned always_on:1; /* regulator never off when system is on */
135 unsigned boot_on:1; /* bootloader/firmware enabled regulator */ 135 unsigned boot_on:1; /* bootloader/firmware enabled regulator */
136 unsigned apply_uV:1; /* apply uV constraint if min == max */ 136 unsigned apply_uV:1; /* apply uV constraint if min == max */
137 unsigned ramp_disable:1; /* disable ramp delay */
137}; 138};
138 139
139/** 140/**
diff --git a/include/linux/regulator/max8660.h b/include/linux/regulator/max8660.h
index 9936763621c7..f8a6a4844864 100644
--- a/include/linux/regulator/max8660.h
+++ b/include/linux/regulator/max8660.h
@@ -39,7 +39,7 @@ enum {
39 */ 39 */
40struct max8660_subdev_data { 40struct max8660_subdev_data {
41 int id; 41 int id;
42 char *name; 42 const char *name;
43 struct regulator_init_data *platform_data; 43 struct regulator_init_data *platform_data;
44}; 44};
45 45
diff --git a/include/linux/regulator/pfuze100.h b/include/linux/regulator/pfuze100.h
new file mode 100644
index 000000000000..65d550bf3954
--- /dev/null
+++ b/include/linux/regulator/pfuze100.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18#ifndef __LINUX_REG_PFUZE100_H
19#define __LINUX_REG_PFUZE100_H
20
21#define PFUZE100_SW1AB 0
22#define PFUZE100_SW1C 1
23#define PFUZE100_SW2 2
24#define PFUZE100_SW3A 3
25#define PFUZE100_SW3B 4
26#define PFUZE100_SW4 5
27#define PFUZE100_SWBST 6
28#define PFUZE100_VSNVS 7
29#define PFUZE100_VREFDDR 8
30#define PFUZE100_VGEN1 9
31#define PFUZE100_VGEN2 10
32#define PFUZE100_VGEN3 11
33#define PFUZE100_VGEN4 12
34#define PFUZE100_VGEN5 13
35#define PFUZE100_VGEN6 14
36#define PFUZE100_MAX_REGULATOR 15
37
38struct regulator_init_data;
39
40struct pfuze_regulator_platform_data {
41 struct regulator_init_data *init_data[PFUZE100_MAX_REGULATOR];
42};
43
44#endif /* __LINUX_REG_PFUZE100_H */