Commit a5b16dfa authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Sylwester Nawrocki

clk: samsung: exynos-audss: Replace syscore PM with platform device PM

Exynos AUDSS clock driver has been already converted to platform driver,
so remove the dependency on the syscore ops - the last remaining
non-platform driver feature. Platform device's system sleep PM provides
all needed infrastructure for replacing syscore-based PM, so do it now.
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
parent 0cda9118
...@@ -44,7 +44,7 @@ static unsigned long reg_save[][2] = { ...@@ -44,7 +44,7 @@ static unsigned long reg_save[][2] = {
{ ASS_CLK_GATE, 0 }, { ASS_CLK_GATE, 0 },
}; };
static int exynos_audss_clk_suspend(void) static int exynos_audss_clk_suspend(struct device *dev)
{ {
int i; int i;
...@@ -54,18 +54,15 @@ static int exynos_audss_clk_suspend(void) ...@@ -54,18 +54,15 @@ static int exynos_audss_clk_suspend(void)
return 0; return 0;
} }
static void exynos_audss_clk_resume(void) static int exynos_audss_clk_resume(struct device *dev)
{ {
int i; int i;
for (i = 0; i < ARRAY_SIZE(reg_save); i++) for (i = 0; i < ARRAY_SIZE(reg_save); i++)
writel(reg_save[i][1], reg_base + reg_save[i][0]); writel(reg_save[i][1], reg_base + reg_save[i][0]);
}
static struct syscore_ops exynos_audss_clk_syscore_ops = { return 0;
.suspend = exynos_audss_clk_suspend, }
.resume = exynos_audss_clk_resume,
};
#endif /* CONFIG_PM_SLEEP */ #endif /* CONFIG_PM_SLEEP */
struct exynos_audss_clk_drvdata { struct exynos_audss_clk_drvdata {
...@@ -251,9 +248,6 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) ...@@ -251,9 +248,6 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
goto unregister; goto unregister;
} }
#ifdef CONFIG_PM_SLEEP
register_syscore_ops(&exynos_audss_clk_syscore_ops);
#endif
return 0; return 0;
unregister: unregister:
...@@ -267,10 +261,6 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) ...@@ -267,10 +261,6 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
static int exynos_audss_clk_remove(struct platform_device *pdev) static int exynos_audss_clk_remove(struct platform_device *pdev)
{ {
#ifdef CONFIG_PM_SLEEP
unregister_syscore_ops(&exynos_audss_clk_syscore_ops);
#endif
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
exynos_audss_clk_teardown(); exynos_audss_clk_teardown();
...@@ -281,10 +271,16 @@ static int exynos_audss_clk_remove(struct platform_device *pdev) ...@@ -281,10 +271,16 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
return 0; return 0;
} }
static const struct dev_pm_ops exynos_audss_clk_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(exynos_audss_clk_suspend,
exynos_audss_clk_resume)
};
static struct platform_driver exynos_audss_clk_driver = { static struct platform_driver exynos_audss_clk_driver = {
.driver = { .driver = {
.name = "exynos-audss-clk", .name = "exynos-audss-clk",
.of_match_table = exynos_audss_clk_of_match, .of_match_table = exynos_audss_clk_of_match,
.pm = &exynos_audss_clk_pm_ops,
}, },
.probe = exynos_audss_clk_probe, .probe = exynos_audss_clk_probe,
.remove = exynos_audss_clk_remove, .remove = exynos_audss_clk_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment