asoc: pxa-ssp.c -> enchance the I2S enchancement :)
Subsystems (3)
Hi, this patch is what i need to use Paul's pxa-ssp.c I2S enchancements on my board.
Basically, it doesn't enforce the "fake" network mode, as i dont need it. And i need _real_ network mode, so i prefer to set SSCR0_MOD only when really using network mode.
And it uses PXA_SSP_FRM_??FS to actually set SSCR0_DataSize() too. This allows me to use 32bit frames for 16 bit stereo audio. (No, I don't want to fake network mode for this, and SSCR0_MOD doesn't work as expected when PXA is slave).
This patch is incremental to the recent patch from Paul Shen.
sound/soc/pxa/pxa-ssp.c +0 -0
@@ -579,7 +579,7 @@ static int pxa_ssp_set_dai_fmt(struct snd_soc_dai
*cpu_dai,
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S:
case SND_SOC_DAIFMT_LEFT_J:
- sscr0 |= SSCR0_PSP | SSCR0_MOD; + sscr0 |= SSCR0_PSP; sscr1 |= SSCR1_RWOT | SSCR1_TRAIL;
/* See hw_params() */
@@ -655,7 +655,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
int dma = 0, chn = params_channels(params);
u32 sscr0;
u32 sspsp;
- int frame_width;
+ int frame_width = 0;
int width = snd_pcm_format_physical_width(params_format(params)); int ttsa = ssp_read_reg(ssp, SSTSA) & 0xf;
@@ -698,7 +698,6 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
sscr0 |= (SSCR0_EDSS | SSCR0_DataSize(16)); break;
}
- ssp_write_reg(ssp, SSCR0, sscr0);
switch (priv->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S:
@@ -742,6 +741,15 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
break;
}
+ if (frame_width) {
+ sscr0 &= ~(SSCR0_EDSS | SSCR0_DataSize(16));
+ if (frame_width % 48 == 0)
+ sscr0 |= SSCR0_EDSS | SSCR0_DataSize(8);
+ else
+ sscr0 |= SSCR0_EDSS | SSCR0_DataSize(16);
+ }
+ ssp_write_reg(ssp, SSCR0, sscr0);
+
/* When we use a network mode, we always require TDM slots
* - complain loudly and fail if they've not been set up yet. */
Signature · 1 line
Daniel Ribeiro
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel