summaryrefslogtreecommitdiff
path: root/sound/soc/nuc900
diff options
context:
space:
mode:
authorWan ZongShun <mcuos.com@gmail.com>2010-06-02 14:02:33 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-06-02 11:47:06 +0100
commit8dfb0c78157e14387f49fa7ab425e65a93b2fee2 (patch)
tree939e5783b304ae5b9489783e23ba33bc05a8bd3c /sound/soc/nuc900
parent018334c045c95793ab58948fe1f63282459c4f8d (diff)
ASoC: nuc900: fix a wait loop bug
The current implement meant ACTL_ACCON was only accessed once when read or write proceeding, which is not right, if so,we have to wait the 'timeout=0x10000' to end every times. We need to polling the bit AC_R_FINISH and AC_W_FINISH of ACTL_ACCON register to identify whether read or write is finished or not,so I make the patch to fix the issue. Signed-off-by: Wan ZongShun <mcuos.com@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/nuc900')
-rw-r--r--sound/soc/nuc900/nuc900-ac97.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c
index e1634a2f1701..c49a7934a7b2 100644
--- a/sound/soc/nuc900/nuc900-ac97.c
+++ b/sound/soc/nuc900/nuc900-ac97.c
@@ -66,9 +66,8 @@ static unsigned short nuc900_ac97_read(struct snd_ac97 *ac97,
udelay(100);
/* polling the AC_R_FINISH */
- val = AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON);
- val &= AC_R_FINISH;
- while (!val && timeout--)
+ while (!(AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON) & AC_R_FINISH)
+ && timeout--)
mdelay(1);
if (!timeout) {
@@ -121,9 +120,8 @@ static void nuc900_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
udelay(100);
/* polling the AC_W_FINISH */
- tmp = AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON);
- tmp &= AC_W_FINISH;
- while (tmp && timeout--)
+ while ((AUDIO_READ(nuc900_audio->mmio + ACTL_ACCON) & AC_W_FINISH)
+ && timeout--)
mdelay(1);
if (!timeout)