X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Fpci%2Fes1968.c;h=7d911a18c082ffbbbfab7293693ec070ca5db224;hb=4b47c971dc947cadecc20dc7681037e96ece520e;hp=25ccfce45759806a21c8f13d11d4fc192cdf85a5;hpb=41e3355de052693c7a0cad74b845148d262edadf;p=linux-2.6-omap-h63xx.git diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 25ccfce4575..7d911a18c08 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -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; @@ -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);*/ }