diff options
author | Walker Chen <walker.chen@starfivetech.com> | 2022-10-26 14:19:12 +0300 |
---|---|---|
committer | mason.huo <mason.huo@starfivetech.com> | 2022-10-27 09:00:49 +0300 |
commit | e9a3090389dcd50759f80d7ddca5721d7d404910 (patch) | |
tree | bfb1815ba435bc2f602c4d057c3e145bffc0da24 /sound | |
parent | 0dea956552249f6100daabfb1118e9118cddf88c (diff) | |
download | linux-e9a3090389dcd50759f80d7ddca5721d7d404910.tar.xz |
CR_2345_Audio_DevicePM_walker.chen
Disable clock when audio driver is loaded.
Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/starfive/starfive_pdm.c | 8 | ||||
-rw-r--r-- | sound/soc/starfive/starfive_tdm.c | 18 |
2 files changed, 18 insertions, 8 deletions
diff --git a/sound/soc/starfive/starfive_pdm.c b/sound/soc/starfive/starfive_pdm.c index ba4bb615d2c5..ca5277104bf7 100644 --- a/sound/soc/starfive/starfive_pdm.c +++ b/sound/soc/starfive/starfive_pdm.c @@ -461,6 +461,12 @@ static int sf_pdm_probe(struct platform_device *pdev) } pm_runtime_enable(&pdev->dev); +#ifdef CONFIG_PM + clk_disable_unprepare(priv->clk_pdm_apb); + clk_disable_unprepare(priv->clk_pdm_mclk); + clk_disable_unprepare(priv->clk_mclk); +#endif + return 0; } @@ -485,9 +491,7 @@ static struct platform_driver sf_pdm_driver = { .driver = { .name = "jh7110-pdm", .of_match_table = sf_pdm_of_match, -#ifdef CONFIG_PM .pm = &sf_pdm_pm_ops, -#endif }, .probe = sf_pdm_probe, .remove = sf_pdm_dev_remove, diff --git a/sound/soc/starfive/starfive_tdm.c b/sound/soc/starfive/starfive_tdm.c index 28056b3899b6..bd7372ed6a0d 100644 --- a/sound/soc/starfive/starfive_tdm.c +++ b/sound/soc/starfive/starfive_tdm.c @@ -123,18 +123,22 @@ static void sf_tdm_config(struct sf_tdm_dev *dev, struct snd_pcm_substream *subs sf_tdm_writel(dev, TDM_PCMRXCR, datarx); } -#ifdef CONFIG_PM -static int sf_tdm_runtime_suspend(struct device *dev) +static void sf_tdm_clk_disable(struct sf_tdm_dev *priv) { - struct sf_tdm_dev *priv = dev_get_drvdata(dev); - clk_disable_unprepare(priv->clk_tdm); clk_disable_unprepare(priv->clk_tdm_ext); clk_disable_unprepare(priv->clk_tdm_internal); clk_disable_unprepare(priv->clk_tdm_apb); clk_disable_unprepare(priv->clk_tdm_ahb); clk_disable_unprepare(priv->clk_mclk_inner); +} +#ifdef CONFIG_PM +static int sf_tdm_runtime_suspend(struct device *dev) +{ + struct sf_tdm_dev *priv = dev_get_drvdata(dev); + + sf_tdm_clk_disable(priv); return 0; } @@ -690,6 +694,10 @@ static int sf_tdm_probe(struct platform_device *pdev) } pm_runtime_enable(&pdev->dev); +#ifdef CONFIG_PM + sf_tdm_clk_disable(dev); +#endif + return 0; } @@ -713,9 +721,7 @@ static struct platform_driver sf_tdm_driver = { .driver = { .name = "jh7110-tdm", .of_match_table = sf_tdm_of_match, -#ifdef CONFIG_PM .pm = &sf_tdm_pm_ops, -#endif }, .probe = sf_tdm_probe, .remove = sf_tdm_dev_remove, |