11 Mar
2009
11 Mar
'09
7:44 p.m.
On Wed, Mar 11, 2009 at 07:17:00PM +0100, Philipp Zabel wrote:
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).
Ah, I just (while reading this header file) wondered how this is supposed to work :)
@@ -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);
}
Then we need something like ssp_get_scr() as well to cover my special case which uses SSCR0_SCR and SSCR0_SerClkDiv() again as you proposed ;)
Daniel