aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-s3c2410
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c2410')
-rw-r--r--arch/arm/mach-s3c2410/clock.c18
-rw-r--r--arch/arm/mach-s3c2410/clock.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c
index aaada9e3d67..773b7aec3e9 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)
return clk->parent;
}
+int clk_set_parent(struct clk *clk, struct clk *parent)
+{
+ int ret = 0;
+
+ if (IS_ERR(clk))
+ return -EINVAL;
+
+ mutex_lock(&clocks_mutex);
+
+ if (clk->set_parent)
+ ret = (clk->set_parent)(clk, parent);
+
+ mutex_unlock(&clocks_mutex);
+
+ return ret;
+}
+
EXPORT_SYMBOL(clk_get);
EXPORT_SYMBOL(clk_put);
EXPORT_SYMBOL(clk_enable);
@@ -200,6 +217,7 @@ EXPORT_SYMBOL(clk_get_rate);
EXPORT_SYMBOL(clk_round_rate);
EXPORT_SYMBOL(clk_set_rate);
EXPORT_SYMBOL(clk_get_parent);
+EXPORT_SYMBOL(clk_set_parent);
/* base clock enable */
diff --git a/arch/arm/mach-s3c2410/clock.h b/arch/arm/mach-s3c2410/clock.h
index eb5c95d1e7f..c4f36f00649 100644
--- a/arch/arm/mach-s3c2410/clock.h
+++ b/arch/arm/mach-s3c2410/clock.h
@@ -19,7 +19,9 @@ struct clk {
int usage;
unsigned long rate;
unsigned long ctrlbit;
+
int (*enable)(struct clk *, int enable);
+ int (*set_parent)(struct clk *c, struct clk *parent);
};
/* other clocks which may be registered by board support */