提交 ebccec0f 编写于 作者: M Mark Brown 提交者: Liam Girdwood

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: NMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: NSamuel Ortiz <sameo@openedhand.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 bcdd4efc
此差异已折叠。
......@@ -65,7 +65,7 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
wm8350->read_dev = wm8350_i2c_read_device;
wm8350->write_dev = wm8350_i2c_write_device;
ret = wm8350_device_init(wm8350, i2c->dev.platform_data);
ret = wm8350_device_init(wm8350, i2c->irq, i2c->dev.platform_data);
if (ret < 0)
goto err;
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册