diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-09-13 05:24:41 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-09-14 05:00:51 -0400 |
commit | dba8b46992c55946d3b092934f581a343403118f (patch) | |
tree | 7ea5af971bc5cc8ecf4c8af1e0547fa11291ba86 /sound/pci/ice1712/ice1712.c | |
parent | 47124373b59e43fd07cbf7b44d9288f19c1d5a93 (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/ice1712/ice1712.c')
-rw-r--r-- | sound/pci/ice1712/ice1712.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 0ccc0eb75775..8531b983f3af 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -2748,8 +2748,9 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci, | |||
2748 | if (!c->no_mpu401) { | 2748 | if (!c->no_mpu401) { |
2749 | err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712, | 2749 | err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712, |
2750 | ICEREG(ice, MPU1_CTRL), | 2750 | ICEREG(ice, MPU1_CTRL), |
2751 | (c->mpu401_1_info_flags | MPU401_INFO_INTEGRATED), | 2751 | c->mpu401_1_info_flags | |
2752 | ice->irq, 0, &ice->rmidi[0]); | 2752 | MPU401_INFO_INTEGRATED | MPU401_INFO_IRQ_HOOK, |
2753 | -1, &ice->rmidi[0]); | ||
2753 | if (err < 0) { | 2754 | if (err < 0) { |
2754 | snd_card_free(card); | 2755 | snd_card_free(card); |
2755 | return err; | 2756 | return err; |
@@ -2764,8 +2765,9 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci, | |||
2764 | /* 2nd port used */ | 2765 | /* 2nd port used */ |
2765 | err = snd_mpu401_uart_new(card, 1, MPU401_HW_ICE1712, | 2766 | err = snd_mpu401_uart_new(card, 1, MPU401_HW_ICE1712, |
2766 | ICEREG(ice, MPU2_CTRL), | 2767 | ICEREG(ice, MPU2_CTRL), |
2767 | (c->mpu401_2_info_flags | MPU401_INFO_INTEGRATED), | 2768 | c->mpu401_2_info_flags | |
2768 | ice->irq, 0, &ice->rmidi[1]); | 2769 | MPU401_INFO_INTEGRATED | MPU401_INFO_IRQ_HOOK, |
2770 | -1, &ice->rmidi[1]); | ||
2769 | 2771 | ||
2770 | if (err < 0) { | 2772 | if (err < 0) { |
2771 | snd_card_free(card); | 2773 | snd_card_free(card); |