forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/clk/at91/clk-smd.c
....@@ -1,11 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.com>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
94 */
105
116 #include <linux/clk-provider.h>
....@@ -16,8 +11,6 @@
1611 #include <linux/regmap.h>
1712
1813 #include "pmc.h"
19
-
20
-#define SMD_SOURCE_MAX 2
2114
2215 #define SMD_DIV_SHIFT 8
2316 #define SMD_MAX_DIV 0xf
....@@ -111,13 +104,13 @@
111104 .set_rate = at91sam9x5_clk_smd_set_rate,
112105 };
113106
114
-static struct clk_hw * __init
107
+struct clk_hw * __init
115108 at91sam9x5_clk_register_smd(struct regmap *regmap, const char *name,
116109 const char **parent_names, u8 num_parents)
117110 {
118111 struct at91sam9x5_clk_smd *smd;
119112 struct clk_hw *hw;
120
- struct clk_init_data init = {};
113
+ struct clk_init_data init;
121114 int ret;
122115
123116 smd = kzalloc(sizeof(*smd), GFP_KERNEL);
....@@ -142,33 +135,3 @@
142135
143136 return hw;
144137 }
145
-
146
-static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np)
147
-{
148
- struct clk_hw *hw;
149
- unsigned int num_parents;
150
- const char *parent_names[SMD_SOURCE_MAX];
151
- const char *name = np->name;
152
- struct regmap *regmap;
153
-
154
- num_parents = of_clk_get_parent_count(np);
155
- if (num_parents == 0 || num_parents > SMD_SOURCE_MAX)
156
- return;
157
-
158
- of_clk_parent_fill(np, parent_names, num_parents);
159
-
160
- of_property_read_string(np, "clock-output-names", &name);
161
-
162
- regmap = syscon_node_to_regmap(of_get_parent(np));
163
- if (IS_ERR(regmap))
164
- return;
165
-
166
- hw = at91sam9x5_clk_register_smd(regmap, name, parent_names,
167
- num_parents);
168
- if (IS_ERR(hw))
169
- return;
170
-
171
- of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
172
-}
173
-CLK_OF_DECLARE(at91sam9x5_clk_smd, "atmel,at91sam9x5-clk-smd",
174
- of_at91sam9x5_clk_smd_setup);