Skip to content

Commit c2641e1

Browse files
MLK-23618-9: ASoC: fsl_sai: Don't bind clock with regmap
The call flow: devm_regmap_init_mmio_clk - clk_prepare() - clk_pm_runtime_get() Cause the power domain of lpcg clock always be enabled. which impact the power consumption. So we can't bind clock with regmap, then explicitly enable clock when using. As we already enable all clock in pm_runtime_resume, so only need to enable clock in probe. Signed-off-by: Shengjiu Wang <[email protected]> Reviewed-by: Daniel Baluta <[email protected]>
1 parent 45db541 commit c2641e1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

sound/soc/fsl/fsl_sai.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,12 +1460,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
14601460
fsl_sai_regmap_config = fsl_sai_v3_regmap_config;
14611461

14621462
sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev,
1463-
"bus", base, &fsl_sai_regmap_config);
1464-
1465-
/* Compatible with old DTB cases */
1466-
if (IS_ERR(sai->regmap) && PTR_ERR(sai->regmap) != -EPROBE_DEFER)
1467-
sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev,
1468-
"sai", base, &fsl_sai_regmap_config);
1463+
NULL, base, &fsl_sai_regmap_config);
14691464
if (IS_ERR(sai->regmap)) {
14701465
dev_err(&pdev->dev, "regmap init failed\n");
14711466
return PTR_ERR(sai->regmap);
@@ -1574,6 +1569,11 @@ static int fsl_sai_probe(struct platform_device *pdev)
15741569
}
15751570

15761571
platform_set_drvdata(pdev, sai);
1572+
1573+
ret = clk_prepare_enable(sai->bus_clk);
1574+
if (ret)
1575+
return ret;
1576+
15771577
ret = fsl_sai_check_ver(&pdev->dev);
15781578
if (ret < 0)
15791579
dev_warn(&pdev->dev, "Error reading SAI version: %d\n", ret);
@@ -1600,6 +1600,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
16001600
FSL_SAI_MCTL_MCLK_EN, FSL_SAI_MCTL_MCLK_EN);
16011601
}
16021602

1603+
clk_disable_unprepare(sai->bus_clk);
1604+
16031605
sai->dma_params_rx.chan_name = "rx";
16041606
sai->dma_params_tx.chan_name = "tx";
16051607
sai->dma_params_rx.addr = res->start + FSL_SAI_RDR0;

0 commit comments

Comments
 (0)