Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342998
b: refs/heads/master
c: fa348da
h: refs/heads/master
v: v3
  • Loading branch information
Mengdong Lin authored and Takashi Iwai committed Dec 12, 2012
1 parent 5de3cfb commit 19be532
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 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: 6121b84af33fcec843a082cb6bc8d39f187faa20
refs/heads/master: fa348da53b6ffd3dcebae288d4072a4571755d35
20 changes: 11 additions & 9 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ static void azx_power_notify(struct hda_bus *bus, bool power_up);
/* reset codec link */
static int azx_reset(struct azx *chip, int full_reset)
{
int count;
unsigned long timeout;

if (!full_reset)
goto __skip;
Expand All @@ -1065,24 +1065,26 @@ static int azx_reset(struct azx *chip, int full_reset)
/* reset controller */
azx_writel(chip, GCTL, azx_readl(chip, GCTL) & ~ICH6_GCTL_RESET);

count = 50;
while (azx_readb(chip, GCTL) && --count)
msleep(1);
timeout = jiffies + msecs_to_jiffies(100);
while (azx_readb(chip, GCTL) &&
time_before(jiffies, timeout))
usleep_range(500, 1000);

/* delay for >= 100us for codec PLL to settle per spec
* Rev 0.9 section 5.5.1
*/
msleep(1);
usleep_range(500, 1000);

/* Bring controller out of reset */
azx_writeb(chip, GCTL, azx_readb(chip, GCTL) | ICH6_GCTL_RESET);

count = 50;
while (!azx_readb(chip, GCTL) && --count)
msleep(1);
timeout = jiffies + msecs_to_jiffies(100);
while (!azx_readb(chip, GCTL) &&
time_before(jiffies, timeout))
usleep_range(500, 1000);

/* Brent Chartrand said to wait >= 540us for codecs to initialize */
msleep(1);
usleep_range(1000, 1200);

__skip:
/* check to see if controller is ready */
Expand Down

0 comments on commit 19be532

Please sign in to comment.