@@ -50,7 +50,7 @@ static const struct clk_ops clk_i2s_mux_ops = {
struct clk_hw * __init
at91_clk_i2s_mux_register(struct regmap *regmap, const char *name,
- const char * const *parent_names,
+ const char * const *parent_names, struct clk_hw **parent_hws,
unsigned int num_parents, u8 bus_id)
{
struct clk_init_data init = {};
@@ -63,7 +63,10 @@ at91_clk_i2s_mux_register(struct regmap *regmap, const char *name,
init.name = name;
init.ops = &clk_i2s_mux_ops;
- init.parent_names = parent_names;
+ if (parent_hws)
+ init.parent_hws = (const struct clk_hw **)parent_hws;
+ else
+ init.parent_names = parent_names;
init.num_parents = num_parents;
i2s_ck->hw.init = &init;
@@ -239,7 +239,7 @@ static void __init of_sama5d2_clk_i2s_mux_setup(struct device_node *np)
continue;
hw = at91_clk_i2s_mux_register(regmap_sfr, i2s_mux_np->name,
- parent_names, 2, bus_id);
+ parent_names, NULL, 2, bus_id);
if (IS_ERR(hw))
continue;
@@ -154,7 +154,7 @@ at91_clk_register_h32mx(struct regmap *regmap, const char *name,
struct clk_hw * __init
at91_clk_i2s_mux_register(struct regmap *regmap, const char *name,
- const char * const *parent_names,
+ const char * const *parent_names, struct clk_hw **parent_hws,
unsigned int num_parents, u8 bus_id);
struct clk_hw * __init
@@ -372,7 +372,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
parent_names[0] = "i2s0_clk";
parent_names[1] = "i2s0_gclk";
hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s0_muxclk",
- parent_names, 2, 0);
+ parent_names, NULL, 2, 0);
if (IS_ERR(hw))
goto err_free;
@@ -381,7 +381,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)
parent_names[0] = "i2s1_clk";
parent_names[1] = "i2s1_gclk";
hw = at91_clk_i2s_mux_register(regmap_sfr, "i2s1_muxclk",
- parent_names, 2, 1);
+ parent_names, NULL, 2, 1);
if (IS_ERR(hw))
goto err_free;
Add support for parent_hw in i2s mux clock driver. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-i2s-mux were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> --- drivers/clk/at91/clk-i2s-mux.c | 7 +++++-- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d2.c | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-)