Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88203
b: refs/heads/master
c: 4b47c97
h: refs/heads/master
i:
  88201: 39ee35a
  88199: 3868f62
v: v3
  • Loading branch information
Arjan van de Ven authored and Linus Torvalds committed Apr 9, 2008
1 parent 4559f19 commit 2f9d839
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41e3355de052693c7a0cad74b845148d262edadf
refs/heads/master: 4b47c971dc947cadecc20dc7681037e96ece520e
14 changes: 13 additions & 1 deletion trunk/sound/pci/es1968.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,18 @@ static int snd_es1968_ac97_wait(struct es1968 *chip)
return 1; /* timeout */
}

static int snd_es1968_ac97_wait_poll(struct es1968 *chip)
{
int timeout = 100000;

while (timeout-- > 0) {
if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1))
return 0;
}
snd_printd("es1968: ac97 timeout\n");
return 1; /* timeout */
}

static void snd_es1968_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val)
{
struct es1968 *chip = ac97->private_data;
Expand Down Expand Up @@ -645,7 +657,7 @@ static unsigned short snd_es1968_ac97_read(struct snd_ac97 *ac97, unsigned short
outb(reg | 0x80, chip->io_port + ESM_AC97_INDEX);
/*msleep(1);*/

if (! snd_es1968_ac97_wait(chip)) {
if (!snd_es1968_ac97_wait_poll(chip)) {
data = inw(chip->io_port + ESM_AC97_DATA);
/*msleep(1);*/
}
Expand Down

0 comments on commit 2f9d839

Please sign in to comment.