forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/clk/sunxi-ng/ccu-sun5i.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"
....@@ -610,19 +603,29 @@
610603 &iep_clk.common,
611604 };
612605
606
+static const struct clk_hw *clk_parent_pll_audio[] = {
607
+ &pll_audio_base_clk.common.hw
608
+};
609
+
613610 /* We hardcode the divider to 1 for now */
614
-static CLK_FIXED_FACTOR(pll_audio_clk, "pll-audio",
615
- "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT);
616
-static CLK_FIXED_FACTOR(pll_audio_2x_clk, "pll-audio-2x",
617
- "pll-audio-base", 2, 1, CLK_SET_RATE_PARENT);
618
-static CLK_FIXED_FACTOR(pll_audio_4x_clk, "pll-audio-4x",
619
- "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT);
620
-static CLK_FIXED_FACTOR(pll_audio_8x_clk, "pll-audio-8x",
621
- "pll-audio-base", 1, 2, CLK_SET_RATE_PARENT);
622
-static CLK_FIXED_FACTOR(pll_video0_2x_clk, "pll-video0-2x",
623
- "pll-video0", 1, 2, CLK_SET_RATE_PARENT);
624
-static CLK_FIXED_FACTOR(pll_video1_2x_clk, "pll-video1-2x",
625
- "pll-video1", 1, 2, CLK_SET_RATE_PARENT);
611
+static CLK_FIXED_FACTOR_HWS(pll_audio_clk, "pll-audio",
612
+ clk_parent_pll_audio,
613
+ 1, 1, CLK_SET_RATE_PARENT);
614
+static CLK_FIXED_FACTOR_HWS(pll_audio_2x_clk, "pll-audio-2x",
615
+ clk_parent_pll_audio,
616
+ 2, 1, CLK_SET_RATE_PARENT);
617
+static CLK_FIXED_FACTOR_HWS(pll_audio_4x_clk, "pll-audio-4x",
618
+ clk_parent_pll_audio,
619
+ 1, 1, CLK_SET_RATE_PARENT);
620
+static CLK_FIXED_FACTOR_HWS(pll_audio_8x_clk, "pll-audio-8x",
621
+ clk_parent_pll_audio,
622
+ 1, 2, CLK_SET_RATE_PARENT);
623
+static CLK_FIXED_FACTOR_HW(pll_video0_2x_clk, "pll-video0-2x",
624
+ &pll_video0_clk.common.hw,
625
+ 1, 2, CLK_SET_RATE_PARENT);
626
+static CLK_FIXED_FACTOR_HW(pll_video1_2x_clk, "pll-video1-2x",
627
+ &pll_video1_clk.common.hw,
628
+ 1, 2, CLK_SET_RATE_PARENT);
626629
627630 static struct clk_hw_onecell_data sun5i_a10s_hw_clks = {
628631 .hws = {