Skip to content

Commit 9e56a7d

Browse files
tmlindbebarino
authored andcommitted
clk: ti: Update pll and clockdomain clocks to use ti_dt_clk_name()
Let's update the TI pll and clockdomain clocks to use ti_dt_clk_name() instead of devicetree node name if available. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20220204071449.16762-8-tony@atomide.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 2c15933 commit 9e56a7d

4 files changed

Lines changed: 22 additions & 12 deletions

File tree

drivers/clk/ti/apll.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ static void __init omap_clk_register_apll(void *user,
139139
struct clk_hw *hw = user;
140140
struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw);
141141
struct dpll_data *ad = clk_hw->dpll_data;
142+
const char *name;
142143
struct clk *clk;
143144
const struct clk_init_data *init = clk_hw->hw.init;
144145

@@ -166,7 +167,8 @@ static void __init omap_clk_register_apll(void *user,
166167

167168
ad->clk_bypass = __clk_get_hw(clk);
168169

169-
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name);
170+
name = ti_dt_clk_name(node);
171+
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name);
170172
if (!IS_ERR(clk)) {
171173
of_clk_add_provider(node, of_clk_src_simple_get, clk);
172174
kfree(init->parent_names);
@@ -198,7 +200,7 @@ static void __init of_dra7_apll_setup(struct device_node *node)
198200
clk_hw->dpll_data = ad;
199201
clk_hw->hw.init = init;
200202

201-
init->name = node->name;
203+
init->name = ti_dt_clk_name(node);
202204
init->ops = &apll_ck_ops;
203205

204206
init->num_parents = of_clk_get_parent_count(node);
@@ -347,6 +349,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)
347349
struct dpll_data *ad = NULL;
348350
struct clk_hw_omap *clk_hw = NULL;
349351
struct clk_init_data *init = NULL;
352+
const char *name;
350353
struct clk *clk;
351354
const char *parent_name;
352355
u32 val;
@@ -362,7 +365,8 @@ static void __init of_omap2_apll_setup(struct device_node *node)
362365
clk_hw->dpll_data = ad;
363366
clk_hw->hw.init = init;
364367
init->ops = &omap2_apll_ops;
365-
init->name = node->name;
368+
name = ti_dt_clk_name(node);
369+
init->name = name;
366370
clk_hw->ops = &omap2_apll_hwops;
367371

368372
init->num_parents = of_clk_get_parent_count(node);
@@ -403,7 +407,8 @@ static void __init of_omap2_apll_setup(struct device_node *node)
403407
if (ret)
404408
goto cleanup;
405409

406-
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name);
410+
name = ti_dt_clk_name(node);
411+
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name);
407412
if (!IS_ERR(clk)) {
408413
of_clk_add_provider(node, of_clk_src_simple_get, clk);
409414
kfree(init);

drivers/clk/ti/clockdomain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
131131
{
132132
struct clk *clk;
133133
struct clk_hw *clk_hw;
134-
const char *clkdm_name = node->name;
134+
const char *clkdm_name = ti_dt_clk_name(node);
135135
int i;
136136
unsigned int num_clks;
137137

drivers/clk/ti/dpll.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ static void __init _register_dpll(void *user,
164164
struct clk_hw *hw = user;
165165
struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw);
166166
struct dpll_data *dd = clk_hw->dpll_data;
167+
const char *name;
167168
struct clk *clk;
168169
const struct clk_init_data *init = hw->init;
169170

@@ -193,7 +194,8 @@ static void __init _register_dpll(void *user,
193194
dd->clk_bypass = __clk_get_hw(clk);
194195

195196
/* register the clock */
196-
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name);
197+
name = ti_dt_clk_name(node);
198+
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name);
197199

198200
if (!IS_ERR(clk)) {
199201
of_clk_add_provider(node, of_clk_src_simple_get, clk);
@@ -227,7 +229,7 @@ static void _register_dpll_x2(struct device_node *node,
227229
struct clk *clk;
228230
struct clk_init_data init = { NULL };
229231
struct clk_hw_omap *clk_hw;
230-
const char *name = node->name;
232+
const char *name = ti_dt_clk_name(node);
231233
const char *parent_name;
232234

233235
parent_name = of_clk_get_parent_name(node, 0);
@@ -304,7 +306,7 @@ static void __init of_ti_dpll_setup(struct device_node *node,
304306
clk_hw->ops = &clkhwops_omap3_dpll;
305307
clk_hw->hw.init = init;
306308

307-
init->name = node->name;
309+
init->name = ti_dt_clk_name(node);
308310
init->ops = ops;
309311

310312
init->num_parents = of_clk_get_parent_count(node);

drivers/clk/ti/fapll.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <linux/of_address.h>
2020
#include <linux/clk/ti.h>
2121

22+
#include "clock.h"
23+
2224
/* FAPLL Control Register PLL_CTRL */
2325
#define FAPLL_MAIN_MULT_N_SHIFT 16
2426
#define FAPLL_MAIN_DIV_P_SHIFT 8
@@ -542,6 +544,7 @@ static void __init ti_fapll_setup(struct device_node *node)
542544
struct clk_init_data *init = NULL;
543545
const char *parent_name[2];
544546
struct clk *pll_clk;
547+
const char *name;
545548
int i;
546549

547550
fd = kzalloc(sizeof(*fd), GFP_KERNEL);
@@ -559,7 +562,8 @@ static void __init ti_fapll_setup(struct device_node *node)
559562
goto free;
560563

561564
init->ops = &ti_fapll_ops;
562-
init->name = node->name;
565+
name = ti_dt_clk_name(node);
566+
init->name = name;
563567

564568
init->num_parents = of_clk_get_parent_count(node);
565569
if (init->num_parents != 2) {
@@ -591,7 +595,7 @@ static void __init ti_fapll_setup(struct device_node *node)
591595
if (fapll_is_ddr_pll(fd->base))
592596
fd->bypass_bit_inverted = true;
593597

594-
fd->name = node->name;
598+
fd->name = name;
595599
fd->hw.init = init;
596600

597601
/* Register the parent PLL */
@@ -638,8 +642,7 @@ static void __init ti_fapll_setup(struct device_node *node)
638642
freq = NULL;
639643
}
640644
synth_clk = ti_fapll_synth_setup(fd, freq, div, output_instance,
641-
output_name, node->name,
642-
pll_clk);
645+
output_name, name, pll_clk);
643646
if (IS_ERR(synth_clk))
644647
continue;
645648

0 commit comments

Comments
 (0)