All of lore.kernel.org
 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 14/21] ASoC: Intel: sof_da7219: add SOF_DA7219_MCLK_EN quirk
Date: Mon, 25 Mar 2024 17:10:52 -0500	[thread overview]
Message-ID: <20240325221059.206042-15-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20240325221059.206042-1-pierre-louis.bossart@linux.intel.com>

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

PLL bypass mode requires mclk to be present. However, mclk pin is not
connected in JSL boards. Here we add the SOF_DA7219_MCLK_EN quirk to
improve driver readability.

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_board_helpers.h |  2 ++
 sound/soc/intel/boards/sof_da7219.c        | 13 ++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/sound/soc/intel/boards/sof_board_helpers.h b/sound/soc/intel/boards/sof_board_helpers.h
index 1701481ab6ae..2f27ad8726f8 100644
--- a/sound/soc/intel/boards/sof_board_helpers.h
+++ b/sound/soc/intel/boards/sof_board_helpers.h
@@ -87,10 +87,12 @@ enum {
  * sof_da7219_private: private data for da7219 machine driver
  *
  * @is_jsl_board: true for JSL boards
+ * @mclk_en: true for mclk pin is connected
  * @pll_bypass: true for PLL bypass mode
  */
 struct sof_da7219_private {
 	bool is_jsl_board;
+	bool mclk_en;
 	bool pll_bypass;
 };
 
diff --git a/sound/soc/intel/boards/sof_da7219.c b/sound/soc/intel/boards/sof_da7219.c
index 3d9c48107f58..4417e2b7adfd 100644
--- a/sound/soc/intel/boards/sof_da7219.c
+++ b/sound/soc/intel/boards/sof_da7219.c
@@ -20,6 +20,7 @@
 
 /* Driver-specific board quirks: from bit 0 to 7 */
 #define SOF_DA7219_JSL_BOARD			BIT(0)
+#define SOF_DA7219_MCLK_EN			BIT(1)
 
 #define DIALOG_CODEC_DAI	"da7219-hifi"
 
@@ -126,7 +127,8 @@ static int da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
 	 * Use PLL bypass mode if MCLK is available, be sure to set the
 	 * frequency of MCLK to 12.288 or 24.576MHz on topology side.
 	 */
-	if (mclk_rate == 12288000 || mclk_rate == 24576000) {
+	if (ctx->da7219.mclk_en &&
+	    (mclk_rate == 12288000 || mclk_rate == 24576000)) {
 		/* PLL bypass mode */
 		dev_dbg(rtd->dev, "pll bypass mode, mclk rate %d\n", mclk_rate);
 
@@ -337,6 +339,9 @@ static int audio_probe(struct platform_device *pdev)
 		}
 	}
 
+	if (board_quirk & SOF_DA7219_MCLK_EN)
+		ctx->da7219.mclk_en = true;
+
 	/* update dai_link */
 	ret = sof_card_dai_links_create(&pdev->dev, &card_da7219, ctx);
 	if (ret)
@@ -383,7 +388,8 @@ static const struct platform_device_id board_ids[] = {
 	},
 	{
 		.name = "adl_mx98360_da7219",
-		.driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) |
+		.driver_data = (kernel_ulong_t)(SOF_DA7219_MCLK_EN |
+					SOF_SSP_PORT_CODEC(0) |
 					SOF_SSP_PORT_AMP(1) |
 					SOF_NUM_IDISP_HDMI(4) |
 					SOF_SSP_PORT_BT_OFFLOAD(2) |
@@ -391,7 +397,8 @@ static const struct platform_device_id board_ids[] = {
 	},
 	{
 		.name = "rpl_mx98360_da7219",
-		.driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) |
+		.driver_data = (kernel_ulong_t)(SOF_DA7219_MCLK_EN |
+					SOF_SSP_PORT_CODEC(0) |
 					SOF_SSP_PORT_AMP(1) |
 					SOF_NUM_IDISP_HDMI(4) |
 					SOF_SSP_PORT_BT_OFFLOAD(2) |
-- 
2.40.1


  parent reply	other threads:[~2024-03-25 22:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 22:10 [PATCH 00/21] ASoC: Intel: boards: updates for 6.10 - part1 Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 01/21] ASoC: Intel: board_helpers: support DAI link ID customization Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 02/21] ASoC: Intel: sof_ssp_amp: use common module for DAI link generation Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 03/21] ASoC: Intel: board_helpers: change dai link helpers to static function Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 04/21] ASoC: Intel: sof_da7219: add rpl_mx98360_da7219 board config Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 05/21] ASoC: Intel: sof_rt5682: support ALC5650 on RPL boards Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 06/21] ASoC: Intel: sof_cs42l42: rename BT offload quirk Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 07/21] ASoC: Intel: board_helpers: support sof_card_private initialization Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 08/21] ASoC: Intel: sof_cs42l42: use common module for " Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 09/21] ASoC: Intel: sof_nau8825: " Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 10/21] ASoC: Intel: sof_rt5682: " Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 11/21] ASoC: Intel: sof_ssp_amp: " Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 12/21] ASoC: Intel: sof_da7219: use common module for DAI link generation Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 13/21] ASoC: Intel: sof_da7219: add codec exit function Pierre-Louis Bossart
2024-03-25 22:10 ` Pierre-Louis Bossart [this message]
2024-03-25 22:10 ` [PATCH 15/21] ASoC: Intel: sof_da7219: board id cleanup for jsl boards Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 16/21] ASoC: Intel: sof_da7219: board id cleanup for adl boards Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 17/21] ASoC: Intel: sof_da7219: board id cleanup for rpl boards Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 18/21] ASoC: Intel: sof_rt5682: remove unnecessary idisp HDMI quirk Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 19/21] ASoC: Intel: sof_ssp_amp: " Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 20/21] ASoC: Intel: sof_nau8825: remove sof_nau8825 board id Pierre-Louis Bossart
2024-03-25 22:10 ` [PATCH 21/21] ASoC: Intel: sof_rt5682: board id cleanup for cml boards Pierre-Louis Bossart
2024-03-26 15:28 ` [PATCH 00/21] ASoC: Intel: boards: updates for 6.10 - part1 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=20240325221059.206042-15-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.