Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15940
b: refs/heads/master
c: 954bea3
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent 86f83a8 commit 02c9ee0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 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: c9a49bb1957f45e0146c17a865f1444fd06c0f97
refs/heads/master: 954bea35571461b083390a82b03f077f901fe678
16 changes: 6 additions & 10 deletions trunk/sound/pci/intel8x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2149,10 +2149,6 @@ static void do_ali_reset(intel8x0_t *chip)
iputdword(chip, ICHREG(ALI_INTERRUPTSR), 0x00000000);
}

#define do_delay(chip) do {\
schedule_timeout_uninterruptible(1);\
} while (0)

static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
{
unsigned long end_time;
Expand All @@ -2176,7 +2172,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
do {
if ((igetdword(chip, ICHREG(GLOB_CNT)) & ICH_AC97WARM) == 0)
goto __ok;
do_delay(chip);
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT)));
return -EIO;
Expand All @@ -2192,7 +2188,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);
if (status)
break;
do_delay(chip);
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
if (! status) {
/* no codec is found */
Expand All @@ -2210,7 +2206,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
/* wait for other codecs ready status. */
end_time = jiffies + HZ / 4;
while (status != nstatus && time_after_eq(end_time, jiffies)) {
do_delay(chip);
schedule_timeout_uninterruptible(1);
status |= igetdword(chip, ICHREG(GLOB_STA)) & nstatus;
}

Expand All @@ -2227,7 +2223,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing)
nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);
if (status == nstatus)
break;
do_delay(chip);
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
}

Expand Down Expand Up @@ -2261,7 +2257,7 @@ static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing)
for (i = 0; i < HZ / 2; i++) {
if (! (igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ALI_INT_GPIO))
goto __ok;
do_delay(chip);
schedule_timeout_uninterruptible(1);
}
snd_printk(KERN_ERR "AC'97 reset failed.\n");
if (probing)
Expand All @@ -2273,7 +2269,7 @@ static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing)
if (reg & 0x80) /* primary codec */
break;
iputdword(chip, ICHREG(ALI_RTSR), reg | 0x80);
do_delay(chip);
schedule_timeout_uninterruptible(1);
}

do_ali_reset(chip);
Expand Down
12 changes: 4 additions & 8 deletions trunk/sound/pci/intel8x0m.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,6 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock)
*
*/

#define do_delay(chip) do {\
schedule_timeout_uninterruptible(1);\
} while (0)

static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
{
unsigned long end_time;
Expand All @@ -914,7 +910,7 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
do {
if ((igetdword(chip, ICHREG(GLOB_CNT)) & ICH_AC97WARM) == 0)
goto __ok;
do_delay(chip);
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT)));
return -EIO;
Expand All @@ -930,7 +926,7 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);
if (status)
break;
do_delay(chip);
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
if (! status) {
/* no codec is found */
Expand All @@ -944,7 +940,7 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
/* wait for other codecs ready status. */
end_time = jiffies + HZ / 4;
while (status != nstatus && time_after_eq(end_time, jiffies)) {
do_delay(chip);
schedule_timeout_uninterruptible(1);
status |= igetdword(chip, ICHREG(GLOB_STA)) & nstatus;
}

Expand All @@ -959,7 +955,7 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing)
nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);
if (status == nstatus)
break;
do_delay(chip);
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
}

Expand Down

0 comments on commit 02c9ee0

Please sign in to comment.