]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: fsl-asoc-card: Don't bypass settings if cpu-dai is Master
authorNicolin Chen <nicoleotsuka@gmail.com>
Fri, 24 Oct 2014 23:48:11 +0000 (16:48 -0700)
committerMark Brown <broonie@kernel.org>
Tue, 28 Oct 2014 16:05:04 +0000 (16:05 +0000)
When cpu-dai is the DAI Master (CBM_CFx), it may need some configurations,
set_sysclk() call for eample, for cpu-dai side in the hw_params(), even if
the set_bias_level() has already taken care of the codec-dai side.

So this patch just simply adds an additional condition.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl-asoc-card.c

index 007c772f3cefc7bc7e41d07f4199e917e754718e..14572e62dd51b0950043a0a4b4d4ddd6700cc9b2 100644 (file)
@@ -125,7 +125,12 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
        priv->sample_rate = params_rate(params);
        priv->sample_format = params_format(params);
 
-       if (priv->card.set_bias_level)
+       /*
+        * If codec-dai is DAI Master and all configurations are already in the
+        * set_bias_level(), bypass the remaining settings in hw_params().
+        * Note: (dai_fmt & CBM_CFM) includes CBM_CFM and CBM_CFS.
+        */
+       if (priv->card.set_bias_level && priv->dai_fmt & SND_SOC_DAIFMT_CBM_CFM)
                return 0;
 
        /* Specific configurations of DAIs starts from here */