MLK-24365-2 dsp: manage audiomix clock in dsp driver.
IMX8MP_CLK_AUDIO_ROOT and IMX8MP_CLK_AUDIO_AXI_DIV will gated when suspend even if dsp driver ignored suspend when low power audio offload playback. The root cause is the two clocks is controlled when audiomix power on/off. Add the two clocks in dsp driver, so driver will add one ref count when useing dsp, so the two clocks don't be gated when A core suspend during low power audio playback. Signed-off-by: Bing Song <bing.song@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
7abd5e8287
commit
3818e25a7f
|
@ -1159,6 +1159,14 @@ static int fsl_dsp_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(dsp_priv->dsp_ocrama_clk))
|
||||
dsp_priv->dsp_ocrama_clk = NULL;
|
||||
|
||||
dsp_priv->audio_root_clk = devm_clk_get(&pdev->dev, "audio_root");
|
||||
if (IS_ERR(dsp_priv->audio_root_clk))
|
||||
dsp_priv->audio_root_clk = NULL;
|
||||
|
||||
dsp_priv->audio_axi_clk = devm_clk_get(&pdev->dev, "audio_axi");
|
||||
if (IS_ERR(dsp_priv->audio_axi_clk))
|
||||
dsp_priv->audio_axi_clk = NULL;
|
||||
|
||||
dsp_priv->dsp_root_clk = devm_clk_get(&pdev->dev, "core");
|
||||
if (IS_ERR(dsp_priv->dsp_root_clk))
|
||||
dsp_priv->dsp_root_clk = NULL;
|
||||
|
@ -1282,6 +1290,18 @@ static int fsl_dsp_runtime_resume(struct device *dev)
|
|||
goto dsp_root_clk;
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(dsp_priv->audio_root_clk);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to enable audio_root_clk ret = %d\n", ret);
|
||||
goto audio_root_clk;
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(dsp_priv->audio_axi_clk);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to enable audio_axi_clk ret = %d\n", ret);
|
||||
goto audio_axi_clk;
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(dsp_priv->debug_clk);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to enable debug_clk ret = %d\n", ret);
|
||||
|
@ -1373,6 +1393,10 @@ static int fsl_dsp_runtime_resume(struct device *dev)
|
|||
mu2_clk:
|
||||
clk_disable_unprepare(dsp_priv->debug_clk);
|
||||
debug_clk:
|
||||
clk_disable_unprepare(dsp_priv->audio_axi_clk);
|
||||
audio_axi_clk:
|
||||
clk_disable_unprepare(dsp_priv->audio_root_clk);
|
||||
audio_root_clk:
|
||||
clk_disable_unprepare(dsp_priv->dsp_root_clk);
|
||||
dsp_root_clk:
|
||||
clk_disable_unprepare(dsp_priv->dsp_ocrama_clk);
|
||||
|
@ -1411,6 +1435,8 @@ static int fsl_dsp_runtime_suspend(struct device *dev)
|
|||
|
||||
clk_disable_unprepare(dsp_priv->dsp_ocrama_clk);
|
||||
clk_disable_unprepare(dsp_priv->dsp_root_clk);
|
||||
clk_disable_unprepare(dsp_priv->audio_root_clk);
|
||||
clk_disable_unprepare(dsp_priv->audio_axi_clk);
|
||||
clk_disable_unprepare(dsp_priv->debug_clk);
|
||||
clk_disable_unprepare(dsp_priv->mu2_clk);
|
||||
clk_disable_unprepare(dsp_priv->sdma_root_clk);
|
||||
|
|
|
@ -116,6 +116,8 @@ struct fsl_dsp {
|
|||
struct clk *asrck_clk[4];
|
||||
struct clk *dsp_ocrama_clk;
|
||||
struct clk *dsp_root_clk;
|
||||
struct clk *audio_root_clk;
|
||||
struct clk *audio_axi_clk;
|
||||
struct clk *debug_clk;
|
||||
struct clk *mu2_clk;
|
||||
struct clk *sdma_root_clk;
|
||||
|
|
Loading…
Reference in New Issue