aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 13:04:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 13:04:37 -0400
commitfd8b327ee46593ccc5230bfd053287fbf7c38a69 (patch)
treef4927e5d71ce5004f0d8ccca7f8de57851280841 /include
parent0c9af2807490cc5f4d2833799482c391a3a3fee4 (diff)
parent63209a71e8e7727f52208d17bb7180cd392edcfb (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: (41 commits) regulator: Add some brief design documentation regulator: fix voltage range in da9034 ldo12 regulator/driver: be more specific in nanodoc for is_enabled regulator/lp3971: drop unnecessary initialization regulator: drop 'default n' regulator: fix typos regulator: fix calculation of voltage range in da9034_set_ldo12_voltage() regulator: update a filename in documentation drivers/regulator/Kconfig: fix typo (s/Usersapce/Userspace/) in REGULATOR_USERSPACE_CONSUMER description REGULATOR Handle positive returncode from enable regulator: tps650xx - build fixes for x86_64 Fix some regulator documentation Regulator: Adding TPS65023 and TPS6507x in Kconfig and Makefile Regulator: Add TPS6507x regulator driver Regulator: Add TPS65023 regulator driver regulator: userspace: use sysfs_create_group regulator: Add GPIO enable control to fixed voltage regulator driver Regulator: Implement list_voltage for pcf50633 regulator driver. regulator: regulator_enable() permission checking regulator: Push locking for regulator_is_enabled() out ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/da903x.h4
-rw-r--r--include/linux/regulator/consumer.h4
-rw-r--r--include/linux/regulator/driver.h5
-rw-r--r--include/linux/regulator/fixed.h24
-rw-r--r--include/linux/regulator/machine.h26
-rw-r--r--include/linux/regulator/max1586.h4
6 files changed, 59 insertions, 8 deletions
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h
index 115dbe965082..c63b65c94429 100644
--- a/include/linux/mfd/da903x.h
+++ b/include/linux/mfd/da903x.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_PMIC_DA903X_H 1#ifndef __LINUX_PMIC_DA903X_H
2#define __LINUX_PMIC_DA903X_H 2#define __LINUX_PMIC_DA903X_H
3 3
4/* Unified sub device IDs for DA9030/DA9034 */ 4/* Unified sub device IDs for DA9030/DA9034/DA9035 */
5enum { 5enum {
6 DA9030_ID_LED_1, 6 DA9030_ID_LED_1,
7 DA9030_ID_LED_2, 7 DA9030_ID_LED_2,
@@ -57,6 +57,8 @@ enum {
57 DA9034_ID_LDO13, 57 DA9034_ID_LDO13,
58 DA9034_ID_LDO14, 58 DA9034_ID_LDO14,
59 DA9034_ID_LDO15, 59 DA9034_ID_LDO15,
60
61 DA9035_ID_BUCK3,
60}; 62};
61 63
62/* 64/*
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 ce1be708ca16..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 */
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.