diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-06-07 06:47:28 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-07-31 17:28:20 -0400 |
commit | 78bb3688ea1830672b8095fb6388593f582cd591 (patch) | |
tree | 06e10d5acd11ae3a2235d05fdf82880b0b40371a /include | |
parent | a2495bc727e2dd8421fb85c80e38f9a4a4c1e58e (diff) |
mfd: Support multiple active WM831x AUXADC conversions
The WM831x AUXADC hardware can schedule multiple conversions at once,
allowing higher performance when more than one source is in use as we
can have the hardware start new conversions without having to wait for
a register write.
Take advantage of this in the interrupt driven case, maintaining a list of
callers that are waiting for AUXADC conversions and completing them all
simultaneously. The external interface of the AUXADC is not changed so
there will be limited use of the feature immediately.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/wm831x/core.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index 592e4fd6ab3f..9fa14cdc1590 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/completion.h> | 18 | #include <linux/completion.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/list.h> | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * Register values. | 23 | * Register values. |
@@ -249,6 +250,12 @@ enum wm831x_parent { | |||
249 | WM8326 = 0x8326, | 250 | WM8326 = 0x8326, |
250 | }; | 251 | }; |
251 | 252 | ||
253 | struct wm831x; | ||
254 | enum wm831x_auxadc; | ||
255 | |||
256 | typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x, | ||
257 | enum wm831x_auxadc input); | ||
258 | |||
252 | struct wm831x { | 259 | struct wm831x { |
253 | struct mutex io_lock; | 260 | struct mutex io_lock; |
254 | 261 | ||
@@ -277,8 +284,9 @@ struct wm831x { | |||
277 | int gpio_update[WM831X_NUM_GPIO_REGS]; | 284 | int gpio_update[WM831X_NUM_GPIO_REGS]; |
278 | 285 | ||
279 | struct mutex auxadc_lock; | 286 | struct mutex auxadc_lock; |
280 | struct completion auxadc_done; | 287 | struct list_head auxadc_pending; |
281 | u16 auxadc_data; | 288 | u16 auxadc_active; |
289 | wm831x_auxadc_read_fn auxadc_read; | ||
282 | 290 | ||
283 | /* The WM831x has a security key blocking access to certain | 291 | /* The WM831x has a security key blocking access to certain |
284 | * registers. The mutex is taken by the accessors for locking | 292 | * registers. The mutex is taken by the accessors for locking |
@@ -305,5 +313,6 @@ void wm831x_device_exit(struct wm831x *wm831x); | |||
305 | int wm831x_device_suspend(struct wm831x *wm831x); | 313 | int wm831x_device_suspend(struct wm831x *wm831x); |
306 | int wm831x_irq_init(struct wm831x *wm831x, int irq); | 314 | int wm831x_irq_init(struct wm831x *wm831x, int irq); |
307 | void wm831x_irq_exit(struct wm831x *wm831x); | 315 | void wm831x_irq_exit(struct wm831x *wm831x); |
316 | void wm831x_auxadc_init(struct wm831x *wm831x); | ||
308 | 317 | ||
309 | #endif | 318 | #endif |