From 92b7eb8ffc0741f1fd5fbd5458a466d608310442 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 22 Jun 2006 22:18:21 +0100 Subject: [ARM] 3628/1: S3C24XX: add get_rate call to struct clk Patch from Ben Dooks Add a get_rate call to allow an given clock to over-ride the clk_get_rate() call. This provides support for clocks which rely on division of their parent to correctly report their frequency when the parent can also change. Signed-off-by: Ben Dooks Signed-off-by: Russell King --- arch/arm/mach-s3c2410/clock.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-s3c2410/clock.c') diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c index f553e5ee7477..c5c93c333ac6 100644 --- a/arch/arm/mach-s3c2410/clock.c +++ b/arch/arm/mach-s3c2410/clock.c @@ -148,8 +148,11 @@ unsigned long clk_get_rate(struct clk *clk) if (clk->rate != 0) return clk->rate; - while (clk->parent != NULL && clk->rate == 0) - clk = clk->parent; + if (clk->get_rate != NULL) + return (clk->get_rate)(clk); + + if (clk->parent != NULL) + return clk_get_rate(clk->parent); return clk->rate; } -- cgit v1.2.2