[alsa-devel] [PATCH] ASoC: Automatically set TDM if needed on pxa-ssp and allow frame width override when using TDM.

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Jun 10 14:18:44 CEST 2009


On Tue, Jun 09, 2009 at 02:13:10PM -0300, Daniel Ribeiro wrote:
> * Extend set_tdm_slot to allow the user to arbitrarily set the frame
>   width and active TX/RX slots.
> * Reset SSCR0_EDSS and SSCR0_DSS on pxa_ssp_set_dai_fmt.
> * Makes SSCR0_MOD optional.
> * Automatically sets network mode when needed if set_tdm_slot was
>   never called.
> * Clears SSCR1_RWOT case SSCR0_MOD is set.
> * Updates magician.c and wm9081.c for the new set_tdm_slot()

Please split out the API change from the use of it in the PXA SSP driver
- just include enough to keep it building, then send a second patch
changing the internals of the SSP driver.  At the minute there's two
different changes in here.

>  static int wm9081_set_tdm_slot(struct snd_soc_dai *dai,
> -			       unsigned int mask, int slots)
> +	unsigned int tx_mask, unsigned int rx_mask, int slots, int frame_width)
>  {
>  	struct snd_soc_codec *codec = dai->codec;
>  	unsigned int aif1 = wm9081_read(codec, WM9081_AUDIO_INTERFACE_1);
> @@ -1219,7 +1219,7 @@ static int wm9081_set_tdm_slot(struct snd_soc_dai *dai,
>  
>  	aif1 |= (slots - 1) << WM9081_AIFDAC_TDM_MODE_SHIFT;
>  
> -	switch (mask) {
> +	switch (tx_mask) {
>  	case 1:
>  		break;
>  	case 2:

This is wrong, the WM9081 is a DAC only part so it should be paying
attention to the RX mask, not the TX one.  We also need to handle the
sample size here.

I've not checked the SSP code yet.


More information about the Alsa-devel mailing list