aboutsummaryrefslogtreecommitdiff
path: root/include/linux/mfd/wm8350
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-10-10 15:58:14 +0100
committerLiam Girdwood <lrg@slimlogic.co.uk>2008-10-13 21:51:56 +0100
commitebccec0fa4e35dff0c18663a492a65f4dc6cad7a (patch)
tree4850a46c52d48080fa5af5349aee04b4837ab148 /include/linux/mfd/wm8350
parentbcdd4efc1b6b8b98f30e127115f4bc7bbcd6f7ce (diff)
mfd: Add WM8350 interrupt support
The WM8350 has an interrupt line to the CPU which is shared by the devices on the CPU. This patch adds support for the interrupt controller within the WM8350 which identifies which identifies the interrupt cause. In common with other similar chips this is done outside the standard interrupt framework due to the need to access the interrupt controller over an interrupt-driven bus. This code was all originally written by Liam Girdwood with updates for submission by me. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@openedhand.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'include/linux/mfd/wm8350')
-rw-r--r--include/linux/mfd/wm8350/core.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index 8f2beae6278..d86d38260c6 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -530,6 +530,8 @@
#define WM8350_REV_F 0x5
#define WM8350_REV_G 0x6
+#define WM8350_NUM_IRQ 63
+
struct wm8350_reg_access {
u16 readable; /* Mask of readable bits */
u16 writable; /* Mask of writable bits */
@@ -562,6 +564,12 @@ struct wm8350 {
int (*write_dev)(struct wm8350 *wm8350, char reg, int size,
void *src);
u16 *reg_cache;
+
+ /* Interrupt handling */
+ struct work_struct irq_work;
+ struct mutex irq_mutex; /* IRQ table mutex */
+ struct wm8350_irq irq[WM8350_NUM_IRQ];
+ int chip_irq;
};
/**
@@ -578,7 +586,7 @@ struct wm8350_platform_data {
/*
* WM8350 device initialisation and exit.
*/
-int wm8350_device_init(struct wm8350 *wm8350,
+int wm8350_device_init(struct wm8350 *wm8350, int irq,
struct wm8350_platform_data *pdata);
void wm8350_device_exit(struct wm8350 *wm8350);
@@ -594,4 +602,15 @@ int wm8350_reg_unlock(struct wm8350 *wm8350);
int wm8350_block_read(struct wm8350 *wm8350, int reg, int size, u16 *dest);
int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src);
+/*
+ * WM8350 internal interrupts
+ */
+int wm8350_register_irq(struct wm8350 *wm8350, int irq,
+ void (*handler) (struct wm8350 *, int, void *),
+ void *data);
+int wm8350_free_irq(struct wm8350 *wm8350, int irq);
+int wm8350_mask_irq(struct wm8350 *wm8350, int irq);
+int wm8350_unmask_irq(struct wm8350 *wm8350, int irq);
+
+
#endif