aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210/clock.c
diff options
context:
space:
mode:
authorSeungwhan Youn <sw.youn@samsung.com>2010-10-13 21:35:24 -0400
committerKukjin Kim <kgene.kim@samsung.com>2010-10-25 03:05:40 -0400
commitaa21ae3d87ce355f68c0b1cbc7a45ee03d423232 (patch)
tree6030f24fd882fa29d9175f30357b70294cb983d7 /arch/arm/mach-s5pv210/clock.c
parent494edadd6290f6e5d36985e9d04a84ec92d2cea1 (diff)
ARM: S5PV210: Add SCLK_SPDIF clock
This patch add SCLK_SPDIF clock to support source clock of S/PDIF on S5PV210. Signed-off-by: Seungwhan Youn <sw.youn@samsung.com> Acked-by: Jassi Brar <jassi.brar@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pv210/clock.c')
-rw-r--r--arch/arm/mach-s5pv210/clock.c62
1 files changed, 53 insertions, 9 deletions
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index 1b0112006513..106993ef6d97 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -472,6 +472,12 @@ static struct clk init_clocks_disable[] = {
472 .parent = &clk_p, 472 .parent = &clk_p,
473 .enable = s5pv210_clk_ip3_ctrl, 473 .enable = s5pv210_clk_ip3_ctrl,
474 .ctrlbit = (1 << 6), 474 .ctrlbit = (1 << 6),
475 }, {
476 .name = "spdif",
477 .id = -1,
478 .parent = &clk_p,
479 .enable = s5pv210_clk_ip3_ctrl,
480 .ctrlbit = (1 << 0),
475 }, 481 },
476}; 482};
477 483
@@ -701,6 +707,53 @@ static struct clksrc_sources clkset_sclk_spdif = {
701 .nr_sources = ARRAY_SIZE(clkset_sclk_spdif_list), 707 .nr_sources = ARRAY_SIZE(clkset_sclk_spdif_list),
702}; 708};
703 709
710static int s5pv210_spdif_set_rate(struct clk *clk, unsigned long rate)
711{
712 struct clk *pclk;
713 int ret;
714
715 pclk = clk_get_parent(clk);
716 if (IS_ERR(pclk))
717 return -EINVAL;
718
719 ret = pclk->ops->set_rate(pclk, rate);
720 clk_put(pclk);
721
722 return ret;
723}
724
725static unsigned long s5pv210_spdif_get_rate(struct clk *clk)
726{
727 struct clk *pclk;
728 int rate;
729
730 pclk = clk_get_parent(clk);
731 if (IS_ERR(pclk))
732 return -EINVAL;
733
734 rate = pclk->ops->get_rate(clk);
735 clk_put(pclk);
736
737 return rate;
738}
739
740static struct clk_ops s5pv210_sclk_spdif_ops = {
741 .set_rate = s5pv210_spdif_set_rate,
742 .get_rate = s5pv210_spdif_get_rate,
743};
744
745static struct clksrc_clk clk_sclk_spdif = {
746 .clk = {
747 .name = "sclk_spdif",
748 .id = -1,
749 .enable = s5pv210_clk_mask0_ctrl,
750 .ctrlbit = (1 << 27),
751 .ops = &s5pv210_sclk_spdif_ops,
752 },
753 .sources = &clkset_sclk_spdif,
754 .reg_src = { .reg = S5P_CLK_SRC6, .shift = 12, .size = 2 },
755};
756
704static struct clk *clkset_group2_list[] = { 757static struct clk *clkset_group2_list[] = {
705 [0] = &clk_ext_xtal_mux, 758 [0] = &clk_ext_xtal_mux,
706 [1] = &clk_xusbxti, 759 [1] = &clk_xusbxti,
@@ -785,15 +838,6 @@ static struct clksrc_clk clksrcs[] = {
785 .sources = &clkset_sclk_mixer, 838 .sources = &clkset_sclk_mixer,
786 .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 1 }, 839 .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 1 },
787 }, { 840 }, {
788 .clk = {
789 .name = "sclk_spdif",
790 .id = -1,
791 .enable = s5pv210_clk_mask0_ctrl,
792 .ctrlbit = (1 << 27),
793 },
794 .sources = &clkset_sclk_spdif,
795 .reg_src = { .reg = S5P_CLK_SRC6, .shift = 12, .size = 2 },
796 }, {
797 .clk = { 841 .clk = {
798 .name = "sclk_fimc", 842 .name = "sclk_fimc",
799 .id = 0, 843 .id = 0,