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

Commit c2e0a8ac authored by Junjie Wu's avatar Junjie Wu
Browse files

clock-generic: Export some ext_clk functions for code reuse



Asking parent to provide rate can be useful beyond ext_clk types. Export
them to clock-generic header to enable more code reuse.

Change-Id: I8a20d1cdd3c15838218a355913a33109eeac7df5
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent f3796c0d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -491,7 +491,7 @@ struct clk_ops clk_ops_slave_div = {
 * function and set is as a parent to this external clock..
 */

static long ext_round_rate(struct clk *c, unsigned long rate)
long parent_round_rate(struct clk *c, unsigned long rate)
{
	return clk_round_rate(c->parent, rate);
}
@@ -501,7 +501,7 @@ static int ext_set_rate(struct clk *c, unsigned long rate)
	return clk_set_rate(c->parent, rate);
}

static unsigned long ext_get_rate(struct clk *c)
unsigned long parent_get_rate(struct clk *c)
{
	return clk_get_rate(c->parent);
}
@@ -520,9 +520,9 @@ static enum handoff ext_handoff(struct clk *c)

struct clk_ops clk_ops_ext = {
	.handoff = ext_handoff,
	.round_rate = ext_round_rate,
	.round_rate = parent_round_rate,
	.set_rate = ext_set_rate,
	.get_rate = ext_get_rate,
	.get_rate = parent_get_rate,
	.set_parent = ext_set_parent,
};

+2 −0
Original line number Diff line number Diff line
@@ -136,6 +136,8 @@ struct ext_clk {
	struct clk c;
};

long parent_round_rate(struct clk *c, unsigned long rate);
unsigned long parent_get_rate(struct clk *c);
extern struct clk_ops clk_ops_ext;

#define DEFINE_FIXED_DIV_CLK(clk_name, _div, _parent) \