forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/clk/sunxi-ng/ccu-sun4i-a10.c
....@@ -1,19 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2017 Priit Laes <plaes@plaes.org>.
34 * Copyright (c) 2017 Maxime Ripard.
45 * Copyright (c) 2017 Jonathan Liu.
5
- *
6
- * This software is licensed under the terms of the GNU General Public
7
- * License version 2, as published by the Free Software Foundation, and
8
- * may be copied, distributed, and modified under those terms.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
146 */
157
168 #include <linux/clk-provider.h>
9
+#include <linux/io.h>
1710 #include <linux/of_address.h>
1811
1912 #include "ccu_common.h"
....@@ -167,8 +160,9 @@
167160 },
168161 };
169162
170
-static CLK_FIXED_FACTOR(pll_periph_clk, "pll-periph", "pll-periph-base",
171
- 2, 1, CLK_SET_RATE_PARENT);
163
+static CLK_FIXED_FACTOR_HW(pll_periph_clk, "pll-periph",
164
+ &pll_periph_base_clk.common.hw,
165
+ 2, 1, CLK_SET_RATE_PARENT);
172166
173167 /* Not documented on A10 */
174168 static struct ccu_div pll_periph_sata_clk = {
....@@ -1035,19 +1029,29 @@
10351029 &out_b_clk.common
10361030 };
10371031
1032
+static const struct clk_hw *clk_parent_pll_audio[] = {
1033
+ &pll_audio_base_clk.common.hw
1034
+};
1035
+
10381036 /* Post-divider for pll-audio is hardcoded to 1 */
1039
-static CLK_FIXED_FACTOR(pll_audio_clk, "pll-audio",
1040
- "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT);
1041
-static CLK_FIXED_FACTOR(pll_audio_2x_clk, "pll-audio-2x",
1042
- "pll-audio-base", 2, 1, CLK_SET_RATE_PARENT);
1043
-static CLK_FIXED_FACTOR(pll_audio_4x_clk, "pll-audio-4x",
1044
- "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT);
1045
-static CLK_FIXED_FACTOR(pll_audio_8x_clk, "pll-audio-8x",
1046
- "pll-audio-base", 1, 2, CLK_SET_RATE_PARENT);
1047
-static CLK_FIXED_FACTOR(pll_video0_2x_clk, "pll-video0-2x",
1048
- "pll-video0", 1, 2, CLK_SET_RATE_PARENT);
1049
-static CLK_FIXED_FACTOR(pll_video1_2x_clk, "pll-video1-2x",
1050
- "pll-video1", 1, 2, CLK_SET_RATE_PARENT);
1037
+static CLK_FIXED_FACTOR_HWS(pll_audio_clk, "pll-audio",
1038
+ clk_parent_pll_audio,
1039
+ 1, 1, CLK_SET_RATE_PARENT);
1040
+static CLK_FIXED_FACTOR_HWS(pll_audio_2x_clk, "pll-audio-2x",
1041
+ clk_parent_pll_audio,
1042
+ 2, 1, CLK_SET_RATE_PARENT);
1043
+static CLK_FIXED_FACTOR_HWS(pll_audio_4x_clk, "pll-audio-4x",
1044
+ clk_parent_pll_audio,
1045
+ 1, 1, CLK_SET_RATE_PARENT);
1046
+static CLK_FIXED_FACTOR_HWS(pll_audio_8x_clk, "pll-audio-8x",
1047
+ clk_parent_pll_audio,
1048
+ 1, 2, CLK_SET_RATE_PARENT);
1049
+static CLK_FIXED_FACTOR_HW(pll_video0_2x_clk, "pll-video0-2x",
1050
+ &pll_video0_clk.common.hw,
1051
+ 1, 2, CLK_SET_RATE_PARENT);
1052
+static CLK_FIXED_FACTOR_HW(pll_video1_2x_clk, "pll-video1-2x",
1053
+ &pll_video1_clk.common.hw,
1054
+ 1, 2, CLK_SET_RATE_PARENT);
10511055
10521056
10531057 static struct clk_hw_onecell_data sun4i_a10_hw_clks = {