aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/au1x/psc-ac97.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/au1x/psc-ac97.c')
-rw-r--r--sound/soc/au1x/psc-ac97.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c
index a521aa90dde..efe2afd4fe2 100644
--- a/sound/soc/au1x/psc-ac97.c
+++ b/sound/soc/au1x/psc-ac97.c
@@ -61,7 +61,8 @@ static unsigned short au1xpsc_ac97_read(struct snd_ac97 *ac97,
61{ 61{
62 /* FIXME */ 62 /* FIXME */
63 struct au1xpsc_audio_data *pscdata = au1xpsc_ac97_workdata; 63 struct au1xpsc_audio_data *pscdata = au1xpsc_ac97_workdata;
64 unsigned short data, retry, tmo; 64 unsigned short retry, tmo;
65 unsigned long data;
65 66
66 au_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 67 au_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata));
67 au_sync(); 68 au_sync();
@@ -79,15 +80,19 @@ static unsigned short au1xpsc_ac97_read(struct snd_ac97 *ac97,
79 && --tmo) 80 && --tmo)
80 udelay(2); 81 udelay(2);
81 82
82 data = au_readl(AC97_CDC(pscdata)) & 0xffff; 83 data = au_readl(AC97_CDC(pscdata));
83 84
84 au_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata)); 85 au_writel(PSC_AC97EVNT_CD, AC97_EVNT(pscdata));
85 au_sync(); 86 au_sync();
86 87
87 mutex_unlock(&pscdata->lock); 88 mutex_unlock(&pscdata->lock);
89
90 if (reg != ((data >> 16) & 0x7f))
91 tmo = 1; /* wrong register, try again */
92
88 } while (--retry && !tmo); 93 } while (--retry && !tmo);
89 94
90 return retry ? data : 0xffff; 95 return retry ? data & 0xffff : 0xffff;
91} 96}
92 97
93/* AC97 controller writes to codec register */ 98/* AC97 controller writes to codec register */