aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/wm831x/core.h
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-07-27 09:45:53 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2009-09-17 03:46:57 -0400
commit7d4d0a3e7343e3190afaa17253073db58e3d9bff (patch)
tree586ad0e591e512a567e90588a35670034fd2a6ff /include/linux/mfd/wm831x/core.h
parentd2bedfe7a8b2f34beee2cad9cae74a088ee8ed07 (diff)
mfd: Add WM831x interrupt support
The WM831x includes an interrupt controller managing interrupts for the various functions on the chip. This patch adds support for the core interrupt block on the device. Ideally this would be supported by genirq, particularly for the GPIOs, but currently genirq is unable to cope with controllers on interrupt driven buses so we cut'n'paste the generic interface. Once genirq is able to cope chips like this it should be a case of filing the prefixes off the code and redoing wm831x-irq.c to move over. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/mfd/wm831x/core.h')
-rw-r--r--include/linux/mfd/wm831x/core.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index d90e693053b..b96c9355b16 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -15,6 +15,9 @@
15#ifndef __MFD_WM831X_CORE_H__ 15#ifndef __MFD_WM831X_CORE_H__
16#define __MFD_WM831X_CORE_H__ 16#define __MFD_WM831X_CORE_H__
17 17
18#include <linux/interrupt.h>
19#include <linux/workqueue.h>
20
18/* 21/*
19 * Register values. 22 * Register values.
20 */ 23 */
@@ -224,6 +227,13 @@ struct wm831x {
224 227
225 void *control_data; 228 void *control_data;
226 229
230 int irq; /* Our chip IRQ */
231 struct mutex irq_lock;
232 struct workqueue_struct *irq_wq;
233 struct work_struct irq_work;
234 unsigned int irq_base;
235 int irq_masks[5];
236
227 /* The WM831x has a security key blocking access to certain 237 /* The WM831x has a security key blocking access to certain
228 * registers. The mutex is taken by the accessors for locking 238 * registers. The mutex is taken by the accessors for locking
229 * and unlocking the security key, locked is used to fail 239 * and unlocking the security key, locked is used to fail
@@ -244,4 +254,15 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
244int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, 254int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
245 int count, u16 *buf); 255 int count, u16 *buf);
246 256
257int wm831x_irq_init(struct wm831x *wm831x, int irq);
258void wm831x_irq_exit(struct wm831x *wm831x);
259
260int __must_check wm831x_request_irq(struct wm831x *wm831x,
261 unsigned int irq, irq_handler_t handler,
262 unsigned long flags, const char *name,
263 void *dev);
264void wm831x_free_irq(struct wm831x *wm831x, unsigned int, void *);
265void wm831x_disable_irq(struct wm831x *wm831x, int irq);
266void wm831x_enable_irq(struct wm831x *wm831x, int irq);
267
247#endif 268#endif