forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/clk/clk-asm9260.c
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2014 Oleksij Rempel <linux@rempel-privat.de>.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
12
- *
13
- * You should have received a copy of the GNU General Public License along with
14
- * this program. If not, see <http://www.gnu.org/licenses/>.
154 */
165
176 #include <linux/clk.h>
....@@ -271,7 +260,6 @@
271260 const char *ref_clk, *pll_clk = "pll";
272261 u32 rate;
273262 int n;
274
- u32 accuracy = 0;
275263
276264 clk_data = kzalloc(struct_size(clk_data, hws, MAX_CLKS), GFP_KERNEL);
277265 if (!clk_data)
....@@ -281,18 +269,19 @@
281269
282270 base = of_io_request_and_map(np, 0, np->name);
283271 if (IS_ERR(base))
284
- panic("%s: unable to map resource", np->name);
272
+ panic("%pOFn: unable to map resource", np);
285273
286274 /* register pll */
287275 rate = (ioread32(base + HW_SYSPLLCTRL) & 0xffff) * 1000000;
288276
277
+ /* TODO: Convert to DT parent scheme */
289278 ref_clk = of_clk_get_parent_name(np, 0);
290
- accuracy = clk_get_accuracy(__clk_lookup(ref_clk));
291
- hw = clk_hw_register_fixed_rate_with_accuracy(NULL, pll_clk,
292
- ref_clk, 0, rate, accuracy);
279
+ hw = __clk_hw_register_fixed_rate(NULL, NULL, pll_clk,
280
+ ref_clk, NULL, NULL, 0, rate, 0,
281
+ CLK_FIXED_RATE_PARENT_ACCURACY);
293282
294283 if (IS_ERR(hw))
295
- panic("%s: can't register REFCLK. Check DT!", np->name);
284
+ panic("%pOFn: can't register REFCLK. Check DT!", np);
296285
297286 for (n = 0; n < ARRAY_SIZE(asm9260_mux_clks); n++) {
298287 const struct asm9260_mux_clock *mc = &asm9260_mux_clks[n];