aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 13:34:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 13:34:56 -0400
commitd15d76448bb58c7832e954b6a8f1e301720b7866 (patch)
tree7891c9e0779f5df33840be9cdba1f0331459e97c /include
parent0c2fe82a9b106f1c03719783134360586d718a69 (diff)
parent4992fa1fd425f1934f503ffa96b68e235b89db9a (diff)
Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates for 3.4 from Mark Brown: "This has been a fairly quiet release from a regulator point of view, the only real framework features added were devm support and a convenience helper for setting up fixed voltage regulators. We also added a couple of drivers (but will drop the BQ240022 driver via the arm-soc tree as it's been replaced by the more generic gpio-regulator driver) and Axel Lin continued his relentless and generally awesome stream of fixes and cleanups." * tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (93 commits) regulator: Fix up a confusing dev_warn when DT lookup fails regulator: Convert tps6507x to set_voltage_sel regulator: Refactor tps6507x to use one tps6507x_pmic_ops for all LDOs and DCDCs regulator: Make s5m8767_get_voltage_register always return correct register regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier regulator: tps65910: Provide settling time for DCDC voltage change regulator: Add Anatop regulator driver regulator: Simplify implementation of tps65912_get_voltage_dcdc regulator: Use tps65912_set_voltage_sel for both DCDCx and LDOx regulator: tps65910: Provide settling time for enabling rails regulator: max8925: Use DIV_ROUND_UP macro regulator: tps65912: Use simple equations to get register address regulator: Fix the logic of tps65910_get_mode regulator: Merge tps65217_pmic_ldo234_ops and tps65217_pmic_dcdc_ops to tps65217_pmic_ops regulator: Use DIV_ROUND_CLOSEST in wm8350_isink_get_current regulator: Use array to store dcdc_range settings for tps65912 regulator: Rename s5m8767_convert_voltage to s5m8767_convert_voltage_to_sel regulator: tps6524x: Remove unneeded comment for N_REGULATORS regulator: Rename set_voltage_sel callback function name to *_sel regulator: Fix s5m8767_set_voltage_time_sel calculation value ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/i2c/twl.h14
-rw-r--r--include/linux/mfd/tps65910.h7
-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
7 files changed, 113 insertions, 8 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 78d3465251d6..7fcab23c59ce 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -712,6 +712,9 @@ struct twl4030_platform_data {
712 struct regulator_init_data *vaux1; 712 struct regulator_init_data *vaux1;
713 struct regulator_init_data *vaux2; 713 struct regulator_init_data *vaux2;
714 struct regulator_init_data *vaux3; 714 struct regulator_init_data *vaux3;
715 struct regulator_init_data *vdd1;
716 struct regulator_init_data *vdd2;
717 struct regulator_init_data *vdd3;
715 /* TWL4030 LDO regulators */ 718 /* TWL4030 LDO regulators */
716 struct regulator_init_data *vpll1; 719 struct regulator_init_data *vpll1;
717 struct regulator_init_data *vpll2; 720 struct regulator_init_data *vpll2;
@@ -720,8 +723,6 @@ struct twl4030_platform_data {
720 struct regulator_init_data *vsim; 723 struct regulator_init_data *vsim;
721 struct regulator_init_data *vaux4; 724 struct regulator_init_data *vaux4;
722 struct regulator_init_data *vio; 725 struct regulator_init_data *vio;
723 struct regulator_init_data *vdd1;
724 struct regulator_init_data *vdd2;
725 struct regulator_init_data *vintana1; 726 struct regulator_init_data *vintana1;
726 struct regulator_init_data *vintana2; 727 struct regulator_init_data *vintana2;
727 struct regulator_init_data *vintdig; 728 struct regulator_init_data *vintdig;
@@ -733,6 +734,8 @@ struct twl4030_platform_data {
733 struct regulator_init_data *vcxio; 734 struct regulator_init_data *vcxio;
734 struct regulator_init_data *vusb; 735 struct regulator_init_data *vusb;
735 struct regulator_init_data *clk32kg; 736 struct regulator_init_data *clk32kg;
737 struct regulator_init_data *v1v8;
738 struct regulator_init_data *v2v1;
736 /* TWL6025 LDO regulators */ 739 /* TWL6025 LDO regulators */
737 struct regulator_init_data *ldo1; 740 struct regulator_init_data *ldo1;
738 struct regulator_init_data *ldo2; 741 struct regulator_init_data *ldo2;
@@ -749,6 +752,13 @@ struct twl4030_platform_data {
749 struct regulator_init_data *vio6025; 752 struct regulator_init_data *vio6025;
750}; 753};
751 754
755struct twl_regulator_driver_data {
756 int (*set_voltage)(void *data, int target_uV);
757 int (*get_voltage)(void *data);
758 void *data;
759 unsigned long features;
760};
761
752/*----------------------------------------------------------------------*/ 762/*----------------------------------------------------------------------*/
753 763
754int twl4030_sih_setup(int module); 764int twl4030_sih_setup(int module);
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index d0cb12eba402..76700b5eee92 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -768,6 +768,12 @@
768/* Max number of TPS65910/11 regulators */ 768/* Max number of TPS65910/11 regulators */
769#define TPS65910_NUM_REGS 13 769#define TPS65910_NUM_REGS 13
770 770
771/* External sleep controls through EN1/EN2/EN3/SLEEP inputs */
772#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1
773#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN2 0x2
774#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3 0x4
775#define TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP 0x8
776
771/** 777/**
772 * struct tps65910_board 778 * struct tps65910_board
773 * Board platform data may be used to initialize regulators. 779 * Board platform data may be used to initialize regulators.
@@ -779,6 +785,7 @@ struct tps65910_board {
779 int irq_base; 785 int irq_base;
780 int vmbch_threshold; 786 int vmbch_threshold;
781 int vmbch2_threshold; 787 int vmbch2_threshold;
788 unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS];
782 struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS]; 789 struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS];
783}; 790};
784 791
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 */