@@ -147,14 +147,14 @@ static void __init at91rm9200_pmc_setup(struct device_node *np)
parent_hws[2] = at91rm9200_pmc->chws[PMC_PLLACK];
parent_hws[3] = at91rm9200_pmc->chws[PMC_PLLBCK];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
- NULL, parent_hws,
+ parent_hws,
&at91rm9200_master_layout,
&rm9200_mck_characteristics,
&rm9200_mck_lock);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw,
+ hw = at91_clk_register_master_div(regmap, "masterck_div", hw,
&at91rm9200_master_layout,
&rm9200_mck_characteristics,
&rm9200_mck_lock, CLK_SET_RATE_GATE, 0);
@@ -419,15 +419,14 @@ static void __init at91sam926x_pmc_setup(struct device_node *np,
parent_hws[2] = at91sam9260_pmc->chws[PMC_PLLACK];
parent_hws[3] = at91sam9260_pmc->chws[PMC_PLLBCK];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
- NULL, parent_hws,
+ parent_hws,
&at91rm9200_master_layout,
data->mck_characteristics,
&at91sam9260_mck_lock);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_master_div(regmap, "masterck_div",
- NULL, hw,
+ hw = at91_clk_register_master_div(regmap, "masterck_div", hw,
&at91rm9200_master_layout,
data->mck_characteristics,
&at91sam9260_mck_lock,
@@ -163,15 +163,14 @@ static void __init at91sam9g45_pmc_setup(struct device_node *np)
parent_hws[2] = at91sam9g45_pmc->chws[PMC_PLLACK];
parent_hws[3] = at91sam9g45_pmc->chws[PMC_UTMI];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
- NULL, parent_hws,
+ parent_hws,
&at91rm9200_master_layout,
&mck_characteristics,
&at91sam9g45_mck_lock);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_master_div(regmap, "masterck_div",
- NULL, hw,
+ hw = at91_clk_register_master_div(regmap, "masterck_div", hw,
&at91rm9200_master_layout,
&mck_characteristics,
&at91sam9g45_mck_lock,
@@ -190,15 +190,14 @@ static void __init at91sam9n12_pmc_setup(struct device_node *np)
parent_hws[2] = at91sam9n12_pmc->chws[PMC_PLLACK];
parent_hws[3] = at91sam9n12_pmc->chws[PMC_PLLBCK];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
- NULL, parent_hws,
+ parent_hws,
&at91sam9x5_master_layout,
&mck_characteristics,
&at91sam9n12_mck_lock);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_master_div(regmap, "masterck_div",
- NULL, hw,
+ hw = at91_clk_register_master_div(regmap, "masterck_div", hw,
&at91sam9x5_master_layout,
&mck_characteristics,
&at91sam9n12_mck_lock,
@@ -123,15 +123,14 @@ static void __init at91sam9rl_pmc_setup(struct device_node *np)
parent_hws[2] = at91sam9rl_pmc->chws[PMC_PLLACK];
parent_hws[3] = at91sam9rl_pmc->chws[PMC_UTMI];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
- NULL, parent_hws,
+ parent_hws,
&at91rm9200_master_layout,
&sam9rl_mck_characteristics,
&sam9rl_mck_lock);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_master_div(regmap, "masterck_div",
- NULL, hw,
+ hw = at91_clk_register_master_div(regmap, "masterck_div", hw,
&at91rm9200_master_layout,
&sam9rl_mck_characteristics,
&sam9rl_mck_lock, CLK_SET_RATE_GATE, 0);
@@ -211,13 +211,13 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
parent_hws[2] = at91sam9x5_pmc->chws[PMC_PLLACK];
parent_hws[3] = at91sam9x5_pmc->chws[PMC_UTMI];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
- NULL, parent_hws,
+ parent_hws,
&at91sam9x5_master_layout,
&mck_characteristics, &mck_lock);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw,
+ hw = at91_clk_register_master_div(regmap, "masterck_div", hw,
&at91sam9x5_master_layout,
&mck_characteristics, &mck_lock,
CLK_SET_RATE_GATE, 0);
@@ -472,7 +472,6 @@ static const struct clk_ops master_pres_ops = {
static struct clk_hw * __init
at91_clk_register_master_internal(struct regmap *regmap,
const char *name, int num_parents,
- const char **parent_names,
struct clk_hw **parent_hws,
const struct clk_master_layout *layout,
const struct clk_master_characteristics *characteristics,
@@ -485,7 +484,7 @@ at91_clk_register_master_internal(struct regmap *regmap,
unsigned long irqflags;
int ret;
- if (!name || !num_parents || !(parent_names || parent_hws) || !lock)
+ if (!name || !num_parents || !parent_hws || !lock)
return ERR_PTR(-EINVAL);
master = kzalloc(sizeof(*master), GFP_KERNEL);
@@ -494,10 +493,7 @@ at91_clk_register_master_internal(struct regmap *regmap,
init.name = name;
init.ops = ops;
- if (parent_hws)
- init.parent_hws = (const struct clk_hw **)parent_hws;
- else
- init.parent_names = parent_names;
+ init.parent_hws = (const struct clk_hw **)parent_hws;
init.num_parents = num_parents;
init.flags = flags;
@@ -530,22 +526,20 @@ at91_clk_register_master_internal(struct regmap *regmap,
struct clk_hw * __init
at91_clk_register_master_pres(struct regmap *regmap,
const char *name, int num_parents,
- const char **parent_names,
struct clk_hw **parent_hws,
const struct clk_master_layout *layout,
const struct clk_master_characteristics *characteristics,
spinlock_t *lock)
{
return at91_clk_register_master_internal(regmap, name, num_parents,
- parent_names, parent_hws, layout,
+ parent_hws, layout,
characteristics,
&master_pres_ops,
lock, CLK_SET_RATE_GATE);
}
struct clk_hw * __init
-at91_clk_register_master_div(struct regmap *regmap,
- const char *name, const char *parent_name,
+at91_clk_register_master_div(struct regmap *regmap, const char *name,
struct clk_hw *parent_hw, const struct clk_master_layout *layout,
const struct clk_master_characteristics *characteristics,
spinlock_t *lock, u32 flags, u32 safe_div)
@@ -559,7 +553,6 @@ at91_clk_register_master_div(struct regmap *regmap,
ops = &master_div_ops_chg;
hw = at91_clk_register_master_internal(regmap, name, 1,
- parent_name ? &parent_name : NULL,
parent_hw ? &parent_hw : NULL, layout,
characteristics, ops,
lock, flags);
@@ -811,7 +804,6 @@ static const struct clk_ops sama7g5_master_ops = {
struct clk_hw * __init
at91_clk_sama7g5_register_master(struct regmap *regmap,
const char *name, int num_parents,
- const char **parent_names,
struct clk_hw **parent_hws,
u32 *mux_table,
spinlock_t *lock, u8 id,
@@ -824,7 +816,7 @@ at91_clk_sama7g5_register_master(struct regmap *regmap,
unsigned int val;
int ret;
- if (!name || !num_parents || !(parent_names || parent_hws) || !mux_table ||
+ if (!name || !num_parents || !parent_hws || !mux_table ||
!lock || id > MASTER_MAX_ID)
return ERR_PTR(-EINVAL);
@@ -834,10 +826,7 @@ at91_clk_sama7g5_register_master(struct regmap *regmap,
init.name = name;
init.ops = &sama7g5_master_ops;
- if (parent_hws)
- init.parent_hws = (const struct clk_hw **)parent_hws;
- else
- init.parent_names = parent_names;
+ init.parent_hws = (const struct clk_hw **)parent_hws;
init.num_parents = num_parents;
init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE;
if (chg_pid >= 0)
@@ -487,12 +487,12 @@ of_at91_clk_master_setup(struct device_node *np,
return;
hw = at91_clk_register_master_pres(regmap, "masterck_pres", num_parents,
- NULL, parent_hws, layout,
+ parent_hws, layout,
characteristics, &mck_lock);
if (IS_ERR(hw))
goto out_free_characteristics;
- hw = at91_clk_register_master_div(regmap, name, NULL, hw,
+ hw = at91_clk_register_master_div(regmap, name, hw,
layout, characteristics,
&mck_lock, CLK_SET_RATE_GATE, 0);
if (IS_ERR(hw))
@@ -171,15 +171,14 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, const char *name,
struct clk_hw * __init
at91_clk_register_master_pres(struct regmap *regmap, const char *name,
- int num_parents, const char **parent_names,
- struct clk_hw **parent_hws,
+ int num_parents, struct clk_hw **parent_hws,
const struct clk_master_layout *layout,
const struct clk_master_characteristics *characteristics,
spinlock_t *lock);
struct clk_hw * __init
at91_clk_register_master_div(struct regmap *regmap, const char *name,
- const char *parent_names, struct clk_hw *parent_hw,
+ struct clk_hw *parent_hw,
const struct clk_master_layout *layout,
const struct clk_master_characteristics *characteristics,
spinlock_t *lock, u32 flags, u32 safe_div);
@@ -187,7 +186,6 @@ at91_clk_register_master_div(struct regmap *regmap, const char *name,
struct clk_hw * __init
at91_clk_sama7g5_register_master(struct regmap *regmap,
const char *name, int num_parents,
- const char **parent_names,
struct clk_hw **parent_hws, u32 *mux_table,
spinlock_t *lock, u8 id, bool critical,
int chg_pid);
@@ -285,13 +285,13 @@ static void __init sam9x60_pmc_setup(struct device_node *np)
parent_hws[1] = sam9x60_pmc->chws[PMC_MAIN];
parent_hws[2] = sam9x60_pmc->chws[PMC_PLLACK];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 3,
- NULL, parent_hws, &sam9x60_master_layout,
+ parent_hws, &sam9x60_master_layout,
&mck_characteristics, &mck_lock);
if (IS_ERR(hw))
goto err_free;
hw = at91_clk_register_master_div(regmap, "masterck_div",
- NULL, hw, &sam9x60_master_layout,
+ hw, &sam9x60_master_layout,
&mck_characteristics, &mck_lock,
CLK_SET_RATE_GATE, 0);
if (IS_ERR(hw))
@@ -265,13 +265,13 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
parent_hws[2] = sama5d2_pmc->chws[PMC_PLLACK];
parent_hws[3] = sama5d2_pmc->chws[PMC_UTMI];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
- NULL, parent_hws,
+ parent_hws,
&at91sam9x5_master_layout,
&mck_characteristics, &mck_lock);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw,
+ hw = at91_clk_register_master_div(regmap, "masterck_div", hw,
&at91sam9x5_master_layout,
&mck_characteristics, &mck_lock,
CLK_SET_RATE_GATE, 0);
@@ -190,14 +190,13 @@ static void __init sama5d3_pmc_setup(struct device_node *np)
parent_hws[2] = sama5d3_pmc->chws[PMC_PLLACK];
parent_hws[3] = sama5d3_pmc->chws[PMC_UTMI];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
- NULL, parent_hws,
+ parent_hws,
&at91sam9x5_master_layout,
&mck_characteristics, &mck_lock);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_master_div(regmap, "masterck_div",
- NULL, hw,
+ hw = at91_clk_register_master_div(regmap, "masterck_div", hw,
&at91sam9x5_master_layout,
&mck_characteristics, &mck_lock,
CLK_SET_RATE_GATE, 0);
@@ -205,13 +205,13 @@ static void __init sama5d4_pmc_setup(struct device_node *np)
parent_hws[2] = sama5d4_pmc->chws[PMC_PLLACK];
parent_hws[3] = sama5d4_pmc->chws[PMC_UTMI];
hw = at91_clk_register_master_pres(regmap, "masterck_pres", 4,
- NULL, parent_hws,
+ parent_hws,
&at91sam9x5_master_layout,
&mck_characteristics, &mck_lock);
if (IS_ERR(hw))
goto err_free;
- hw = at91_clk_register_master_div(regmap, "masterck_div", NULL, hw,
+ hw = at91_clk_register_master_div(regmap, "masterck_div", hw,
&at91sam9x5_master_layout,
&mck_characteristics, &mck_lock,
CLK_SET_RATE_GATE, 0);
@@ -1103,8 +1103,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
}
}
- hw = at91_clk_register_master_div(regmap, "mck0", NULL,
- sama7g5_plls[PLL_ID_CPU][1].hw,
+ hw = at91_clk_register_master_div(regmap, "mck0", sama7g5_plls[PLL_ID_CPU][1].hw,
&mck0_layout, &mck0_characteristics,
&pmc_mck0_lock, CLK_GET_RATE_NOCACHE, 5);
if (IS_ERR(hw))
@@ -1138,7 +1137,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
sama7g5_mckx[i].ep_count);
hw = at91_clk_sama7g5_register_master(regmap, sama7g5_mckx[i].n,
- num_parents, NULL, parent_hws, mux_table,
+ num_parents, parent_hws, mux_table,
&pmc_mckX_lock, sama7g5_mckx[i].id,
sama7g5_mckx[i].c,
sama7g5_mckx[i].ep_chg_id);
Remove parent_names support as parent_hw support is now available on all platforms using clk-master driver. Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> --- drivers/clk/at91/at91rm9200.c | 4 ++-- drivers/clk/at91/at91sam9260.c | 5 ++--- drivers/clk/at91/at91sam9g45.c | 5 ++--- drivers/clk/at91/at91sam9n12.c | 5 ++--- drivers/clk/at91/at91sam9rl.c | 5 ++--- drivers/clk/at91/at91sam9x5.c | 4 ++-- drivers/clk/at91/clk-master.c | 23 ++++++----------------- drivers/clk/at91/dt-compat.c | 4 ++-- drivers/clk/at91/pmc.h | 6 ++---- drivers/clk/at91/sam9x60.c | 4 ++-- drivers/clk/at91/sama5d2.c | 4 ++-- drivers/clk/at91/sama5d3.c | 5 ++--- drivers/clk/at91/sama5d4.c | 4 ++-- drivers/clk/at91/sama7g5.c | 5 ++--- 14 files changed, 32 insertions(+), 51 deletions(-)