All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: Fix mpc5200-psc-ac97 to ensure the data ready bit is cleared
@ 2009-07-02 17:57 ` Grant Likely
  0 siblings, 0 replies; 13+ messages in thread
From: Grant Likely @ 2009-07-02 17:57 UTC (permalink / raw)
  To: linuxppc-dev, alsa-devel, broonie; +Cc: w.sang

From: Grant Likely <grant.likely@secretlab.ca>

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>
---

 sound/soc/fsl/mpc5200_psc_ac97.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c
index 794a247..9b8503f 100644
--- a/sound/soc/fsl/mpc5200_psc_ac97.c
+++ b/sound/soc/fsl/mpc5200_psc_ac97.c
@@ -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));

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-07-03 10:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-02 17:57 [PATCH 1/2] ASoC: Fix mpc5200-psc-ac97 to ensure the data ready bit is cleared Grant Likely
2009-07-02 17:57 ` Grant Likely
2009-07-02 17:57 ` [PATCH 2/2] ASoC: add locking to mpc5200-psc-ac97 driver Grant Likely
2009-07-02 17:57   ` Grant Likely
2009-07-02 19:06   ` Jon Smirl
2009-07-02 19:06     ` Jon Smirl
2009-07-02 19:08   ` michael
2009-07-03  7:12     ` Grant Likely
2009-07-03  7:12       ` Grant Likely
2009-07-02 19:06 ` [PATCH 1/2] ASoC: Fix mpc5200-psc-ac97 to ensure the data ready bit is cleared Jon Smirl
2009-07-02 19:06   ` Jon Smirl
2009-07-03  9:59 ` Mark Brown
2009-07-03  9:59   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.