diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-10-10 10:58:14 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2008-10-13 16:51:56 -0400 |
commit | ebccec0fa4e35dff0c18663a492a65f4dc6cad7a (patch) | |
tree | 4850a46c52d48080fa5af5349aee04b4837ab148 /include/linux/mfd/wm8350 | |
parent | bcdd4efc1b6b8b98f30e127115f4bc7bbcd6f7ce (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.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 8f2beae6278e..d86d38260c6b 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
@@ -530,6 +530,8 @@ | |||
530 | #define WM8350_REV_F 0x5 | 530 | #define WM8350_REV_F 0x5 |
531 | #define WM8350_REV_G 0x6 | 531 | #define WM8350_REV_G 0x6 |
532 | 532 | ||
533 | #define WM8350_NUM_IRQ 63 | ||
534 | |||
533 | struct wm8350_reg_access { | 535 | struct wm8350_reg_access { |
534 | u16 readable; /* Mask of readable bits */ | 536 | u16 readable; /* Mask of readable bits */ |
535 | u16 writable; /* Mask of writable bits */ | 537 | u16 writable; /* Mask of writable bits */ |
@@ -562,6 +564,12 @@ struct wm8350 { | |||
562 | int (*write_dev)(struct wm8350 *wm8350, char reg, int size, | 564 | int (*write_dev)(struct wm8350 *wm8350, char reg, int size, |
563 | void *src); | 565 | void *src); |
564 | u16 *reg_cache; | 566 | u16 *reg_cache; |
567 | |||
568 | /* Interrupt handling */ | ||
569 | struct work_struct irq_work; | ||
570 | struct mutex irq_mutex; /* IRQ table mutex */ | ||
571 | struct wm8350_irq irq[WM8350_NUM_IRQ]; | ||
572 | int chip_irq; | ||
565 | }; | 573 | }; |
566 | 574 | ||
567 | /** | 575 | /** |
@@ -578,7 +586,7 @@ struct wm8350_platform_data { | |||
578 | /* | 586 | /* |
579 | * WM8350 device initialisation and exit. | 587 | * WM8350 device initialisation and exit. |
580 | */ | 588 | */ |
581 | int wm8350_device_init(struct wm8350 *wm8350, | 589 | int wm8350_device_init(struct wm8350 *wm8350, int irq, |
582 | struct wm8350_platform_data *pdata); | 590 | struct wm8350_platform_data *pdata); |
583 | void wm8350_device_exit(struct wm8350 *wm8350); | 591 | void wm8350_device_exit(struct wm8350 *wm8350); |
584 | 592 | ||
@@ -594,4 +602,15 @@ int wm8350_reg_unlock(struct wm8350 *wm8350); | |||
594 | int wm8350_block_read(struct wm8350 *wm8350, int reg, int size, u16 *dest); | 602 | int wm8350_block_read(struct wm8350 *wm8350, int reg, int size, u16 *dest); |
595 | int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src); | 603 | int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src); |
596 | 604 | ||
605 | /* | ||
606 | * WM8350 internal interrupts | ||
607 | */ | ||
608 | int wm8350_register_irq(struct wm8350 *wm8350, int irq, | ||
609 | void (*handler) (struct wm8350 *, int, void *), | ||
610 | void *data); | ||
611 | int wm8350_free_irq(struct wm8350 *wm8350, int irq); | ||
612 | int wm8350_mask_irq(struct wm8350 *wm8350, int irq); | ||
613 | int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); | ||
614 | |||
615 | |||
597 | #endif | 616 | #endif |