Skip to content

Commit 207255f

Browse files
brentlubroonie
authored andcommitted
ASoC: Intel: sof-rt5682: remove SOF_RT5682_MCLK_BYTCHT_EN
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 <[email protected]> Signed-off-by: Brent Lu <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e91d54f commit 207255f

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

sound/soc/intel/boards/sof_rt5682.c

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
/* Driver-specific board quirks: from bit 0 to 7 */
3232
#define SOF_RT5682_MCLK_EN BIT(0)
33-
#define SOF_RT5682_MCLK_BYTCHT_EN BIT(1)
3433

3534
/* Default: MCLK on, MCLK 19.2M, SSP0 */
3635
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)
206205
}
207206
}
208207

209-
if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
208+
if (ctx->rt5682.is_legacy_cpu) {
210209
/*
211210
* The firmware might enable the clock at
212211
* boot (this information may or may not
@@ -279,7 +278,7 @@ static int sof_rt5682_hw_params(struct snd_pcm_substream *substream,
279278
int pll_id, pll_source, pll_in, pll_out, clk_id, ret;
280279

281280
if (ctx->rt5682.mclk_en) {
282-
if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
281+
if (ctx->rt5682.is_legacy_cpu) {
283282
ret = clk_prepare_enable(ctx->rt5682.mclk);
284283
if (ret < 0) {
285284
dev_err(rtd->dev,
@@ -661,7 +660,6 @@ static int sof_audio_probe(struct platform_device *pdev)
661660

662661
/* default quirk for legacy cpu */
663662
sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
664-
SOF_RT5682_MCLK_BYTCHT_EN |
665663
SOF_SSP_PORT_CODEC(2);
666664
}
667665

@@ -728,26 +726,27 @@ static int sof_audio_probe(struct platform_device *pdev)
728726
}
729727
}
730728

731-
if (sof_rt5682_quirk & SOF_RT5682_MCLK_EN)
729+
if (sof_rt5682_quirk & SOF_RT5682_MCLK_EN) {
732730
ctx->rt5682.mclk_en = true;
733731

734-
/* need to get main clock from pmc */
735-
if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
736-
ctx->rt5682.mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
737-
if (IS_ERR(ctx->rt5682.mclk)) {
738-
ret = PTR_ERR(ctx->rt5682.mclk);
732+
/* need to get main clock from pmc */
733+
if (ctx->rt5682.is_legacy_cpu) {
734+
ctx->rt5682.mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
735+
if (IS_ERR(ctx->rt5682.mclk)) {
736+
ret = PTR_ERR(ctx->rt5682.mclk);
739737

740-
dev_err(&pdev->dev,
741-
"Failed to get MCLK from pmc_plt_clk_3: %d\n",
742-
ret);
743-
return ret;
744-
}
738+
dev_err(&pdev->dev,
739+
"Failed to get MCLK from pmc_plt_clk_3: %d\n",
740+
ret);
741+
return ret;
742+
}
745743

746-
ret = clk_prepare_enable(ctx->rt5682.mclk);
747-
if (ret < 0) {
748-
dev_err(&pdev->dev,
749-
"could not configure MCLK state");
750-
return ret;
744+
ret = clk_prepare_enable(ctx->rt5682.mclk);
745+
if (ret < 0) {
746+
dev_err(&pdev->dev,
747+
"could not configure MCLK state");
748+
return ret;
749+
}
751750
}
752751
}
753752

0 commit comments

Comments
 (0)