diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:24:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:24:07 -0500 |
commit | 1896a1346a80b2dac1f63a338f1e2ee0b6484646 (patch) | |
tree | 825b59dd33886398f541488d2b5eb65cbd353bdb /include | |
parent | e691d24e9c5007486bef59c589c2a2d784e0c30b (diff) | |
parent | fa63bd4aa53aecc38956cbdd50f8ff9ed0d6d5ba (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: (45 commits)
regulator: missing index in PTR_ERR() in isl6271a_probe()
regulator: Assign return value of mc13xxx_reg_rmw to ret
regulator: Add initial per-regulator debugfs support
regulator: Make regulator_has_full_constraints a bool
regulator: Clean up logging a bit
regulator: Optimise out noop voltage changes
regulator: Add API to re-apply voltage to hardware
regulator: Staticise non-exported functions in mc13892
regulator: Only notify voltage changes when they succeed
regulator: Provide a selector based set_voltage_sel() operation
regulator: Factor out voltage set operation into a separate function
regulator: Convert WM8994 to use get_voltage_sel()
regulator: Convert WM835x to use get_voltage_sel()
regulator: Allow modular build of mc13xxx-core
regulator: support PMIC mc13892
make mc13783 regulator code generic
Change the register name definitions for mc13783
mach-ux500: Updated and connected ab8500 regulator board configuration
regulators: Removed macros for initialization of ab8500 regulators
regulators: Added verbose debug messages to ab8500 regulators
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/ab8500.h | 5 | ||||
-rw-r--r-- | include/linux/mfd/mc13783.h | 67 | ||||
-rw-r--r-- | include/linux/mfd/mc13892.h | 39 | ||||
-rw-r--r-- | include/linux/regulator/ab8500.h | 24 | ||||
-rw-r--r-- | include/linux/regulator/consumer.h | 1 | ||||
-rw-r--r-- | include/linux/regulator/driver.h | 19 | ||||
-rw-r--r-- | include/trace/events/regulator.h | 141 |
7 files changed, 245 insertions, 51 deletions
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h index d63b6050b183..85cf2c28fac6 100644 --- a/include/linux/mfd/ab8500.h +++ b/include/linux/mfd/ab8500.h | |||
@@ -99,8 +99,6 @@ | |||
99 | #define AB8500_NR_IRQS 104 | 99 | #define AB8500_NR_IRQS 104 |
100 | #define AB8500_NUM_IRQ_REGS 13 | 100 | #define AB8500_NUM_IRQ_REGS 13 |
101 | 101 | ||
102 | #define AB8500_NUM_REGULATORS 15 | ||
103 | |||
104 | /** | 102 | /** |
105 | * struct ab8500 - ab8500 internal structure | 103 | * struct ab8500 - ab8500 internal structure |
106 | * @dev: parent device | 104 | * @dev: parent device |
@@ -145,7 +143,8 @@ struct regulator_init_data; | |||
145 | struct ab8500_platform_data { | 143 | struct ab8500_platform_data { |
146 | int irq_base; | 144 | int irq_base; |
147 | void (*init) (struct ab8500 *); | 145 | void (*init) (struct ab8500 *); |
148 | struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; | 146 | int num_regulator; |
147 | struct regulator_init_data *regulator; | ||
149 | }; | 148 | }; |
150 | 149 | ||
151 | extern int __devinit ab8500_init(struct ab8500 *ab8500); | 150 | extern int __devinit ab8500_init(struct ab8500 *ab8500); |
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h index b4c741e352c2..7d0f3d6a0002 100644 --- a/include/linux/mfd/mc13783.h +++ b/include/linux/mfd/mc13783.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2010 Yong Shen <yong.shen@linaro.org> | ||
2 | * Copyright 2009-2010 Pengutronix | 3 | * Copyright 2009-2010 Pengutronix |
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | 4 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> |
4 | * | 5 | * |
@@ -122,39 +123,39 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | |||
122 | unsigned int channel, unsigned int *sample); | 123 | unsigned int channel, unsigned int *sample); |
123 | 124 | ||
124 | 125 | ||
125 | #define MC13783_SW_SW1A 0 | 126 | #define MC13783_REG_SW1A 0 |
126 | #define MC13783_SW_SW1B 1 | 127 | #define MC13783_REG_SW1B 1 |
127 | #define MC13783_SW_SW2A 2 | 128 | #define MC13783_REG_SW2A 2 |
128 | #define MC13783_SW_SW2B 3 | 129 | #define MC13783_REG_SW2B 3 |
129 | #define MC13783_SW_SW3 4 | 130 | #define MC13783_REG_SW3 4 |
130 | #define MC13783_SW_PLL 5 | 131 | #define MC13783_REG_PLL 5 |
131 | #define MC13783_REGU_VAUDIO 6 | 132 | #define MC13783_REG_VAUDIO 6 |
132 | #define MC13783_REGU_VIOHI 7 | 133 | #define MC13783_REG_VIOHI 7 |
133 | #define MC13783_REGU_VIOLO 8 | 134 | #define MC13783_REG_VIOLO 8 |
134 | #define MC13783_REGU_VDIG 9 | 135 | #define MC13783_REG_VDIG 9 |
135 | #define MC13783_REGU_VGEN 10 | 136 | #define MC13783_REG_VGEN 10 |
136 | #define MC13783_REGU_VRFDIG 11 | 137 | #define MC13783_REG_VRFDIG 11 |
137 | #define MC13783_REGU_VRFREF 12 | 138 | #define MC13783_REG_VRFREF 12 |
138 | #define MC13783_REGU_VRFCP 13 | 139 | #define MC13783_REG_VRFCP 13 |
139 | #define MC13783_REGU_VSIM 14 | 140 | #define MC13783_REG_VSIM 14 |
140 | #define MC13783_REGU_VESIM 15 | 141 | #define MC13783_REG_VESIM 15 |
141 | #define MC13783_REGU_VCAM 16 | 142 | #define MC13783_REG_VCAM 16 |
142 | #define MC13783_REGU_VRFBG 17 | 143 | #define MC13783_REG_VRFBG 17 |
143 | #define MC13783_REGU_VVIB 18 | 144 | #define MC13783_REG_VVIB 18 |
144 | #define MC13783_REGU_VRF1 19 | 145 | #define MC13783_REG_VRF1 19 |
145 | #define MC13783_REGU_VRF2 20 | 146 | #define MC13783_REG_VRF2 20 |
146 | #define MC13783_REGU_VMMC1 21 | 147 | #define MC13783_REG_VMMC1 21 |
147 | #define MC13783_REGU_VMMC2 22 | 148 | #define MC13783_REG_VMMC2 22 |
148 | #define MC13783_REGU_GPO1 23 | 149 | #define MC13783_REG_GPO1 23 |
149 | #define MC13783_REGU_GPO2 24 | 150 | #define MC13783_REG_GPO2 24 |
150 | #define MC13783_REGU_GPO3 25 | 151 | #define MC13783_REG_GPO3 25 |
151 | #define MC13783_REGU_GPO4 26 | 152 | #define MC13783_REG_GPO4 26 |
152 | #define MC13783_REGU_V1 27 | 153 | #define MC13783_REG_V1 27 |
153 | #define MC13783_REGU_V2 28 | 154 | #define MC13783_REG_V2 28 |
154 | #define MC13783_REGU_V3 29 | 155 | #define MC13783_REG_V3 29 |
155 | #define MC13783_REGU_V4 30 | 156 | #define MC13783_REG_V4 30 |
156 | #define MC13783_REGU_PWGT1SPI 31 | 157 | #define MC13783_REG_PWGT1SPI 31 |
157 | #define MC13783_REGU_PWGT2SPI 32 | 158 | #define MC13783_REG_PWGT2SPI 32 |
158 | 159 | ||
159 | #define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE | 160 | #define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE |
160 | #define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE | 161 | #define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE |
diff --git a/include/linux/mfd/mc13892.h b/include/linux/mfd/mc13892.h new file mode 100644 index 000000000000..a00f2bec178c --- /dev/null +++ b/include/linux/mfd/mc13892.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Yong Shen <yong.shen@linaro.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_MFD_MC13892_H | ||
10 | #define __LINUX_MFD_MC13892_H | ||
11 | |||
12 | #include <linux/mfd/mc13xxx.h> | ||
13 | |||
14 | #define MC13892_SW1 0 | ||
15 | #define MC13892_SW2 1 | ||
16 | #define MC13892_SW3 2 | ||
17 | #define MC13892_SW4 3 | ||
18 | #define MC13892_SWBST 4 | ||
19 | #define MC13892_VIOHI 5 | ||
20 | #define MC13892_VPLL 6 | ||
21 | #define MC13892_VDIG 7 | ||
22 | #define MC13892_VSD 8 | ||
23 | #define MC13892_VUSB2 9 | ||
24 | #define MC13892_VVIDEO 10 | ||
25 | #define MC13892_VAUDIO 11 | ||
26 | #define MC13892_VCAM 12 | ||
27 | #define MC13892_VGEN1 13 | ||
28 | #define MC13892_VGEN2 14 | ||
29 | #define MC13892_VGEN3 15 | ||
30 | #define MC13892_VUSB 16 | ||
31 | #define MC13892_GPO1 17 | ||
32 | #define MC13892_GPO2 18 | ||
33 | #define MC13892_GPO3 19 | ||
34 | #define MC13892_GPO4 20 | ||
35 | #define MC13892_PWGT1SPI 21 | ||
36 | #define MC13892_PWGT2SPI 22 | ||
37 | #define MC13892_VCOINCELL 23 | ||
38 | |||
39 | #endif | ||
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index f509877c2ed4..6a210f1511fc 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h | |||
@@ -11,15 +11,17 @@ | |||
11 | #define __LINUX_MFD_AB8500_REGULATOR_H | 11 | #define __LINUX_MFD_AB8500_REGULATOR_H |
12 | 12 | ||
13 | /* AB8500 regulators */ | 13 | /* AB8500 regulators */ |
14 | #define AB8500_LDO_AUX1 0 | 14 | enum ab8500_regulator_id { |
15 | #define AB8500_LDO_AUX2 1 | 15 | AB8500_LDO_AUX1, |
16 | #define AB8500_LDO_AUX3 2 | 16 | AB8500_LDO_AUX2, |
17 | #define AB8500_LDO_INTCORE 3 | 17 | AB8500_LDO_AUX3, |
18 | #define AB8500_LDO_TVOUT 4 | 18 | AB8500_LDO_INTCORE, |
19 | #define AB8500_LDO_AUDIO 5 | 19 | AB8500_LDO_TVOUT, |
20 | #define AB8500_LDO_ANAMIC1 6 | 20 | AB8500_LDO_AUDIO, |
21 | #define AB8500_LDO_ANAMIC2 7 | 21 | AB8500_LDO_ANAMIC1, |
22 | #define AB8500_LDO_DMIC 8 | 22 | AB8500_LDO_ANAMIC2, |
23 | #define AB8500_LDO_ANA 9 | 23 | AB8500_LDO_DMIC, |
24 | 24 | AB8500_LDO_ANA, | |
25 | AB8500_NUM_REGULATORS, | ||
26 | }; | ||
25 | #endif | 27 | #endif |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index ebd747265294..7954f6bd7edb 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -154,6 +154,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, | |||
154 | int min_uV, int max_uV); | 154 | int min_uV, int max_uV); |
155 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); | 155 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); |
156 | int regulator_get_voltage(struct regulator *regulator); | 156 | int regulator_get_voltage(struct regulator *regulator); |
157 | int regulator_sync_voltage(struct regulator *regulator); | ||
157 | int regulator_set_current_limit(struct regulator *regulator, | 158 | int regulator_set_current_limit(struct regulator *regulator, |
158 | int min_uA, int max_uA); | 159 | int min_uA, int max_uA); |
159 | int regulator_get_current_limit(struct regulator *regulator); | 160 | int regulator_get_current_limit(struct regulator *regulator); |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 592cd7c642c2..b8ed16a33c47 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -42,7 +42,11 @@ enum regulator_status { | |||
42 | * | 42 | * |
43 | * @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. |
44 | * The driver should select the voltage closest to min_uV. | 44 | * The driver should select the voltage closest to min_uV. |
45 | * @set_voltage_sel: Set the voltage for the regulator using the specified | ||
46 | * selector. | ||
45 | * @get_voltage: Return the currently configured voltage for the regulator. | 47 | * @get_voltage: Return the currently configured voltage for the regulator. |
48 | * @get_voltage_sel: Return the currently configured voltage selector for the | ||
49 | * regulator. | ||
46 | * @list_voltage: Return one of the supported voltages, in microvolts; zero | 50 | * @list_voltage: Return one of the supported voltages, in microvolts; zero |
47 | * if the selector indicates a voltage that is unusable on this system; | 51 | * if the selector indicates a voltage that is unusable on this system; |
48 | * or negative errno. Selectors range from zero to one less than | 52 | * or negative errno. Selectors range from zero to one less than |
@@ -79,8 +83,11 @@ struct regulator_ops { | |||
79 | int (*list_voltage) (struct regulator_dev *, unsigned selector); | 83 | int (*list_voltage) (struct regulator_dev *, unsigned selector); |
80 | 84 | ||
81 | /* get/set regulator voltage */ | 85 | /* get/set regulator voltage */ |
82 | int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV); | 86 | int (*set_voltage) (struct regulator_dev *, int min_uV, int max_uV, |
87 | unsigned *selector); | ||
88 | int (*set_voltage_sel) (struct regulator_dev *, unsigned selector); | ||
83 | int (*get_voltage) (struct regulator_dev *); | 89 | int (*get_voltage) (struct regulator_dev *); |
90 | int (*get_voltage_sel) (struct regulator_dev *); | ||
84 | 91 | ||
85 | /* get/set regulator current */ | 92 | /* get/set regulator current */ |
86 | int (*set_current_limit) (struct regulator_dev *, | 93 | int (*set_current_limit) (struct regulator_dev *, |
@@ -168,9 +175,9 @@ struct regulator_desc { | |||
168 | */ | 175 | */ |
169 | struct regulator_dev { | 176 | struct regulator_dev { |
170 | struct regulator_desc *desc; | 177 | struct regulator_desc *desc; |
171 | int use_count; | ||
172 | int open_count; | ||
173 | int exclusive; | 178 | int exclusive; |
179 | u32 use_count; | ||
180 | u32 open_count; | ||
174 | 181 | ||
175 | /* lists we belong to */ | 182 | /* lists we belong to */ |
176 | struct list_head list; /* list of all regulators */ | 183 | struct list_head list; /* list of all regulators */ |
@@ -188,10 +195,14 @@ struct regulator_dev { | |||
188 | struct regulator_dev *supply; /* for tree */ | 195 | struct regulator_dev *supply; /* for tree */ |
189 | 196 | ||
190 | void *reg_data; /* regulator_dev data */ | 197 | void *reg_data; /* regulator_dev data */ |
198 | |||
199 | #ifdef CONFIG_DEBUG_FS | ||
200 | struct dentry *debugfs; | ||
201 | #endif | ||
191 | }; | 202 | }; |
192 | 203 | ||
193 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | 204 | struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, |
194 | struct device *dev, struct regulator_init_data *init_data, | 205 | struct device *dev, const struct regulator_init_data *init_data, |
195 | void *driver_data); | 206 | void *driver_data); |
196 | void regulator_unregister(struct regulator_dev *rdev); | 207 | void regulator_unregister(struct regulator_dev *rdev); |
197 | 208 | ||
diff --git a/include/trace/events/regulator.h b/include/trace/events/regulator.h new file mode 100644 index 000000000000..37502a7404b7 --- /dev/null +++ b/include/trace/events/regulator.h | |||
@@ -0,0 +1,141 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM regulator | ||
3 | |||
4 | #if !defined(_TRACE_REGULATOR_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_REGULATOR_H | ||
6 | |||
7 | #include <linux/ktime.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | /* | ||
11 | * Events which just log themselves and the regulator name for enable/disable | ||
12 | * type tracking. | ||
13 | */ | ||
14 | DECLARE_EVENT_CLASS(regulator_basic, | ||
15 | |||
16 | TP_PROTO(const char *name), | ||
17 | |||
18 | TP_ARGS(name), | ||
19 | |||
20 | TP_STRUCT__entry( | ||
21 | __string( name, name ) | ||
22 | ), | ||
23 | |||
24 | TP_fast_assign( | ||
25 | __assign_str(name, name); | ||
26 | ), | ||
27 | |||
28 | TP_printk("name=%s", __get_str(name)) | ||
29 | |||
30 | ); | ||
31 | |||
32 | DEFINE_EVENT(regulator_basic, regulator_enable, | ||
33 | |||
34 | TP_PROTO(const char *name), | ||
35 | |||
36 | TP_ARGS(name) | ||
37 | |||
38 | ); | ||
39 | |||
40 | DEFINE_EVENT(regulator_basic, regulator_enable_delay, | ||
41 | |||
42 | TP_PROTO(const char *name), | ||
43 | |||
44 | TP_ARGS(name) | ||
45 | |||
46 | ); | ||
47 | |||
48 | DEFINE_EVENT(regulator_basic, regulator_enable_complete, | ||
49 | |||
50 | TP_PROTO(const char *name), | ||
51 | |||
52 | TP_ARGS(name) | ||
53 | |||
54 | ); | ||
55 | |||
56 | DEFINE_EVENT(regulator_basic, regulator_disable, | ||
57 | |||
58 | TP_PROTO(const char *name), | ||
59 | |||
60 | TP_ARGS(name) | ||
61 | |||
62 | ); | ||
63 | |||
64 | DEFINE_EVENT(regulator_basic, regulator_disable_complete, | ||
65 | |||
66 | TP_PROTO(const char *name), | ||
67 | |||
68 | TP_ARGS(name) | ||
69 | |||
70 | ); | ||
71 | |||
72 | /* | ||
73 | * Events that take a range of numerical values, mostly for voltages | ||
74 | * and so on. | ||
75 | */ | ||
76 | DECLARE_EVENT_CLASS(regulator_range, | ||
77 | |||
78 | TP_PROTO(const char *name, int min, int max), | ||
79 | |||
80 | TP_ARGS(name, min, max), | ||
81 | |||
82 | TP_STRUCT__entry( | ||
83 | __string( name, name ) | ||
84 | __field( int, min ) | ||
85 | __field( int, max ) | ||
86 | ), | ||
87 | |||
88 | TP_fast_assign( | ||
89 | __assign_str(name, name); | ||
90 | __entry->min = min; | ||
91 | __entry->max = max; | ||
92 | ), | ||
93 | |||
94 | TP_printk("name=%s (%d-%d)", __get_str(name), | ||
95 | (int)__entry->min, (int)__entry->max) | ||
96 | ); | ||
97 | |||
98 | DEFINE_EVENT(regulator_range, regulator_set_voltage, | ||
99 | |||
100 | TP_PROTO(const char *name, int min, int max), | ||
101 | |||
102 | TP_ARGS(name, min, max) | ||
103 | |||
104 | ); | ||
105 | |||
106 | |||
107 | /* | ||
108 | * Events that take a single value, mostly for readback and refcounts. | ||
109 | */ | ||
110 | DECLARE_EVENT_CLASS(regulator_value, | ||
111 | |||
112 | TP_PROTO(const char *name, unsigned int val), | ||
113 | |||
114 | TP_ARGS(name, val), | ||
115 | |||
116 | TP_STRUCT__entry( | ||
117 | __string( name, name ) | ||
118 | __field( unsigned int, val ) | ||
119 | ), | ||
120 | |||
121 | TP_fast_assign( | ||
122 | __assign_str(name, name); | ||
123 | __entry->val = val; | ||
124 | ), | ||
125 | |||
126 | TP_printk("name=%s, val=%u", __get_str(name), | ||
127 | (int)__entry->val) | ||
128 | ); | ||
129 | |||
130 | DEFINE_EVENT(regulator_value, regulator_set_voltage_complete, | ||
131 | |||
132 | TP_PROTO(const char *name, unsigned int value), | ||
133 | |||
134 | TP_ARGS(name, value) | ||
135 | |||
136 | ); | ||
137 | |||
138 | #endif /* _TRACE_POWER_H */ | ||
139 | |||
140 | /* This part must be outside protection */ | ||
141 | #include <trace/define_trace.h> | ||