1
0
Fork 0

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 <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Shengjiu Wang 2020-03-17 18:27:04 +08:00
parent 45db541836
commit c2641e1974
1 changed files with 8 additions and 6 deletions

View File

@ -1460,12 +1460,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
fsl_sai_regmap_config = fsl_sai_v3_regmap_config;
sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev,
"bus", base, &fsl_sai_regmap_config);
/* Compatible with old DTB cases */
if (IS_ERR(sai->regmap) && PTR_ERR(sai->regmap) != -EPROBE_DEFER)
sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev,
"sai", base, &fsl_sai_regmap_config);
NULL, base, &fsl_sai_regmap_config);
if (IS_ERR(sai->regmap)) {
dev_err(&pdev->dev, "regmap init failed\n");
return PTR_ERR(sai->regmap);
@ -1574,6 +1569,11 @@ static int fsl_sai_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, sai);
ret = clk_prepare_enable(sai->bus_clk);
if (ret)
return ret;
ret = fsl_sai_check_ver(&pdev->dev);
if (ret < 0)
dev_warn(&pdev->dev, "Error reading SAI version: %d\n", ret);
@ -1600,6 +1600,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
FSL_SAI_MCTL_MCLK_EN, FSL_SAI_MCTL_MCLK_EN);
}
clk_disable_unprepare(sai->bus_clk);
sai->dma_params_rx.chan_name = "rx";
sai->dma_params_tx.chan_name = "tx";
sai->dma_params_rx.addr = res->start + FSL_SAI_RDR0;