diff options
Diffstat (limited to 'arch/arm/mach-s3c2410')
-rw-r--r-- | arch/arm/mach-s3c2410/clock.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/clock.h | 2 |
2 files changed, 15 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) | |||
180 | 180 | ||
181 | long clk_round_rate(struct clk *clk, unsigned long rate) | 181 | long clk_round_rate(struct clk *clk, unsigned long rate) |
182 | { | 182 | { |
183 | if (!IS_ERR(clk) && clk->round_rate) | ||
184 | return (clk->round_rate)(clk, rate); | ||
185 | |||
183 | return rate; | 186 | return rate; |
184 | } | 187 | } |
185 | 188 | ||
186 | int clk_set_rate(struct clk *clk, unsigned long rate) | 189 | int clk_set_rate(struct clk *clk, unsigned long rate) |
187 | { | 190 | { |
188 | return -EINVAL; | 191 | int ret; |
192 | |||
193 | if (IS_ERR(clk)) | ||
194 | return -EINVAL; | ||
195 | |||
196 | mutex_lock(&clocks_mutex); | ||
197 | ret = (clk->set_rate)(clk, rate); | ||
198 | mutex_unlock(&clocks_mutex); | ||
199 | |||
200 | return ret; | ||
189 | } | 201 | } |
190 | 202 | ||
191 | struct clk *clk_get_parent(struct clk *clk) | 203 | struct clk *clk_get_parent(struct clk *clk) |
diff --git a/arch/arm/mach-s3c2410/clock.h b/arch/arm/mach-s3c2410/clock.h index c4f36f006496..32864b30c1e0 100644 --- a/arch/arm/mach-s3c2410/clock.h +++ b/arch/arm/mach-s3c2410/clock.h | |||
@@ -21,6 +21,8 @@ struct clk { | |||
21 | unsigned long ctrlbit; | 21 | unsigned long ctrlbit; |
22 | 22 | ||
23 | int (*enable)(struct clk *, int enable); | 23 | int (*enable)(struct clk *, int enable); |
24 | int (*set_rate)(struct clk *c, unsigned long rate); | ||
25 | unsigned long (*round_rate)(struct clk *c, unsigned long rate); | ||
24 | int (*set_parent)(struct clk *c, struct clk *parent); | 26 | int (*set_parent)(struct clk *c, struct clk *parent); |
25 | }; | 27 | }; |
26 | 28 | ||