diff options
author | Ben Dooks <ben-linux@fluff.org> | 2006-03-21 00:00:08 +0300 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-03-22 01:06:18 +0300 |
commit | 6e8908edd5a140f4f0cc4338fa0420b0bb0f8efa (patch) | |
tree | f428e1725b3ee7fd295077b90d3fd491c2c61b30 /arch/arm/mach-s3c2410/clock.c | |
parent | d2a02b93cf78205dd23226efb66481569900976e (diff) | |
download | linux-6e8908edd5a140f4f0cc4338fa0420b0bb0f8efa.tar.xz |
[ARM] 3359/1: S3C24XX - add support for clk_set_rate
Patch from Ben Dooks
Add support for clk_set_rate and clk_round_rate to the
s3c2410 clock implementation
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s3c2410/clock.c')
-rw-r--r-- | arch/arm/mach-s3c2410/clock.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c index e205a6316b08..95c6d46c3dd6 100644 --- a/arch/arm/mach-s3c2410/clock.c +++ b/arch/arm/mach-s3c2410/clock.c @@ -180,12 +180,24 @@ unsigned long clk_get_rate(struct clk *clk) long clk_round_rate(struct clk *clk, unsigned long rate) { + if (!IS_ERR(clk) && clk->round_rate) + return (clk->round_rate)(clk, rate); + return rate; } int clk_set_rate(struct clk *clk, unsigned long rate) { - return -EINVAL; + int ret; + + if (IS_ERR(clk)) + return -EINVAL; + + mutex_lock(&clocks_mutex); + ret = (clk->set_rate)(clk, rate); + mutex_unlock(&clocks_mutex); + + return ret; } struct clk *clk_get_parent(struct clk *clk) |