diff options
author | Naveen Krishna Chatradhi <ch.naveen@samsung.com> | 2011-07-18 07:44:19 +0200 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-07-20 19:10:04 +0200 |
commit | 65f5eaa27a0c18ab79489b2fcbaf28d97c45101a (patch) | |
tree | 60da2ca55bd8fa21e3dbf7e845a21a3dc8ff70e8 /arch/arm/plat-s5p/clock.c | |
parent | ARM: SAMSUNG: Cleanup I2C code in plat-samsung (diff) | |
download | linux-65f5eaa27a0c18ab79489b2fcbaf28d97c45101a.tar.xz linux-65f5eaa27a0c18ab79489b2fcbaf28d97c45101a.zip |
ARM: SAMSUNG: Move duplicate code for SPDIF ops
Move the duplicated code for SPDIF ops from S5PV210 and S5PC100.
So, the same can be used in EXYNOS4.
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-s5p/clock.c')
-rw-r--r-- | arch/arm/plat-s5p/clock.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c index 8d081d968c58..02af235298e2 100644 --- a/arch/arm/plat-s5p/clock.c +++ b/arch/arm/plat-s5p/clock.c @@ -168,6 +168,41 @@ unsigned long s5p_epll_get_rate(struct clk *clk) return clk->rate; } +int s5p_spdif_set_rate(struct clk *clk, unsigned long rate) +{ + struct clk *pclk; + int ret; + + pclk = clk_get_parent(clk); + if (IS_ERR(pclk)) + return -EINVAL; + + ret = pclk->ops->set_rate(pclk, rate); + clk_put(pclk); + + return ret; +} + +unsigned long s5p_spdif_get_rate(struct clk *clk) +{ + struct clk *pclk; + int rate; + + pclk = clk_get_parent(clk); + if (IS_ERR(pclk)) + return -EINVAL; + + rate = pclk->ops->get_rate(clk); + clk_put(pclk); + + return rate; +} + +struct clk_ops s5p_sclk_spdif_ops = { + .set_rate = s5p_spdif_set_rate, + .get_rate = s5p_spdif_get_rate, +}; + static struct clk *s5p_clks[] __initdata = { &clk_ext_xtal_mux, &clk_48m, |