ASoC: pcm3168a: add hw constraint for capture channel
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 17 Oct 2018 01:54:33 +0000 (01:54 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 17 Oct 2018 19:01:29 +0000 (20:01 +0100)
LEFT_J / I2S only can use TDM.
commit 594680ea4a394 ("ASoC: pcm3168a: add hw constraint for channel")
commit 3809688980205 ("ASoC: pcm3168a: add HW constraint for non
RIGHT_J") added channel constraint for it, but, it was only for playback.
This patch adds constraint for capture.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/pcm3168a.c

index 63aa02592bc048457e7a387af769f181ef92f9ff..52cc950c9fd174912ea8e49797e6b8e8a0d28c78 100644 (file)
@@ -529,11 +529,17 @@ static int pcm3168a_startup(struct snd_pcm_substream *substream,
                break;
        case PCM3168A_FMT_LEFT_J:
                sample_min  = 24;
-               channel_max =  8;
+               if (tx)
+                       channel_max = 8;
+               else
+                       channel_max = 6;
                break;
        case PCM3168A_FMT_I2S:
                sample_min  = 24;
-               channel_max =  8;
+               if (tx)
+                       channel_max = 8;
+               else
+                       channel_max = 6;
                break;
        default:
                sample_min  = 24;
@@ -559,6 +565,7 @@ static const struct snd_soc_dai_ops pcm3168a_dac_dai_ops = {
 };
 
 static const struct snd_soc_dai_ops pcm3168a_adc_dai_ops = {
+       .startup        = pcm3168a_startup,
        .set_fmt        = pcm3168a_set_dai_fmt_adc,
        .set_sysclk     = pcm3168a_set_dai_sysclk,
        .hw_params      = pcm3168a_hw_params