diff options
author | Ben Dooks <ben-linux@fluff.org> | 2006-03-20 12:10:04 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-03-21 17:06:03 -0500 |
commit | d3468daab82d5195fe85322235896797d5581720 (patch) | |
tree | f4980daea0e4654a3e72cbfa61c82294036588f5 /arch/arm/mach-s3c2410 | |
parent | 8e40a2f91c6e73726a75381e4438478eb5964cb7 (diff) |
[ARM] 3331/1: S3C24XX - add clk_set_parent() to clock code
Patch from Ben Dooks
Add clk_set_parent() call to clock code
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')
-rw-r--r-- | arch/arm/mach-s3c2410/clock.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/clock.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c index aaada9e3d67f..773b7aec3e99 100644 --- a/arch/arm/mach-s3c2410/clock.c +++ b/arch/arm/mach-s3c2410/clock.c | |||
@@ -192,6 +192,23 @@ struct clk *clk_get_parent(struct clk *clk) | |||
192 | return clk->parent; | 192 | return clk->parent; |
193 | } | 193 | } |
194 | 194 | ||
195 | int clk_set_parent(struct clk *clk, struct clk *parent) | ||
196 | { | ||
197 | int ret = 0; | ||
198 | |||
199 | if (IS_ERR(clk)) | ||
200 | return -EINVAL; | ||
201 | |||
202 | mutex_lock(&clocks_mutex); | ||
203 | |||
204 | if (clk->set_parent) | ||
205 | ret = (clk->set_parent)(clk, parent); | ||
206 | |||
207 | mutex_unlock(&clocks_mutex); | ||
208 | |||
209 | return ret; | ||
210 | } | ||
211 | |||
195 | EXPORT_SYMBOL(clk_get); | 212 | EXPORT_SYMBOL(clk_get); |
196 | EXPORT_SYMBOL(clk_put); | 213 | EXPORT_SYMBOL(clk_put); |
197 | EXPORT_SYMBOL(clk_enable); | 214 | EXPORT_SYMBOL(clk_enable); |
@@ -200,6 +217,7 @@ EXPORT_SYMBOL(clk_get_rate); | |||
200 | EXPORT_SYMBOL(clk_round_rate); | 217 | EXPORT_SYMBOL(clk_round_rate); |
201 | EXPORT_SYMBOL(clk_set_rate); | 218 | EXPORT_SYMBOL(clk_set_rate); |
202 | EXPORT_SYMBOL(clk_get_parent); | 219 | EXPORT_SYMBOL(clk_get_parent); |
220 | EXPORT_SYMBOL(clk_set_parent); | ||
203 | 221 | ||
204 | /* base clock enable */ | 222 | /* base clock enable */ |
205 | 223 | ||
diff --git a/arch/arm/mach-s3c2410/clock.h b/arch/arm/mach-s3c2410/clock.h index eb5c95d1e7f2..c4f36f006496 100644 --- a/arch/arm/mach-s3c2410/clock.h +++ b/arch/arm/mach-s3c2410/clock.h | |||
@@ -19,7 +19,9 @@ struct clk { | |||
19 | int usage; | 19 | int usage; |
20 | unsigned long rate; | 20 | unsigned long rate; |
21 | unsigned long ctrlbit; | 21 | unsigned long ctrlbit; |
22 | |||
22 | int (*enable)(struct clk *, int enable); | 23 | int (*enable)(struct clk *, int enable); |
24 | int (*set_parent)(struct clk *c, struct clk *parent); | ||
23 | }; | 25 | }; |
24 | 26 | ||
25 | /* other clocks which may be registered by board support */ | 27 | /* other clocks which may be registered by board support */ |