alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: linux-sound@vger.kernel.org
Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org,
	Brent Lu <brent.lu@intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 18/23] ASoC: Intel: sof-rt5682: remove SOF_RT5682_MCLK_BYTCHT_EN
Date: Fri, 26 Apr 2024 10:25:24 -0500	[thread overview]
Message-ID: <20240426152529.38345-19-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20240426152529.38345-1-pierre-louis.bossart@linux.intel.com>

From: Brent Lu <brent.lu@intel.com>

We don't need this quirk flag since 'is_legacy_cpu' will be true if
this is a BYT/CHT board.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_rt5682.c | 39 ++++++++++++++---------------
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
index 654c2428f625..4c6dfe632edf 100644
--- a/sound/soc/intel/boards/sof_rt5682.c
+++ b/sound/soc/intel/boards/sof_rt5682.c
@@ -30,7 +30,6 @@
 
 /* Driver-specific board quirks: from bit 0 to 7 */
 #define SOF_RT5682_MCLK_EN			BIT(0)
-#define SOF_RT5682_MCLK_BYTCHT_EN		BIT(1)
 
 /* Default: MCLK on, MCLK 19.2M, SSP0  */
 static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
@@ -206,7 +205,7 @@ static int sof_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd)
 			}
 		}
 
-		if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
+		if (ctx->rt5682.is_legacy_cpu) {
 			/*
 			 * The firmware might enable the clock at
 			 * boot (this information may or may not
@@ -279,7 +278,7 @@ static int sof_rt5682_hw_params(struct snd_pcm_substream *substream,
 	int pll_id, pll_source, pll_in, pll_out, clk_id, ret;
 
 	if (ctx->rt5682.mclk_en) {
-		if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
+		if (ctx->rt5682.is_legacy_cpu) {
 			ret = clk_prepare_enable(ctx->rt5682.mclk);
 			if (ret < 0) {
 				dev_err(rtd->dev,
@@ -661,7 +660,6 @@ static int sof_audio_probe(struct platform_device *pdev)
 
 		/* default quirk for legacy cpu */
 		sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
-				   SOF_RT5682_MCLK_BYTCHT_EN |
 				   SOF_SSP_PORT_CODEC(2);
 	}
 
@@ -728,26 +726,27 @@ static int sof_audio_probe(struct platform_device *pdev)
 		}
 	}
 
-	if (sof_rt5682_quirk & SOF_RT5682_MCLK_EN)
+	if (sof_rt5682_quirk & SOF_RT5682_MCLK_EN) {
 		ctx->rt5682.mclk_en = true;
 
-	/* need to get main clock from pmc */
-	if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
-		ctx->rt5682.mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
-		if (IS_ERR(ctx->rt5682.mclk)) {
-			ret = PTR_ERR(ctx->rt5682.mclk);
+		/* need to get main clock from pmc */
+		if (ctx->rt5682.is_legacy_cpu) {
+			ctx->rt5682.mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
+			if (IS_ERR(ctx->rt5682.mclk)) {
+				ret = PTR_ERR(ctx->rt5682.mclk);
 
-			dev_err(&pdev->dev,
-				"Failed to get MCLK from pmc_plt_clk_3: %d\n",
-				ret);
-			return ret;
-		}
+				dev_err(&pdev->dev,
+					"Failed to get MCLK from pmc_plt_clk_3: %d\n",
+					ret);
+				return ret;
+			}
 
-		ret = clk_prepare_enable(ctx->rt5682.mclk);
-		if (ret < 0) {
-			dev_err(&pdev->dev,
-				"could not configure MCLK state");
-			return ret;
+			ret = clk_prepare_enable(ctx->rt5682.mclk);
+			if (ret < 0) {
+				dev_err(&pdev->dev,
+					"could not configure MCLK state");
+				return ret;
+			}
 		}
 	}
 
-- 
2.40.1


  parent reply	other threads:[~2024-04-26 15:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 15:25 [PATCH 00/23] ASoC: Intel: updates for 6.10 - part6 Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 01/23] ASoC: Intel: nau8825/rt5682: move speaker widget to common modules Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 02/23] ASoC: Intel: sof_maxim_common: support MAX98390 on cml boards Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 03/23] ASoC: Intel: sof_da7219: support MAX98390 Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 04/23] ASoC: Intel: sof_da7219: add cml_da7219_def for cml boards Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 05/23] ASoC: Intel: sof_da7219: support MAX98390 on " Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 06/23] ASoC: Intel: bxt_da7219_max98357a: remove MAX98390 support Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 07/23] ASoC: Intel: sof_rt5682: add missing MAX98357A config Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 08/23] ASoC: Intel: sof_da7219: support MAX98357A Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 09/23] ASoC: Intel: sof_da7219: support MAX98357A on cml boards Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 10/23] ASoC: Intel: bxt_da7219_max98357a: remove cml support Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 11/23] ASoC: Intel: sof_da7219: add glk_da7219_def for glk boards Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 12/23] ASoC: Intel: sof_da7219: support MAX98357A on " Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 13/23] ASoC: Intel: bxt_da7219_max98357a: remove glk support Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 14/23] ASoC: Intel: sof_rt5682: add glk_rt5682_def for glk boards Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 15/23] ASoC: Intel: sof_rt5682: support MAX98357A on " Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 16/23] ASoC: Intel: glk_rt5682_max98357a: delete driver Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 17/23] ASoC: Intel: sof-rt5682: add mclk_en to sof_rt5682_private Pierre-Louis Bossart
2024-04-26 15:25 ` Pierre-Louis Bossart [this message]
2024-04-26 15:25 ` [PATCH 19/23] ASoC: Intel: sof_rt5682: add icl_rt5682_def for icl boards Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 20/23] ASoC: Intel: sof-rt5682: add driver_data to sof_rt5682 board Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 21/23] ASoC: Intel: sof-rt5682: setup pll_id only when needed Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 22/23] ASoC: Intel: sof-rt5682: get bclk frequency from topology Pierre-Louis Bossart
2024-04-26 15:25 ` [PATCH 23/23] ASoC: Intel: sof-rt5682: support bclk as PLL source on rt5682s Pierre-Louis Bossart
2024-05-01 13:43 ` [PATCH 00/23] ASoC: Intel: updates for 6.10 - part6 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=20240426152529.38345-19-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=brent.lu@intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=tiwai@suse.de \
    --cc=yung-chuan.liao@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;
as well as URLs for NNTP newsgroup(s).