Skip to contentSkip to conversation

ASoC: cht-bsw-rt5645: Also enable/disable the clock on Cherry Trail

PATCH In review Hans de Goede 2 participants 2 messages Oct 14, 2017 – Oct 16, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: cht-bsw-rt5645: Also enable/disable the clock on Cherry Trail

Just like on Bay Trail the codec mclk is also controlled by the common clk framework as pmc_plt_clk_3 on Cherry Trail and the cht-bsw-rt5645 needs to control it so that it has the right frequency and gets en/disabled as appropriate.

This fixes the sound crackling (like a bonfire) when the clock was not set up properly before Linux boots and turns the clock off when not in use saving power.

---
 sound/soc/intel/boards/cht_bsw_rt5645.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
sound/soc/intel/boards/cht_bsw_rt5645.c +6 -8
index 5bcde01d15e6..d553e2b67c92 100644
@@ -682,14 +682,12 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 			cht_rt5645_cpu_dai_name;
 	}
 
-	if (is_valleyview()) {
-		drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
-		if (IS_ERR(drv->mclk)) {
-			dev_err(&pdev->dev,
-				"Failed to get MCLK from pmc_plt_clk_3: %ld\n",
-				PTR_ERR(drv->mclk));
-			return PTR_ERR(drv->mclk);
-		}
+	drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
+	if (IS_ERR(drv->mclk)) {
+		dev_err(&pdev->dev,
+			"Failed to get MCLK from pmc_plt_clk_3: %ld\n",
+			PTR_ERR(drv->mclk));
+		return PTR_ERR(drv->mclk);
 	}
 
 	snd_soc_card_set_drvdata(card, drv);
Signature · 1 line
2.14.2
#1 lore raw
Quoted 4 lines · Hans de Goede

Just like on Bay Trail the codec mclk is also controlled by the common clk framework as pmc_plt_clk_3 on Cherry Trail and the cht-bsw-rt5645 needs to control it so that it has the right frequency and gets en/disabled as appropriate.

This is already merged by Mark, I submitted this change a couple of weeks ago.

Quoted 37 lines

This fixes the sound crackling (like a bonfire) when the clock was not set up properly before Linux boots and turns the clock off when not in use saving power.

---
  sound/soc/intel/boards/cht_bsw_rt5645.c | 14 ++++++--------
  1 file changed, 6 insertions(+), 8 deletions(-)
sound/soc/intel/boards/cht_bsw_rt5645.c +6 -8
index 5bcde01d15e6..d553e2b67c92 100644
@@ -682,14 +682,12 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
  			cht_rt5645_cpu_dai_name;
  	}
 
-	if (is_valleyview()) {
-		drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
-		if (IS_ERR(drv->mclk)) {
-			dev_err(&pdev->dev,
-				"Failed to get MCLK from pmc_plt_clk_3: %ld\n",
-				PTR_ERR(drv->mclk));
-			return PTR_ERR(drv->mclk);
-		}
+	drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
+	if (IS_ERR(drv->mclk)) {
+		dev_err(&pdev->dev,
+			"Failed to get MCLK from pmc_plt_clk_3: %ld\n",
+			PTR_ERR(drv->mclk));
+		return PTR_ERR(drv->mclk);
  	}
 
  	snd_soc_card_set_drvdata(card, drv);