Commit 9e56a7d4 authored by Tony Lindgren's avatar Tony Lindgren Committed by Stephen Boyd

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: default avatarTony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20220204071449.16762-8-tony@atomide.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 2c159332
...@@ -139,6 +139,7 @@ static void __init omap_clk_register_apll(void *user, ...@@ -139,6 +139,7 @@ static void __init omap_clk_register_apll(void *user,
struct clk_hw *hw = user; struct clk_hw *hw = user;
struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw); struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw);
struct dpll_data *ad = clk_hw->dpll_data; struct dpll_data *ad = clk_hw->dpll_data;
const char *name;
struct clk *clk; struct clk *clk;
const struct clk_init_data *init = clk_hw->hw.init; const struct clk_init_data *init = clk_hw->hw.init;
...@@ -166,7 +167,8 @@ static void __init omap_clk_register_apll(void *user, ...@@ -166,7 +167,8 @@ static void __init omap_clk_register_apll(void *user,
ad->clk_bypass = __clk_get_hw(clk); ad->clk_bypass = __clk_get_hw(clk);
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name); name = ti_dt_clk_name(node);
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name);
if (!IS_ERR(clk)) { if (!IS_ERR(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk); of_clk_add_provider(node, of_clk_src_simple_get, clk);
kfree(init->parent_names); kfree(init->parent_names);
...@@ -198,7 +200,7 @@ static void __init of_dra7_apll_setup(struct device_node *node) ...@@ -198,7 +200,7 @@ static void __init of_dra7_apll_setup(struct device_node *node)
clk_hw->dpll_data = ad; clk_hw->dpll_data = ad;
clk_hw->hw.init = init; clk_hw->hw.init = init;
init->name = node->name; init->name = ti_dt_clk_name(node);
init->ops = &apll_ck_ops; init->ops = &apll_ck_ops;
init->num_parents = of_clk_get_parent_count(node); init->num_parents = of_clk_get_parent_count(node);
...@@ -347,6 +349,7 @@ static void __init of_omap2_apll_setup(struct device_node *node) ...@@ -347,6 +349,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)
struct dpll_data *ad = NULL; struct dpll_data *ad = NULL;
struct clk_hw_omap *clk_hw = NULL; struct clk_hw_omap *clk_hw = NULL;
struct clk_init_data *init = NULL; struct clk_init_data *init = NULL;
const char *name;
struct clk *clk; struct clk *clk;
const char *parent_name; const char *parent_name;
u32 val; u32 val;
...@@ -362,7 +365,8 @@ static void __init of_omap2_apll_setup(struct device_node *node) ...@@ -362,7 +365,8 @@ static void __init of_omap2_apll_setup(struct device_node *node)
clk_hw->dpll_data = ad; clk_hw->dpll_data = ad;
clk_hw->hw.init = init; clk_hw->hw.init = init;
init->ops = &omap2_apll_ops; init->ops = &omap2_apll_ops;
init->name = node->name; name = ti_dt_clk_name(node);
init->name = name;
clk_hw->ops = &omap2_apll_hwops; clk_hw->ops = &omap2_apll_hwops;
init->num_parents = of_clk_get_parent_count(node); init->num_parents = of_clk_get_parent_count(node);
...@@ -403,7 +407,8 @@ static void __init of_omap2_apll_setup(struct device_node *node) ...@@ -403,7 +407,8 @@ static void __init of_omap2_apll_setup(struct device_node *node)
if (ret) if (ret)
goto cleanup; goto cleanup;
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name); name = ti_dt_clk_name(node);
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name);
if (!IS_ERR(clk)) { if (!IS_ERR(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk); of_clk_add_provider(node, of_clk_src_simple_get, clk);
kfree(init); kfree(init);
......
...@@ -131,7 +131,7 @@ static void __init of_ti_clockdomain_setup(struct device_node *node) ...@@ -131,7 +131,7 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
{ {
struct clk *clk; struct clk *clk;
struct clk_hw *clk_hw; struct clk_hw *clk_hw;
const char *clkdm_name = node->name; const char *clkdm_name = ti_dt_clk_name(node);
int i; int i;
unsigned int num_clks; unsigned int num_clks;
......
...@@ -164,6 +164,7 @@ static void __init _register_dpll(void *user, ...@@ -164,6 +164,7 @@ static void __init _register_dpll(void *user,
struct clk_hw *hw = user; struct clk_hw *hw = user;
struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw); struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw);
struct dpll_data *dd = clk_hw->dpll_data; struct dpll_data *dd = clk_hw->dpll_data;
const char *name;
struct clk *clk; struct clk *clk;
const struct clk_init_data *init = hw->init; const struct clk_init_data *init = hw->init;
...@@ -193,7 +194,8 @@ static void __init _register_dpll(void *user, ...@@ -193,7 +194,8 @@ static void __init _register_dpll(void *user,
dd->clk_bypass = __clk_get_hw(clk); dd->clk_bypass = __clk_get_hw(clk);
/* register the clock */ /* register the clock */
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name); name = ti_dt_clk_name(node);
clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name);
if (!IS_ERR(clk)) { if (!IS_ERR(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk); of_clk_add_provider(node, of_clk_src_simple_get, clk);
...@@ -227,7 +229,7 @@ static void _register_dpll_x2(struct device_node *node, ...@@ -227,7 +229,7 @@ static void _register_dpll_x2(struct device_node *node,
struct clk *clk; struct clk *clk;
struct clk_init_data init = { NULL }; struct clk_init_data init = { NULL };
struct clk_hw_omap *clk_hw; struct clk_hw_omap *clk_hw;
const char *name = node->name; const char *name = ti_dt_clk_name(node);
const char *parent_name; const char *parent_name;
parent_name = of_clk_get_parent_name(node, 0); parent_name = of_clk_get_parent_name(node, 0);
...@@ -304,7 +306,7 @@ static void __init of_ti_dpll_setup(struct device_node *node, ...@@ -304,7 +306,7 @@ static void __init of_ti_dpll_setup(struct device_node *node,
clk_hw->ops = &clkhwops_omap3_dpll; clk_hw->ops = &clkhwops_omap3_dpll;
clk_hw->hw.init = init; clk_hw->hw.init = init;
init->name = node->name; init->name = ti_dt_clk_name(node);
init->ops = ops; init->ops = ops;
init->num_parents = of_clk_get_parent_count(node); init->num_parents = of_clk_get_parent_count(node);
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/clk/ti.h> #include <linux/clk/ti.h>
#include "clock.h"
/* FAPLL Control Register PLL_CTRL */ /* FAPLL Control Register PLL_CTRL */
#define FAPLL_MAIN_MULT_N_SHIFT 16 #define FAPLL_MAIN_MULT_N_SHIFT 16
#define FAPLL_MAIN_DIV_P_SHIFT 8 #define FAPLL_MAIN_DIV_P_SHIFT 8
...@@ -542,6 +544,7 @@ static void __init ti_fapll_setup(struct device_node *node) ...@@ -542,6 +544,7 @@ static void __init ti_fapll_setup(struct device_node *node)
struct clk_init_data *init = NULL; struct clk_init_data *init = NULL;
const char *parent_name[2]; const char *parent_name[2];
struct clk *pll_clk; struct clk *pll_clk;
const char *name;
int i; int i;
fd = kzalloc(sizeof(*fd), GFP_KERNEL); fd = kzalloc(sizeof(*fd), GFP_KERNEL);
...@@ -559,7 +562,8 @@ static void __init ti_fapll_setup(struct device_node *node) ...@@ -559,7 +562,8 @@ static void __init ti_fapll_setup(struct device_node *node)
goto free; goto free;
init->ops = &ti_fapll_ops; init->ops = &ti_fapll_ops;
init->name = node->name; name = ti_dt_clk_name(node);
init->name = name;
init->num_parents = of_clk_get_parent_count(node); init->num_parents = of_clk_get_parent_count(node);
if (init->num_parents != 2) { if (init->num_parents != 2) {
...@@ -591,7 +595,7 @@ static void __init ti_fapll_setup(struct device_node *node) ...@@ -591,7 +595,7 @@ static void __init ti_fapll_setup(struct device_node *node)
if (fapll_is_ddr_pll(fd->base)) if (fapll_is_ddr_pll(fd->base))
fd->bypass_bit_inverted = true; fd->bypass_bit_inverted = true;
fd->name = node->name; fd->name = name;
fd->hw.init = init; fd->hw.init = init;
/* Register the parent PLL */ /* Register the parent PLL */
...@@ -638,8 +642,7 @@ static void __init ti_fapll_setup(struct device_node *node) ...@@ -638,8 +642,7 @@ static void __init ti_fapll_setup(struct device_node *node)
freq = NULL; freq = NULL;
} }
synth_clk = ti_fapll_synth_setup(fd, freq, div, output_instance, synth_clk = ti_fapll_synth_setup(fd, freq, div, output_instance,
output_name, node->name, output_name, name, pll_clk);
pll_clk);
if (IS_ERR(synth_clk)) if (IS_ERR(synth_clk))
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment