forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/clk/sunxi-ng/ccu-sun8i-a23.c
....@@ -1,17 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2016 Maxime Ripard. All rights reserved.
3
- *
4
- * This software is licensed under the terms of the GNU General Public
5
- * License version 2, as published by the Free Software Foundation, and
6
- * may be copied, distributed, and modified under those terms.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
124 */
135
146 #include <linux/clk-provider.h>
7
+#include <linux/io.h>
158 #include <linux/of_address.h>
169
1710 #include "ccu_common.h"
....@@ -550,19 +543,29 @@
550543 &ats_clk.common,
551544 };
552545
546
+static const struct clk_hw *clk_parent_pll_audio[] = {
547
+ &pll_audio_base_clk.common.hw
548
+};
549
+
553550 /* We hardcode the divider to 1 for now */
554
-static CLK_FIXED_FACTOR(pll_audio_clk, "pll-audio",
555
- "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT);
556
-static CLK_FIXED_FACTOR(pll_audio_2x_clk, "pll-audio-2x",
557
- "pll-audio-base", 2, 1, CLK_SET_RATE_PARENT);
558
-static CLK_FIXED_FACTOR(pll_audio_4x_clk, "pll-audio-4x",
559
- "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT);
560
-static CLK_FIXED_FACTOR(pll_audio_8x_clk, "pll-audio-8x",
561
- "pll-audio-base", 1, 2, CLK_SET_RATE_PARENT);
562
-static CLK_FIXED_FACTOR(pll_periph_2x_clk, "pll-periph-2x",
563
- "pll-periph", 1, 2, 0);
564
-static CLK_FIXED_FACTOR(pll_video_2x_clk, "pll-video-2x",
565
- "pll-video", 1, 2, 0);
551
+static CLK_FIXED_FACTOR_HWS(pll_audio_clk, "pll-audio",
552
+ clk_parent_pll_audio,
553
+ 1, 1, CLK_SET_RATE_PARENT);
554
+static CLK_FIXED_FACTOR_HWS(pll_audio_2x_clk, "pll-audio-2x",
555
+ clk_parent_pll_audio,
556
+ 2, 1, CLK_SET_RATE_PARENT);
557
+static CLK_FIXED_FACTOR_HWS(pll_audio_4x_clk, "pll-audio-4x",
558
+ clk_parent_pll_audio,
559
+ 1, 1, CLK_SET_RATE_PARENT);
560
+static CLK_FIXED_FACTOR_HWS(pll_audio_8x_clk, "pll-audio-8x",
561
+ clk_parent_pll_audio,
562
+ 1, 2, CLK_SET_RATE_PARENT);
563
+static CLK_FIXED_FACTOR_HW(pll_periph_2x_clk, "pll-periph-2x",
564
+ &pll_periph_clk.common.hw,
565
+ 1, 2, 0);
566
+static CLK_FIXED_FACTOR_HW(pll_video_2x_clk, "pll-video-2x",
567
+ &pll_video_clk.common.hw,
568
+ 1, 2, 0);
566569
567570 static struct clk_hw_onecell_data sun8i_a23_hw_clks = {
568571 .hws = {