Commit 3d37ca14 authored by Thierry Bultel's avatar Thierry Bultel Committed by Geert Uytterhoeven
Browse files

clk: renesas: Pass sub struct of cpg_mssr_priv to cpg_clk_register



In a subsequent patch, the registration callback will need more parameters
from cpg_mssr_priv (like another base address with clock controllers
with double register block, and also, notifiers and rmw_lock).
Instead of adding more parameters, move the needed parameters to a public
sub-struct.
Instead moving clks to this structure, which would have implied to add
an allocation (and cleanup) for it, keep the way the allocation is done
and just have a copy of the pointer in the public structure.

Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarThierry Bultel <thierry.bultel.yh@bp.renesas.com>
Link: https://lore.kernel.org/20250515141828.43444-5-thierry.bultel.yh@bp.renesas.com


Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent a68ea80f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -159,12 +159,13 @@ static void __init r7s9210_update_clk_table(struct clk *extal_clk,

static struct clk * __init rza2_cpg_clk_register(struct device *dev,
	const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
	struct clk **clks, void __iomem *base,
	struct raw_notifier_head *notifiers)
	struct cpg_mssr_pub *pub)
{
	struct clk *parent;
	void __iomem *base = pub->base0;
	struct clk **clks = pub->clks;
	unsigned int mult = 1;
	unsigned int div = 1;
	struct clk *parent;

	parent = clks[core->parent];
	if (IS_ERR(parent))
+4 −4
Original line number Diff line number Diff line
@@ -219,10 +219,11 @@ static int __init r8a77970_cpg_mssr_init(struct device *dev)

static struct clk * __init r8a77970_cpg_clk_register(struct device *dev,
	const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
	struct clk **clks, void __iomem *base,
	struct raw_notifier_head *notifiers)
	struct cpg_mssr_pub *pub)
{
	const struct clk_div_table *table;
	void __iomem *base = pub->base0;
	struct clk **clks = pub->clks;
	const struct clk *parent;
	unsigned int shift;

@@ -236,8 +237,7 @@ static struct clk * __init r8a77970_cpg_clk_register(struct device *dev,
		shift = 4;
		break;
	default:
		return rcar_gen3_cpg_clk_register(dev, core, info, clks, base,
						  notifiers);
		return rcar_gen3_cpg_clk_register(dev, core, info, pub);
	}

	parent = clks[core->parent];
+3 −2
Original line number Diff line number Diff line
@@ -274,10 +274,11 @@ static const struct soc_device_attribute cpg_quirks_match[] __initconst = {

struct clk * __init rcar_gen2_cpg_clk_register(struct device *dev,
	const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
	struct clk **clks, void __iomem *base,
	struct raw_notifier_head *notifiers)
	struct cpg_mssr_pub *pub)
{
	const struct clk_div_table *table = NULL;
	void __iomem *base = pub->base0;
	struct clk **clks = pub->clks;
	const struct clk *parent;
	const char *parent_name;
	unsigned int mult = 1;
+1 −2
Original line number Diff line number Diff line
@@ -32,8 +32,7 @@ struct rcar_gen2_cpg_pll_config {

struct clk *rcar_gen2_cpg_clk_register(struct device *dev,
	const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
	struct clk **clks, void __iomem *base,
	struct raw_notifier_head *notifiers);
	struct cpg_mssr_pub *pub);
int rcar_gen2_cpg_init(const struct rcar_gen2_cpg_pll_config *config,
		       unsigned int pll0_div, u32 mode);

+4 −2
Original line number Diff line number Diff line
@@ -345,9 +345,11 @@ static const struct soc_device_attribute cpg_quirks_match[] __initconst = {

struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,
	const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
	struct clk **clks, void __iomem *base,
	struct raw_notifier_head *notifiers)
	struct cpg_mssr_pub *pub)
{
	struct raw_notifier_head *notifiers = &pub->notifiers;
	void __iomem *base = pub->base0;
	struct clk **clks = pub->clks;
	const struct clk *parent;
	unsigned int mult = 1;
	unsigned int div = 1;
Loading