diff options
author | Shengjiu Wang <shengjiu.wang@nxp.com> | 2020-03-17 18:27:04 +0800 |
---|---|---|
committer | Shengjiu Wang <shengjiu.wang@nxp.com> | 2020-03-18 15:41:58 +0800 |
commit | c2641e1974f7f1a0e858fd227eb233085d6da9bb (patch) | |
tree | cfac4bfc935174775eab3d33e47fdb54194151d9 /sound/soc/fsl/fsl_sai.c | |
parent | 45db541836b124c2127846246e9585da306a37a3 (diff) |
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>
Diffstat (limited to 'sound/soc/fsl/fsl_sai.c')
-rw-r--r-- | sound/soc/fsl/fsl_sai.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 32f584f558d0..305af70660d9 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -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; |