[alsa-devel] [PATCH 3/3][RFC] ASoC: pxa-ssp: Don't use SSCR0_SerClkDiv and SSCR0_SCR

Philipp Zabel philipp.zabel at gmail.com
Wed Mar 11 19:17:00 CET 2009


As soon as CONFIG_PXA25x is enabled, those macros only handle the PXA25x_SSP
case, which is wrong most of the time (and always wrong on >=PXA27x).

Signed-off-by: Philipp Zabel <philipp.zabel at gmail.com>

Conflicts:

	sound/soc/pxa/pxa-ssp.c
---
 sound/soc/pxa/pxa-ssp.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index bc9d306..2a2c322 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -287,10 +287,17 @@ static void ssp_set_scr(struct ssp_priv *priv, u32 div)
 {
 	struct ssp_dev *dev = &priv->dev;
 	struct ssp_device *ssp = dev->ssp;
-	u32 sscr0 = ssp_read_reg(dev->ssp, SSCR0) & ~SSCR0_SCR;
+	u32 sscr0 = ssp_read_reg(dev->ssp, SSCR0);
 
 	priv->scr_div = div;
-	ssp_write_reg(ssp, SSCR0, (sscr0 | SSCR0_SerClkDiv(div)));
+	if (ssp->type == PXA25x_SSP) {
+		sscr0 &= ~0x0000ff00;        /* SSCR0_SCR */
+		sscr0 |= ((div - 2)/2) << 8; /* SSCR0_SerClkDiv(div) */
+	} else {
+		sscr0 &= ~0x000fff00;        /* SSCR0_SCR */
+		sscr0 |= (div - 1) << 8;     /* SSCR0_SerClkDiv(div) */
+	}
+	ssp_write_reg(ssp, SSCR0, sscr0);
 }
 
 /*
-- 
1.6.2



More information about the Alsa-devel mailing list