diff mbox

ASoC: fsl-asoc-card: Don't bypass settings if cpu-dai is Master

Message ID 1414194502-14052-1-git-send-email-nicoleotsuka@gmail.com (mailing list archive)
State Not Applicable
Delegated to: Scott Wood
Headers show

Commit Message

Nicolin Chen Oct. 24, 2014, 11:48 p.m. UTC
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>
---
 sound/soc/fsl/fsl-asoc-card.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Mark Brown Oct. 27, 2014, 5:30 p.m. UTC | #1
On Fri, Oct 24, 2014 at 04:48:11PM -0700, Nicolin Chen wrote:
> 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.

This was threaded with another patch series - did you intend to submit
this or did it get sent by accident?
Nicolin Chen Oct. 27, 2014, 5:42 p.m. UTC | #2
On Mon, Oct 27, 2014 at 05:30:31PM +0000, Mark Brown wrote:
> On Fri, Oct 24, 2014 at 04:48:11PM -0700, Nicolin Chen wrote:
> > 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.
> 
> This was threaded with another patch series - did you intend to submit
> this or did it get sent by accident?

I created this one without "--thread" (separately from that series) but
accidentally sent the patch along with the series in one git-send-mail
command. So I think I don't need to resend it since it's already there.

Please regard this one as one single patch.

Thank you.
Nicolin
Mark Brown Oct. 28, 2014, 4:05 p.m. UTC | #3
On Fri, Oct 24, 2014 at 04:48:11PM -0700, Nicolin Chen wrote:
> 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.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 007c772..14572e6 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -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 */