aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen_lib.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-01-28 02:34:21 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:30:17 -0500
commit1e821dd2763c97df1a0a451e553d218cb8886cd7 (patch)
treec09376cd0e36251f1c83ec6bf4e52a7226db7811 /sound/pci/oxygen/oxygen_lib.c
parent911b499af45e879ccf4b8db234278a7136d056c9 (diff)
[ALSA] oxygen: use AC97 interrupt
After an AC97 register read or write, use the AC97 interrupt instead of polling to wait for the access to be completed. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/oxygen/oxygen_lib.c')
-rw-r--r--sound/pci/oxygen/oxygen_lib.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index d98867c1f2d4..de6bf41c3e96 100644
--- a/sound/pci/oxygen/oxygen_lib.c
+++ b/sound/pci/oxygen/oxygen_lib.c
@@ -53,7 +53,8 @@ static irqreturn_t oxygen_interrupt(int dummy, void *dev_id)
53 OXYGEN_CHANNEL_MULTICH | 53 OXYGEN_CHANNEL_MULTICH |
54 OXYGEN_CHANNEL_AC97 | 54 OXYGEN_CHANNEL_AC97 |
55 OXYGEN_INT_SPDIF_IN_DETECT | 55 OXYGEN_INT_SPDIF_IN_DETECT |
56 OXYGEN_INT_GPIO); 56 OXYGEN_INT_GPIO |
57 OXYGEN_INT_AC97);
57 if (clear) { 58 if (clear) {
58 if (clear & OXYGEN_INT_SPDIF_IN_DETECT) 59 if (clear & OXYGEN_INT_SPDIF_IN_DETECT)
59 chip->interrupt_mask &= ~OXYGEN_INT_SPDIF_IN_DETECT; 60 chip->interrupt_mask &= ~OXYGEN_INT_SPDIF_IN_DETECT;
@@ -89,6 +90,9 @@ static irqreturn_t oxygen_interrupt(int dummy, void *dev_id)
89 if ((status & OXYGEN_INT_MIDI) && chip->midi) 90 if ((status & OXYGEN_INT_MIDI) && chip->midi)
90 snd_mpu401_uart_interrupt(0, chip->midi->private_data); 91 snd_mpu401_uart_interrupt(0, chip->midi->private_data);
91 92
93 if (status & OXYGEN_INT_AC97)
94 wake_up(&chip->ac97_waitqueue);
95
92 return IRQ_HANDLED; 96 return IRQ_HANDLED;
93} 97}
94 98
@@ -306,7 +310,9 @@ static void __devinit oxygen_init(struct oxygen *chip)
306 (2 << OXYGEN_A_MONITOR_ROUTE_2_SHIFT) | 310 (2 << OXYGEN_A_MONITOR_ROUTE_2_SHIFT) |
307 (3 << OXYGEN_A_MONITOR_ROUTE_3_SHIFT)); 311 (3 << OXYGEN_A_MONITOR_ROUTE_3_SHIFT));
308 312
309 oxygen_write8(chip, OXYGEN_AC97_INTERRUPT_MASK, 0); 313 oxygen_write8(chip, OXYGEN_AC97_INTERRUPT_MASK,
314 OXYGEN_AC97_INT_READ_DONE |
315 OXYGEN_AC97_INT_WRITE_DONE);
310 oxygen_write32(chip, OXYGEN_AC97_OUT_CONFIG, 0); 316 oxygen_write32(chip, OXYGEN_AC97_OUT_CONFIG, 0);
311 oxygen_write32(chip, OXYGEN_AC97_IN_CONFIG, 0); 317 oxygen_write32(chip, OXYGEN_AC97_IN_CONFIG, 0);
312 if (!(chip->has_ac97_0 | chip->has_ac97_1)) 318 if (!(chip->has_ac97_0 | chip->has_ac97_1))
@@ -408,6 +414,7 @@ int __devinit oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
408 mutex_init(&chip->mutex); 414 mutex_init(&chip->mutex);
409 INIT_WORK(&chip->spdif_input_bits_work, 415 INIT_WORK(&chip->spdif_input_bits_work,
410 oxygen_spdif_input_bits_changed); 416 oxygen_spdif_input_bits_changed);
417 init_waitqueue_head(&chip->ac97_waitqueue);
411 418
412 err = pci_enable_device(pci); 419 err = pci_enable_device(pci);
413 if (err < 0) 420 if (err < 0)
@@ -471,7 +478,7 @@ int __devinit oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
471 oxygen_proc_init(chip); 478 oxygen_proc_init(chip);
472 479
473 spin_lock_irq(&chip->reg_lock); 480 spin_lock_irq(&chip->reg_lock);
474 chip->interrupt_mask |= OXYGEN_INT_SPDIF_IN_DETECT; 481 chip->interrupt_mask |= OXYGEN_INT_SPDIF_IN_DETECT | OXYGEN_INT_AC97;
475 oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, chip->interrupt_mask); 482 oxygen_write16(chip, OXYGEN_INTERRUPT_MASK, chip->interrupt_mask);
476 spin_unlock_irq(&chip->reg_lock); 483 spin_unlock_irq(&chip->reg_lock);
477 484