aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-03-24 07:29:58 -0400
committerArnd Bergmann <arnd@arndb.de>2012-03-24 07:29:58 -0400
commit511f1cb6d426938fabf9c6d69ce4861b66ffd919 (patch)
tree88fd9b5c15ccb42d5d582f83e87ce5d3f16127cb /include/linux/regulator
parentf907ab06bb021bcb91d39c8d1b36536ebdb318fa (diff)
parent4992fa1fd425f1934f503ffa96b68e235b89db9a (diff)
Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into next/drivers
The pxa regulator branch removes the bq24022 driver, while a lot of other regulator drivers got added in the regulator tree. This resolves the trivial conflicts by merging in the regulator patches that are already merged into v3.4. Conflicts: drivers/regulator/Kconfig drivers/regulator/Makefile Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/consumer.h22
-rw-r--r--include/linux/regulator/driver.h6
-rw-r--r--include/linux/regulator/fixed.h13
-rw-r--r--include/linux/regulator/machine.h2
-rw-r--r--include/linux/regulator/tps62360.h57
5 files changed, 94 insertions, 6 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index f2698a0edfc4..b6c8d717c7ec 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -132,9 +132,12 @@ struct regulator_bulk_data {
132/* regulator get and put */ 132/* regulator get and put */
133struct regulator *__must_check regulator_get(struct device *dev, 133struct regulator *__must_check regulator_get(struct device *dev,
134 const char *id); 134 const char *id);
135struct regulator *__must_check devm_regulator_get(struct device *dev,
136 const char *id);
135struct regulator *__must_check regulator_get_exclusive(struct device *dev, 137struct regulator *__must_check regulator_get_exclusive(struct device *dev,
136 const char *id); 138 const char *id);
137void regulator_put(struct regulator *regulator); 139void regulator_put(struct regulator *regulator);
140void devm_regulator_put(struct regulator *regulator);
138 141
139/* regulator output control and status */ 142/* regulator output control and status */
140int regulator_enable(struct regulator *regulator); 143int regulator_enable(struct regulator *regulator);
@@ -145,6 +148,8 @@ int regulator_disable_deferred(struct regulator *regulator, int ms);
145 148
146int regulator_bulk_get(struct device *dev, int num_consumers, 149int regulator_bulk_get(struct device *dev, int num_consumers,
147 struct regulator_bulk_data *consumers); 150 struct regulator_bulk_data *consumers);
151int devm_regulator_bulk_get(struct device *dev, int num_consumers,
152 struct regulator_bulk_data *consumers);
148int regulator_bulk_enable(int num_consumers, 153int regulator_bulk_enable(int num_consumers,
149 struct regulator_bulk_data *consumers); 154 struct regulator_bulk_data *consumers);
150int regulator_bulk_disable(int num_consumers, 155int regulator_bulk_disable(int num_consumers,
@@ -200,10 +205,21 @@ static inline struct regulator *__must_check regulator_get(struct device *dev,
200 */ 205 */
201 return NULL; 206 return NULL;
202} 207}
208
209static inline struct regulator *__must_check
210devm_regulator_get(struct device *dev, const char *id)
211{
212 return NULL;
213}
214
203static inline void regulator_put(struct regulator *regulator) 215static inline void regulator_put(struct regulator *regulator)
204{ 216{
205} 217}
206 218
219static inline void devm_regulator_put(struct regulator *regulator)
220{
221}
222
207static inline int regulator_enable(struct regulator *regulator) 223static inline int regulator_enable(struct regulator *regulator)
208{ 224{
209 return 0; 225 return 0;
@@ -237,6 +253,12 @@ static inline int regulator_bulk_get(struct device *dev,
237 return 0; 253 return 0;
238} 254}
239 255
256static inline int devm_regulator_bulk_get(struct device *dev, int num_consumers,
257 struct regulator_bulk_data *consumers)
258{
259 return 0;
260}
261
240static inline int regulator_bulk_enable(int num_consumers, 262static inline int regulator_bulk_enable(int num_consumers,
241 struct regulator_bulk_data *consumers) 263 struct regulator_bulk_data *consumers)
242{ 264{
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 4214b9a9d1c9..fa8b55b8191c 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -104,7 +104,7 @@ struct regulator_ops {
104 int (*disable) (struct regulator_dev *); 104 int (*disable) (struct regulator_dev *);
105 int (*is_enabled) (struct regulator_dev *); 105 int (*is_enabled) (struct regulator_dev *);
106 106
107 /* get/set regulator operating mode (defined in regulator.h) */ 107 /* get/set regulator operating mode (defined in consumer.h) */
108 int (*set_mode) (struct regulator_dev *, unsigned int mode); 108 int (*set_mode) (struct regulator_dev *, unsigned int mode);
109 unsigned int (*get_mode) (struct regulator_dev *); 109 unsigned int (*get_mode) (struct regulator_dev *);
110 110
@@ -135,7 +135,7 @@ struct regulator_ops {
135 int (*set_suspend_enable) (struct regulator_dev *); 135 int (*set_suspend_enable) (struct regulator_dev *);
136 int (*set_suspend_disable) (struct regulator_dev *); 136 int (*set_suspend_disable) (struct regulator_dev *);
137 137
138 /* set regulator suspend operating mode (defined in regulator.h) */ 138 /* set regulator suspend operating mode (defined in consumer.h) */
139 int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode); 139 int (*set_suspend_mode) (struct regulator_dev *, unsigned int mode);
140}; 140};
141 141
@@ -207,9 +207,7 @@ struct regulator_dev {
207 207
208 void *reg_data; /* regulator_dev data */ 208 void *reg_data; /* regulator_dev data */
209 209
210#ifdef CONFIG_DEBUG_FS
211 struct dentry *debugfs; 210 struct dentry *debugfs;
212#endif
213}; 211};
214 212
215struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, 213struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
index ffd7d508e726..936a7d8c11a9 100644
--- a/include/linux/regulator/fixed.h
+++ b/include/linux/regulator/fixed.h
@@ -48,4 +48,17 @@ struct fixed_voltage_config {
48 struct regulator_init_data *init_data; 48 struct regulator_init_data *init_data;
49}; 49};
50 50
51struct regulator_consumer_supply;
52
53#if IS_ENABLED(CONFIG_REGULATOR)
54struct platform_device *regulator_register_fixed(int id,
55 struct regulator_consumer_supply *supplies, int num_supplies);
56#else
57static inline struct platform_device *regulator_register_fixed(int id,
58 struct regulator_consumer_supply *supplies, int num_supplies)
59{
60 return NULL;
61}
62#endif
63
51#endif 64#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index f3f13fd5868f..7abb16093312 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -139,12 +139,10 @@ struct regulation_constraints {
139 * make struct device available late such as I2C and is the preferred 139 * make struct device available late such as I2C and is the preferred
140 * form. 140 * form.
141 * 141 *
142 * @dev: Device structure for the consumer.
143 * @dev_name: Result of dev_name() for the consumer. 142 * @dev_name: Result of dev_name() for the consumer.
144 * @supply: Name for the supply. 143 * @supply: Name for the supply.
145 */ 144 */
146struct regulator_consumer_supply { 145struct regulator_consumer_supply {
147 struct device *dev; /* consumer */
148 const char *dev_name; /* dev_name() for consumer */ 146 const char *dev_name; /* dev_name() for consumer */
149 const char *supply; /* consumer supply - e.g. "vcc" */ 147 const char *supply; /* consumer supply - e.g. "vcc" */
150}; 148};
diff --git a/include/linux/regulator/tps62360.h b/include/linux/regulator/tps62360.h
new file mode 100644
index 000000000000..6a5c1b2c751e
--- /dev/null
+++ b/include/linux/regulator/tps62360.h
@@ -0,0 +1,57 @@
1/*
2 * tps62360.h -- TI tps62360
3 *
4 * Interface for regulator driver for TI TPS62360 Processor core supply
5 *
6 * Copyright (C) 2012 NVIDIA Corporation
7
8 * Author: Laxman Dewangan <ldewangan@nvidia.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 *
24 */
25
26#ifndef __LINUX_REGULATOR_TPS62360_H
27#define __LINUX_REGULATOR_TPS62360_H
28
29#include <linux/regulator/machine.h>
30
31/*
32 * struct tps62360_regulator_platform_data - tps62360 regulator platform data.
33 *
34 * @reg_init_data: The regulator init data.
35 * @en_force_pwm: Enable force pwm or not.
36 * @en_discharge: Enable discharge the output capacitor via internal
37 * register.
38 * @en_internal_pulldn: internal pull down enable or not.
39 * @vsel0_gpio: Gpio number for vsel0. It should be -1 if this is tied with
40 * fixed logic.
41 * @vsel1_gpio: Gpio number for vsel1. It should be -1 if this is tied with
42 * fixed logic.
43 * @vsel0_def_state: Default state of vsel0. 1 if it is high else 0.
44 * @vsel1_def_state: Default state of vsel1. 1 if it is high else 0.
45 */
46struct tps62360_regulator_platform_data {
47 struct regulator_init_data reg_init_data;
48 bool en_force_pwm;
49 bool en_discharge;
50 bool en_internal_pulldn;
51 int vsel0_gpio;
52 int vsel1_gpio;
53 int vsel0_def_state;
54 int vsel1_def_state;
55};
56
57#endif /* __LINUX_REGULATOR_TPS62360_H */