ASoC: pcm3168a: Enable TDM support for DSP_A/B modes

The 24-bit TDM mode also applies to DSP_A and DSP_B modes.
Most dais on the SoC side can not interpret I2S/Left_j with other than 2
channels of audio.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Peter Ujfalusi 2019-04-17 14:31:40 +03:00 committed by Mark Brown
parent bb24a31ed5
commit 5011454ee3
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 6 additions and 1 deletions

View File

@ -457,13 +457,16 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream,
if (chan > 2) { if (chan > 2) {
switch (fmt) { switch (fmt) {
case PCM3168A_FMT_I2S: case PCM3168A_FMT_I2S:
case PCM3168A_FMT_DSP_A:
fmt = PCM3168A_FMT_I2S_TDM; fmt = PCM3168A_FMT_I2S_TDM;
break; break;
case PCM3168A_FMT_LEFT_J: case PCM3168A_FMT_LEFT_J:
case PCM3168A_FMT_DSP_B:
fmt = PCM3168A_FMT_LEFT_J_TDM; fmt = PCM3168A_FMT_LEFT_J_TDM;
break; break;
default: default:
dev_err(component->dev, "TDM is supported under I2S/Left_J only\n"); dev_err(component->dev,
"TDM is supported under DSP/I2S/Left_J only\n");
return -EINVAL; return -EINVAL;
} }
} }
@ -526,6 +529,8 @@ static int pcm3168a_startup(struct snd_pcm_substream *substream,
break; break;
case PCM3168A_FMT_LEFT_J: case PCM3168A_FMT_LEFT_J:
case PCM3168A_FMT_I2S: case PCM3168A_FMT_I2S:
case PCM3168A_FMT_DSP_A:
case PCM3168A_FMT_DSP_B:
sample_min = 24; sample_min = 24;
channel_max = channel_maxs[tx]; channel_max = channel_maxs[tx];
break; break;