| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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/>. |
|---|
| 15 | 4 | */ |
|---|
| 16 | 5 | |
|---|
| 17 | 6 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 271 | 260 | const char *ref_clk, *pll_clk = "pll"; |
|---|
| 272 | 261 | u32 rate; |
|---|
| 273 | 262 | int n; |
|---|
| 274 | | - u32 accuracy = 0; |
|---|
| 275 | 263 | |
|---|
| 276 | 264 | clk_data = kzalloc(struct_size(clk_data, hws, MAX_CLKS), GFP_KERNEL); |
|---|
| 277 | 265 | if (!clk_data) |
|---|
| .. | .. |
|---|
| 281 | 269 | |
|---|
| 282 | 270 | base = of_io_request_and_map(np, 0, np->name); |
|---|
| 283 | 271 | if (IS_ERR(base)) |
|---|
| 284 | | - panic("%s: unable to map resource", np->name); |
|---|
| 272 | + panic("%pOFn: unable to map resource", np); |
|---|
| 285 | 273 | |
|---|
| 286 | 274 | /* register pll */ |
|---|
| 287 | 275 | rate = (ioread32(base + HW_SYSPLLCTRL) & 0xffff) * 1000000; |
|---|
| 288 | 276 | |
|---|
| 277 | + /* TODO: Convert to DT parent scheme */ |
|---|
| 289 | 278 | 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); |
|---|
| 293 | 282 | |
|---|
| 294 | 283 | 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); |
|---|
| 296 | 285 | |
|---|
| 297 | 286 | for (n = 0; n < ARRAY_SIZE(asm9260_mux_clks); n++) { |
|---|
| 298 | 287 | const struct asm9260_mux_clock *mc = &asm9260_mux_clks[n]; |
|---|