.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de> |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License version 2 as |
---|
6 | | - * published by the Free Software Foundation. |
---|
7 | 4 | * |
---|
8 | 5 | * Common Clock Framework support for S3C2410 and following SoCs. |
---|
9 | 6 | */ |
---|
10 | 7 | |
---|
11 | 8 | #include <linux/clk-provider.h> |
---|
| 9 | +#include <linux/clk/samsung.h> |
---|
12 | 10 | #include <linux/of.h> |
---|
13 | 11 | #include <linux/of_address.h> |
---|
14 | | -#include <linux/syscore_ops.h> |
---|
15 | 12 | |
---|
16 | 13 | #include <dt-bindings/clock/s3c2410.h> |
---|
17 | 14 | |
---|
.. | .. |
---|
40 | 37 | |
---|
41 | 38 | static void __iomem *reg_base; |
---|
42 | 39 | |
---|
43 | | -#ifdef CONFIG_PM_SLEEP |
---|
44 | | -static struct samsung_clk_reg_dump *s3c2410_save; |
---|
45 | | - |
---|
46 | 40 | /* |
---|
47 | 41 | * list of controller registers to be saved and restored during a |
---|
48 | 42 | * suspend/resume cycle. |
---|
.. | .. |
---|
56 | 50 | CLKDIVN, |
---|
57 | 51 | CAMDIVN, |
---|
58 | 52 | }; |
---|
59 | | - |
---|
60 | | -static int s3c2410_clk_suspend(void) |
---|
61 | | -{ |
---|
62 | | - samsung_clk_save(reg_base, s3c2410_save, |
---|
63 | | - ARRAY_SIZE(s3c2410_clk_regs)); |
---|
64 | | - |
---|
65 | | - return 0; |
---|
66 | | -} |
---|
67 | | - |
---|
68 | | -static void s3c2410_clk_resume(void) |
---|
69 | | -{ |
---|
70 | | - samsung_clk_restore(reg_base, s3c2410_save, |
---|
71 | | - ARRAY_SIZE(s3c2410_clk_regs)); |
---|
72 | | -} |
---|
73 | | - |
---|
74 | | -static struct syscore_ops s3c2410_clk_syscore_ops = { |
---|
75 | | - .suspend = s3c2410_clk_suspend, |
---|
76 | | - .resume = s3c2410_clk_resume, |
---|
77 | | -}; |
---|
78 | | - |
---|
79 | | -static void __init s3c2410_clk_sleep_init(void) |
---|
80 | | -{ |
---|
81 | | - s3c2410_save = samsung_clk_alloc_reg_dump(s3c2410_clk_regs, |
---|
82 | | - ARRAY_SIZE(s3c2410_clk_regs)); |
---|
83 | | - if (!s3c2410_save) { |
---|
84 | | - pr_warn("%s: failed to allocate sleep save data, no sleep support!\n", |
---|
85 | | - __func__); |
---|
86 | | - return; |
---|
87 | | - } |
---|
88 | | - |
---|
89 | | - register_syscore_ops(&s3c2410_clk_syscore_ops); |
---|
90 | | - return; |
---|
91 | | -} |
---|
92 | | -#else |
---|
93 | | -static void __init s3c2410_clk_sleep_init(void) {} |
---|
94 | | -#endif |
---|
95 | 53 | |
---|
96 | 54 | PNAME(fclk_p) = { "mpll", "div_slow" }; |
---|
97 | 55 | |
---|
.. | .. |
---|
461 | 419 | ARRAY_SIZE(s3c244x_common_aliases)); |
---|
462 | 420 | } |
---|
463 | 421 | |
---|
464 | | - s3c2410_clk_sleep_init(); |
---|
| 422 | + samsung_clk_sleep_init(reg_base, s3c2410_clk_regs, |
---|
| 423 | + ARRAY_SIZE(s3c2410_clk_regs)); |
---|
465 | 424 | |
---|
466 | 425 | samsung_clk_of_add_provider(np, ctx); |
---|
467 | 426 | } |
---|