clk: rockchip: expose rockchip_clk_set_lookup
Move rockchip_clk_add_lookup to clk.h, so that it can be used by sub-devices with their own driver. These might also have to do a lookup, so rename the function to rockchip_clk_set_lookup and add a matching rockchip_clk_get_lookup. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20241211165957.94922-4-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner <heiko@sntech.de>pull/1131/head
parent
33af96244a
commit
fe0fb6675f
|
|
@ -197,12 +197,6 @@ static void rockchip_fractional_approximation(struct clk_hw *hw,
|
|||
clk_fractional_divider_general_approximation(hw, rate, parent_rate, m, n);
|
||||
}
|
||||
|
||||
static void rockchip_clk_add_lookup(struct rockchip_clk_provider *ctx,
|
||||
struct clk *clk, unsigned int id)
|
||||
{
|
||||
ctx->clk_data.clks[id] = clk;
|
||||
}
|
||||
|
||||
static struct clk *rockchip_clk_register_frac_branch(
|
||||
struct rockchip_clk_provider *ctx, const char *name,
|
||||
const char *const *parent_names, u8 num_parents,
|
||||
|
|
@ -292,7 +286,7 @@ static struct clk *rockchip_clk_register_frac_branch(
|
|||
return mux_clk;
|
||||
}
|
||||
|
||||
rockchip_clk_add_lookup(ctx, mux_clk, child->id);
|
||||
rockchip_clk_set_lookup(ctx, mux_clk, child->id);
|
||||
|
||||
/* notifier on the fraction divider to catch rate changes */
|
||||
if (frac->mux_frac_idx >= 0) {
|
||||
|
|
@ -452,7 +446,7 @@ void rockchip_clk_register_plls(struct rockchip_clk_provider *ctx,
|
|||
continue;
|
||||
}
|
||||
|
||||
rockchip_clk_add_lookup(ctx, clk, list->id);
|
||||
rockchip_clk_set_lookup(ctx, clk, list->id);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rockchip_clk_register_plls);
|
||||
|
|
@ -614,7 +608,7 @@ void rockchip_clk_register_branches(struct rockchip_clk_provider *ctx,
|
|||
continue;
|
||||
}
|
||||
|
||||
rockchip_clk_add_lookup(ctx, clk, list->id);
|
||||
rockchip_clk_set_lookup(ctx, clk, list->id);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rockchip_clk_register_branches);
|
||||
|
|
@ -638,7 +632,7 @@ void rockchip_clk_register_armclk(struct rockchip_clk_provider *ctx,
|
|||
return;
|
||||
}
|
||||
|
||||
rockchip_clk_add_lookup(ctx, clk, lookup_id);
|
||||
rockchip_clk_set_lookup(ctx, clk, lookup_id);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rockchip_clk_register_armclk);
|
||||
|
||||
|
|
|
|||
|
|
@ -1022,6 +1022,18 @@ struct rockchip_clk_branch {
|
|||
#define SGRF_GATE(_id, cname, pname) \
|
||||
FACTOR(_id, cname, pname, 0, 1, 1)
|
||||
|
||||
static inline struct clk *rockchip_clk_get_lookup(struct rockchip_clk_provider *ctx,
|
||||
unsigned int id)
|
||||
{
|
||||
return ctx->clk_data.clks[id];
|
||||
}
|
||||
|
||||
static inline void rockchip_clk_set_lookup(struct rockchip_clk_provider *ctx,
|
||||
struct clk *clk, unsigned int id)
|
||||
{
|
||||
ctx->clk_data.clks[id] = clk;
|
||||
}
|
||||
|
||||
struct rockchip_clk_provider *rockchip_clk_init(struct device_node *np,
|
||||
void __iomem *base, unsigned long nr_clks);
|
||||
struct rockchip_clk_provider *rockchip_clk_init_early(struct device_node *np,
|
||||
|
|
|
|||
Loading…
Reference in New Issue