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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux