diff options
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/starfive/clk-starfive-jh7110-vout.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/clk/starfive/clk-starfive-jh7110-vout.c b/drivers/clk/starfive/clk-starfive-jh7110-vout.c index dcba067c3ba6..80f9be979c30 100644 --- a/drivers/clk/starfive/clk-starfive-jh7110-vout.c +++ b/drivers/clk/starfive/clk-starfive-jh7110-vout.c @@ -91,6 +91,18 @@ static struct clk_hw *jh7110_voutclk_get(struct of_phandle_args *clkspec, void * return ERR_PTR(-EINVAL); } +#ifdef CONFIG_PM_SLEEP +static int jh7110_voutcrg_sleep_suspend(struct device *dev) +{ + return pm_runtime_force_suspend(dev); +} + +static int jh7110_voutcrg_sleep_resume(struct device *dev) +{ + return pm_runtime_force_resume(dev); +} +#endif + #ifdef CONFIG_PM static int jh7110_voutcrg_suspend(struct device *dev) { @@ -110,6 +122,7 @@ static int jh7110_voutcrg_resume(struct device *dev) static const struct dev_pm_ops jh7110_voutcrg_pm_ops = { RUNTIME_PM_OPS(jh7110_voutcrg_suspend, jh7110_voutcrg_resume, NULL) + LATE_SYSTEM_SLEEP_PM_OPS(jh7110_voutcrg_sleep_suspend, jh7110_voutcrg_sleep_resume) }; #endif @@ -143,6 +156,8 @@ static int jh7110_voutcrg_probe(struct platform_device *pdev) return dev_err_probe(priv->dev, ret, "failed to get top clocks\n"); dev_set_drvdata(priv->dev, top); + pm_runtime_use_autosuspend(priv->dev); + pm_runtime_set_autosuspend_delay(priv->dev, 50); /* enable power domain and clocks */ pm_runtime_enable(priv->dev); ret = pm_runtime_get_sync(priv->dev); @@ -202,6 +217,8 @@ static int jh7110_voutcrg_probe(struct platform_device *pdev) if (ret) goto err_exit; + pm_runtime_put_sync(&pdev->dev); + return 0; err_exit: |