Commit ed61b2ef authored by Brent Lu's avatar Brent Lu Committed by Mark Brown

ASoC: Intel: sof_da7219: add SOF_DA7219_MCLK_EN quirk

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: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarBrent Lu <brent.lu@intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240325221059.206042-15-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent a7963f6e
...@@ -87,10 +87,12 @@ enum { ...@@ -87,10 +87,12 @@ enum {
* sof_da7219_private: private data for da7219 machine driver * sof_da7219_private: private data for da7219 machine driver
* *
* @is_jsl_board: true for JSL boards * @is_jsl_board: true for JSL boards
* @mclk_en: true for mclk pin is connected
* @pll_bypass: true for PLL bypass mode * @pll_bypass: true for PLL bypass mode
*/ */
struct sof_da7219_private { struct sof_da7219_private {
bool is_jsl_board; bool is_jsl_board;
bool mclk_en;
bool pll_bypass; bool pll_bypass;
}; };
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
/* Driver-specific board quirks: from bit 0 to 7 */ /* Driver-specific board quirks: from bit 0 to 7 */
#define SOF_DA7219_JSL_BOARD BIT(0) #define SOF_DA7219_JSL_BOARD BIT(0)
#define SOF_DA7219_MCLK_EN BIT(1)
#define DIALOG_CODEC_DAI "da7219-hifi" #define DIALOG_CODEC_DAI "da7219-hifi"
...@@ -126,7 +127,8 @@ static int da7219_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -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 * 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. * 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 */ /* PLL bypass mode */
dev_dbg(rtd->dev, "pll bypass mode, mclk rate %d\n", mclk_rate); 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) ...@@ -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 */ /* update dai_link */
ret = sof_card_dai_links_create(&pdev->dev, &card_da7219, ctx); ret = sof_card_dai_links_create(&pdev->dev, &card_da7219, ctx);
if (ret) if (ret)
...@@ -383,7 +388,8 @@ static const struct platform_device_id board_ids[] = { ...@@ -383,7 +388,8 @@ static const struct platform_device_id board_ids[] = {
}, },
{ {
.name = "adl_mx98360_da7219", .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_SSP_PORT_AMP(1) |
SOF_NUM_IDISP_HDMI(4) | SOF_NUM_IDISP_HDMI(4) |
SOF_SSP_PORT_BT_OFFLOAD(2) | SOF_SSP_PORT_BT_OFFLOAD(2) |
...@@ -391,7 +397,8 @@ static const struct platform_device_id board_ids[] = { ...@@ -391,7 +397,8 @@ static const struct platform_device_id board_ids[] = {
}, },
{ {
.name = "rpl_mx98360_da7219", .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_SSP_PORT_AMP(1) |
SOF_NUM_IDISP_HDMI(4) | SOF_NUM_IDISP_HDMI(4) |
SOF_SSP_PORT_BT_OFFLOAD(2) | SOF_SSP_PORT_BT_OFFLOAD(2) |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment