.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2017 Priit Laes <plaes@plaes.org>. |
---|
3 | 4 | * Copyright (c) 2017 Maxime Ripard. |
---|
4 | 5 | * 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. |
---|
14 | 6 | */ |
---|
15 | 7 | |
---|
16 | 8 | #include <linux/clk-provider.h> |
---|
| 9 | +#include <linux/io.h> |
---|
17 | 10 | #include <linux/of_address.h> |
---|
18 | 11 | |
---|
19 | 12 | #include "ccu_common.h" |
---|
.. | .. |
---|
167 | 160 | }, |
---|
168 | 161 | }; |
---|
169 | 162 | |
---|
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); |
---|
172 | 166 | |
---|
173 | 167 | /* Not documented on A10 */ |
---|
174 | 168 | static struct ccu_div pll_periph_sata_clk = { |
---|
.. | .. |
---|
1035 | 1029 | &out_b_clk.common |
---|
1036 | 1030 | }; |
---|
1037 | 1031 | |
---|
| 1032 | +static const struct clk_hw *clk_parent_pll_audio[] = { |
---|
| 1033 | + &pll_audio_base_clk.common.hw |
---|
| 1034 | +}; |
---|
| 1035 | + |
---|
1038 | 1036 | /* 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); |
---|
1051 | 1055 | |
---|
1052 | 1056 | |
---|
1053 | 1057 | static struct clk_hw_onecell_data sun4i_a10_hw_clks = { |
---|