summaryrefslogtreecommitdiffstats
path: root/sound/pci/lola/lola.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-05-03 17:06:53 +0200
committerTakashi Iwai <tiwai@suse.de>2011-05-03 17:06:53 +0200
commitfe4af1b55ed76e3051bbd8abce7d6b3c504272a5 (patch)
tree2ca1533564dd46d12562fb54f8abf650cd041408 /sound/pci/lola/lola.c
parentALSA: lola - Rename to Digital SRC Capture Switch (diff)
downloadlinux-fe4af1b55ed76e3051bbd8abce7d6b3c504272a5.tar.xz
linux-fe4af1b55ed76e3051bbd8abce7d6b3c504272a5.zip
ALSA: lola - Implement polling_mode like hd-audio
Also protect the call of lola_update_rirb() with spinlock. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/lola/lola.c')
-rw-r--r--sound/pci/lola/lola.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c
index 8ee22bee10c9..34b24286d279 100644
--- a/sound/pci/lola/lola.c
+++ b/sound/pci/lola/lola.c
@@ -153,8 +153,14 @@ static int rirb_get_response(struct lola *chip, unsigned int *val,
{
unsigned long timeout;
+ again:
timeout = jiffies + msecs_to_jiffies(1000);
for (;;) {
+ if (chip->polling_mode) {
+ spin_lock_irq(&chip->reg_lock);
+ lola_update_rirb(chip);
+ spin_unlock_irq(&chip->reg_lock);
+ }
if (!chip->rirb.cmds) {
*val = chip->res;
if (extval)
@@ -175,9 +181,13 @@ static int rirb_get_response(struct lola *chip, unsigned int *val,
break;
udelay(20);
cond_resched();
- lola_update_rirb(chip);
}
printk(KERN_WARNING SFX "RIRB response error\n");
+ if (!chip->polling_mode) {
+ printk(KERN_WARNING SFX "switching to polling mode\n");
+ chip->polling_mode = 1;
+ goto again;
+ }
return -EIO;
}