Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH 5/7] ASoC: max98090: Make sure we configure BCLK in one place
Date: Fri, 16 May 2014 16:55:23 +0300	[thread overview]
Message-ID: <1400248525-21900-6-git-send-email-jarkko.nikula@linux.intel.com> (raw)
In-Reply-To: <1400248525-21900-1-git-send-email-jarkko.nikula@linux.intel.com>

From: Liam Girdwood <liam.r.girdwood@linux.intel.com>

BCL is being configured in two places producing a warning message.
Make sure we only configure BCLK once and when we are master.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
 sound/soc/codecs/max98090.c | 8 +++++---
 sound/soc/codecs/max98090.h | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 8c88b4448f7e..14d42cde9235 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -1675,6 +1675,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
 				M98090_REG_CLOCK_RATIO_NI_LSB, 0x00);
 			snd_soc_update_bits(codec, M98090_REG_CLOCK_MODE,
 				M98090_USE_M1_MASK, 0);
+			max98090->master = false;
 			break;
 		case SND_SOC_DAIFMT_CBM_CFM:
 			/* Set to master mode */
@@ -1691,6 +1692,7 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
 				regval |= M98090_MAS_MASK |
 					M98090_BSEL_32;
 			}
+			max98090->master = true;
 			break;
 		case SND_SOC_DAIFMT_CBS_CFM:
 		case SND_SOC_DAIFMT_CBM_CFS:
@@ -1874,7 +1876,8 @@ static int max98090_dai_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
-	max98090_configure_bclk(codec);
+	if (max98090->master)
+		max98090_configure_bclk(codec);
 
 	cdata->rate = max98090->lrclk;
 
@@ -1953,8 +1956,6 @@ static int max98090_dai_set_sysclk(struct snd_soc_dai *dai,
 
 	max98090->sysclk = freq;
 
-	max98090_configure_bclk(codec);
-
 	return 0;
 }
 
@@ -2226,6 +2227,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
 	/* Initialize private data */
 
 	max98090->sysclk = (unsigned)-1;
+	max98090->master = false;
 
 	cdata = &max98090->dai[0];
 	cdata->rate = (unsigned)-1;
diff --git a/sound/soc/codecs/max98090.h b/sound/soc/codecs/max98090.h
index 1a4e2334a7b2..5a3c8d0613cb 100644
--- a/sound/soc/codecs/max98090.h
+++ b/sound/soc/codecs/max98090.h
@@ -1540,6 +1540,7 @@ struct max98090_priv {
 	unsigned int pa2en;
 	unsigned int extmic_mux;
 	unsigned int sidetone;
+	bool master;
 };
 
 int max98090_mic_detect(struct snd_soc_codec *codec,
-- 
2.0.0.rc0

  parent reply	other threads:[~2014-05-16 13:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 13:55 [PATCH 0/7] ASoC: max98090: Couple improvements and ACPI probing support Jarkko Nikula
2014-05-16 13:55 ` [PATCH 1/7] ASoC: max98090: Fix digital sidetone gain TLV Jarkko Nikula
2014-05-16 13:55 ` [PATCH 2/7] ASoC: max98090: Fix reset at resume time Jarkko Nikula
2014-05-16 13:55 ` [PATCH 3/7] ASoC: max98090: Reset codec on resume Jarkko Nikula
2014-05-16 13:55 ` [PATCH 4/7] ASoC: max98090: Mark cache as dirty prior to restoring Jarkko Nikula
2014-05-16 13:55 ` Jarkko Nikula [this message]
2014-05-16 13:55 ` [PATCH 6/7] ASoC: max98090: Move microphone bias voltage setting to probe function Jarkko Nikula
2014-05-16 13:55 ` [PATCH 7/7] ASoC: max98090: Add ACPI probing support Jarkko Nikula
2014-05-16 19:01 ` [PATCH 0/7] ASoC: max98090: Couple improvements and " Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400248525-21900-6-git-send-email-jarkko.nikula@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox