diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/wm8350/core.h | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 8883125ddea1..04217a71f173 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
@@ -579,6 +579,8 @@ | |||
579 | 579 | ||
580 | #define WM8350_NUM_IRQ 63 | 580 | #define WM8350_NUM_IRQ 63 |
581 | 581 | ||
582 | #define WM8350_NUM_IRQ_REGS 7 | ||
583 | |||
582 | struct wm8350_reg_access { | 584 | struct wm8350_reg_access { |
583 | u16 readable; /* Mask of readable bits */ | 585 | u16 readable; /* Mask of readable bits */ |
584 | u16 writable; /* Mask of writable bits */ | 586 | u16 writable; /* Mask of writable bits */ |
@@ -600,11 +602,6 @@ extern const u16 wm8352_mode3_defaults[]; | |||
600 | 602 | ||
601 | struct wm8350; | 603 | struct wm8350; |
602 | 604 | ||
603 | struct wm8350_irq { | ||
604 | irq_handler_t handler; | ||
605 | void *data; | ||
606 | }; | ||
607 | |||
608 | struct wm8350_hwmon { | 605 | struct wm8350_hwmon { |
609 | struct platform_device *pdev; | 606 | struct platform_device *pdev; |
610 | struct device *classdev; | 607 | struct device *classdev; |
@@ -626,9 +623,10 @@ struct wm8350 { | |||
626 | struct mutex auxadc_mutex; | 623 | struct mutex auxadc_mutex; |
627 | 624 | ||
628 | /* Interrupt handling */ | 625 | /* Interrupt handling */ |
629 | struct mutex irq_mutex; /* IRQ table mutex */ | 626 | struct mutex irq_lock; |
630 | struct wm8350_irq irq[WM8350_NUM_IRQ]; | ||
631 | int chip_irq; | 627 | int chip_irq; |
628 | int irq_base; | ||
629 | u16 irq_masks[WM8350_NUM_IRQ_REGS]; | ||
632 | 630 | ||
633 | /* Client devices */ | 631 | /* Client devices */ |
634 | struct wm8350_codec codec; | 632 | struct wm8350_codec codec; |
@@ -677,13 +675,33 @@ int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src); | |||
677 | /* | 675 | /* |
678 | * WM8350 internal interrupts | 676 | * WM8350 internal interrupts |
679 | */ | 677 | */ |
680 | int wm8350_register_irq(struct wm8350 *wm8350, int irq, | 678 | static inline int wm8350_register_irq(struct wm8350 *wm8350, int irq, |
681 | irq_handler_t handler, unsigned long flags, | 679 | irq_handler_t handler, |
682 | const char *name, void *data); | 680 | unsigned long flags, |
683 | int wm8350_free_irq(struct wm8350 *wm8350, int irq, void *data); | 681 | const char *name, void *data) |
682 | { | ||
683 | if (!wm8350->irq_base) | ||
684 | return -ENODEV; | ||
685 | |||
686 | return request_threaded_irq(irq + wm8350->irq_base, NULL, | ||
687 | handler, flags, name, data); | ||
688 | } | ||
689 | |||
690 | static inline void wm8350_free_irq(struct wm8350 *wm8350, int irq, void *data) | ||
691 | { | ||
692 | free_irq(irq + wm8350->irq_base, data); | ||
693 | } | ||
694 | |||
695 | static inline void wm8350_mask_irq(struct wm8350 *wm8350, int irq) | ||
696 | { | ||
697 | disable_irq(irq + wm8350->irq_base); | ||
698 | } | ||
699 | |||
700 | static inline void wm8350_unmask_irq(struct wm8350 *wm8350, int irq) | ||
701 | { | ||
702 | enable_irq(irq + wm8350->irq_base); | ||
703 | } | ||
684 | 704 | ||
685 | int wm8350_mask_irq(struct wm8350 *wm8350, int irq); | ||
686 | int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); | ||
687 | int wm8350_irq_init(struct wm8350 *wm8350, int irq, | 705 | int wm8350_irq_init(struct wm8350 *wm8350, int irq, |
688 | struct wm8350_platform_data *pdata); | 706 | struct wm8350_platform_data *pdata); |
689 | int wm8350_irq_exit(struct wm8350 *wm8350); | 707 | int wm8350_irq_exit(struct wm8350 *wm8350); |