Skip to content

Commit

Permalink
ASoC: Fix mpc5200-psc-ac97 to ensure the data ready bit is cleared
Browse files Browse the repository at this point in the history
When doing register reads, it is possible for there to be a stale
data ready bit set which will cause subsequent reads to return
prematurely with incorrect data.  This patch fixes the issues by
ensuring stale data is cleared before starting another transaction.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Grant Likely authored and Mark Brown committed Jul 3, 2009
1 parent 1df892c commit 0757353
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/soc/fsl/mpc5200_psc_ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ static unsigned short psc_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
pr_err("timeout on ac97 bus (rdy)\n");
return -ENODEV;
}

/* Force clear the data valid bit */
in_be32(&psc_dma->psc_regs->ac97_data);

/* Send the read */
out_be32(&psc_dma->psc_regs->ac97_cmd, (1<<31) | ((reg & 0x7f) << 24));

Expand Down

0 comments on commit 0757353

Please sign in to comment.