aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/azt3328.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-09-13 05:24:41 -0400
committerTakashi Iwai <tiwai@suse.de>2011-09-14 05:00:51 -0400
commitdba8b46992c55946d3b092934f581a343403118f (patch)
tree7ea5af971bc5cc8ecf4c8af1e0547fa11291ba86 /sound/pci/azt3328.c
parent47124373b59e43fd07cbf7b44d9288f19c1d5a93 (diff)
ALSA: mpu401: clean up interrupt specification
The semantics of snd_mpu401_uart_new()'s interrupt parameters are somewhat counterintuitive: To prevent the function from allocating its own interrupt, either the irq number must be invalid, or the irq_flags parameter must be zero. At the same time, the irq parameter being invalid specifies that the mpu401 code has to work without an interrupt allocated by the caller. This implies that, if there is an interrupt and it is allocated by the caller, the irq parameter must be set to a valid-looking number which then isn't actually used. With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value, which forces us to handle the parameters differently. This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the device interrupt is handled by the caller, and makes the allocation of the interrupt to depend only on the irq parameter. As suggested by Takashi, the irq_flags parameter was dropped because, when used, it had the constant value IRQF_DISABLED. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/azt3328.c')
-rw-r--r--sound/pci/azt3328.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 579fc0dce128..d24fe425e87f 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -2652,8 +2652,9 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
2652 since our hardware ought to be similar, thus use same ID. */ 2652 since our hardware ought to be similar, thus use same ID. */
2653 err = snd_mpu401_uart_new( 2653 err = snd_mpu401_uart_new(
2654 card, 0, 2654 card, 0,
2655 MPU401_HW_AZT2320, chip->mpu_io, MPU401_INFO_INTEGRATED, 2655 MPU401_HW_AZT2320, chip->mpu_io,
2656 pci->irq, 0, &chip->rmidi 2656 MPU401_INFO_INTEGRATED | MPU401_INFO_IRQ_HOOK,
2657 -1, &chip->rmidi
2657 ); 2658 );
2658 if (err < 0) { 2659 if (err < 0) {
2659 snd_printk(KERN_ERR "azf3328: no MPU-401 device at 0x%lx?\n", 2660 snd_printk(KERN_ERR "azf3328: no MPU-401 device at 0x%lx?\n",