Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a02cb230 authored by Paul Mundt's avatar Paul Mundt
Browse files

sh: clkfwk: Add a followparent_recalc() helper.



This adds a followparent_recalc() helper for clocks that just follow the
parent's rate. Switch over the few CPUs that use this scheme for some of
their clocks.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent b68d8201
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ int __init arch_clk_init(void);

/* arch/sh/kernel/cpu/clock.c */
int clk_init(void);

unsigned long followparent_recalc(struct clk *clk);
void clk_recalc_rate(struct clk *);

int clk_register(struct clk *);
+6 −0
Original line number Diff line number Diff line
@@ -90,6 +90,12 @@ static void propagate_rate(struct clk *clk)
	}
}

/* Used for clocks that always have same value as the parent clock */
unsigned long followparent_recalc(struct clk *clk)
{
	return clk->parent->rate;
}

static void __clk_init(struct clk *clk)
{
	/*
+1 −6
Original line number Diff line number Diff line
@@ -57,13 +57,8 @@ static struct clk_ops sh7619_bus_clk_ops = {
	.recalc		= bus_clk_recalc,
};

static unsigned long cpu_clk_recalc(struct clk *clk)
{
	return clk->parent->rate;
}

static struct clk_ops sh7619_cpu_clk_ops = {
	.recalc		= cpu_clk_recalc,
	.recalc		= followparent_recalc,
};

static struct clk_ops *sh7619_clk_ops[] = {
+1 −6
Original line number Diff line number Diff line
@@ -66,13 +66,8 @@ static struct clk_ops sh7203_bus_clk_ops = {
	.recalc		= bus_clk_recalc,
};

static unsigned long cpu_clk_recalc(struct clk *clk)
{
	return clk->parent->rate;
}

static struct clk_ops sh7203_cpu_clk_ops = {
	.recalc		= cpu_clk_recalc,
	.recalc		= followparent_recalc,
};

static struct clk_ops *sh7203_clk_ops[] = {
+1 −6
Original line number Diff line number Diff line
@@ -646,15 +646,10 @@ static void sh7722_mstpcr_disable(struct clk *clk)
	sh7722_mstpcr_start_stop(clk, 0);
}

static unsigned long sh7722_mstpcr_recalc(struct clk *clk)
{
	return clk->parent->rate;
}

static struct clk_ops sh7722_mstpcr_clk_ops = {
	.enable = sh7722_mstpcr_enable,
	.disable = sh7722_mstpcr_disable,
	.recalc = sh7722_mstpcr_recalc,
	.recalc = followparent_recalc,
};

#define MSTPCR(_name, _parent, regnr, bitnr) \
Loading