aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPadmavathi Venna <padma.v@samsung.com>2012-12-19 12:49:29 -0500
committerKukjin Kim <kgene.kim@samsung.com>2012-12-19 12:49:29 -0500
commiteaff82ed0f18022d089dbb157df49c0d79379168 (patch)
tree7df742af3d5bd0890205366f8edb6d3a5a69b392
parentdb7af96ee96d1c2f208611022740f9469158d3a8 (diff)
ARM: S5PC100: Add I2S clkdev support
I2S controller has an internal mux for RCLK source clk. The list of source clk names were passed through platform data in non-dt case. Register the existing RCLK source clocks with clkdev using generic connection id. This is required as part of adding DT support for I2S controller driver. Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r--arch/arm/mach-s5pc100/clock.c48
-rw-r--r--arch/arm/mach-s5pc100/dev-audio.c16
2 files changed, 30 insertions, 34 deletions
diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c
index 926219791f0..a206dc35eff 100644
--- a/arch/arm/mach-s5pc100/clock.c
+++ b/arch/arm/mach-s5pc100/clock.c
@@ -606,24 +606,6 @@ static struct clk init_clocks_off[] = {
606 .enable = s5pc100_d1_4_ctrl, 606 .enable = s5pc100_d1_4_ctrl,
607 .ctrlbit = (1 << 13), 607 .ctrlbit = (1 << 13),
608 }, { 608 }, {
609 .name = "iis",
610 .devname = "samsung-i2s.0",
611 .parent = &clk_div_pclkd1.clk,
612 .enable = s5pc100_d1_5_ctrl,
613 .ctrlbit = (1 << 0),
614 }, {
615 .name = "iis",
616 .devname = "samsung-i2s.1",
617 .parent = &clk_div_pclkd1.clk,
618 .enable = s5pc100_d1_5_ctrl,
619 .ctrlbit = (1 << 1),
620 }, {
621 .name = "iis",
622 .devname = "samsung-i2s.2",
623 .parent = &clk_div_pclkd1.clk,
624 .enable = s5pc100_d1_5_ctrl,
625 .ctrlbit = (1 << 2),
626 }, {
627 .name = "ac97", 609 .name = "ac97",
628 .parent = &clk_div_pclkd1.clk, 610 .parent = &clk_div_pclkd1.clk,
629 .enable = s5pc100_d1_5_ctrl, 611 .enable = s5pc100_d1_5_ctrl,
@@ -724,6 +706,30 @@ static struct clk clk_48m_spi2 = {
724 .ctrlbit = (1 << 9), 706 .ctrlbit = (1 << 9),
725}; 707};
726 708
709static struct clk clk_i2s0 = {
710 .name = "iis",
711 .devname = "samsung-i2s.0",
712 .parent = &clk_div_pclkd1.clk,
713 .enable = s5pc100_d1_5_ctrl,
714 .ctrlbit = (1 << 0),
715};
716
717static struct clk clk_i2s1 = {
718 .name = "iis",
719 .devname = "samsung-i2s.1",
720 .parent = &clk_div_pclkd1.clk,
721 .enable = s5pc100_d1_5_ctrl,
722 .ctrlbit = (1 << 1),
723};
724
725static struct clk clk_i2s2 = {
726 .name = "iis",
727 .devname = "samsung-i2s.2",
728 .parent = &clk_div_pclkd1.clk,
729 .enable = s5pc100_d1_5_ctrl,
730 .ctrlbit = (1 << 2),
731};
732
727static struct clk clk_vclk54m = { 733static struct clk clk_vclk54m = {
728 .name = "vclk_54m", 734 .name = "vclk_54m",
729 .rate = 54000000, 735 .rate = 54000000,
@@ -1154,6 +1160,9 @@ static struct clk *clk_cdev[] = {
1154 &clk_48m_spi0, 1160 &clk_48m_spi0,
1155 &clk_48m_spi1, 1161 &clk_48m_spi1,
1156 &clk_48m_spi2, 1162 &clk_48m_spi2,
1163 &clk_i2s0,
1164 &clk_i2s1,
1165 &clk_i2s2,
1157}; 1166};
1158 1167
1159static struct clksrc_clk *clksrc_cdev[] = { 1168static struct clksrc_clk *clksrc_cdev[] = {
@@ -1321,6 +1330,9 @@ static struct clk_lookup s5pc100_clk_lookup[] = {
1321 CLKDEV_INIT("s5pc100-spi.1", "spi_busclk2", &clk_sclk_spi1.clk), 1330 CLKDEV_INIT("s5pc100-spi.1", "spi_busclk2", &clk_sclk_spi1.clk),
1322 CLKDEV_INIT("s5pc100-spi.2", "spi_busclk1", &clk_48m_spi2), 1331 CLKDEV_INIT("s5pc100-spi.2", "spi_busclk1", &clk_48m_spi2),
1323 CLKDEV_INIT("s5pc100-spi.2", "spi_busclk2", &clk_sclk_spi2.clk), 1332 CLKDEV_INIT("s5pc100-spi.2", "spi_busclk2", &clk_sclk_spi2.clk),
1333 CLKDEV_INIT("samsung-i2s.0", "i2s_opclk0", &clk_i2s0),
1334 CLKDEV_INIT("samsung-i2s.1", "i2s_opclk0", &clk_i2s1),
1335 CLKDEV_INIT("samsung-i2s.2", "i2s_opclk0", &clk_i2s2),
1324}; 1336};
1325 1337
1326void __init s5pc100_register_clocks(void) 1338void __init s5pc100_register_clocks(void)
diff --git a/arch/arm/mach-s5pc100/dev-audio.c b/arch/arm/mach-s5pc100/dev-audio.c
index 1cc252cef26..46f488b0939 100644
--- a/arch/arm/mach-s5pc100/dev-audio.c
+++ b/arch/arm/mach-s5pc100/dev-audio.c
@@ -39,18 +39,12 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev)
39 return 0; 39 return 0;
40} 40}
41 41
42static const char *rclksrc_v5[] = {
43 [0] = "iis",
44 [1] = "i2sclkd2",
45};
46
47static struct s3c_audio_pdata i2sv5_pdata = { 42static struct s3c_audio_pdata i2sv5_pdata = {
48 .cfg_gpio = s5pc100_cfg_i2s, 43 .cfg_gpio = s5pc100_cfg_i2s,
49 .type = { 44 .type = {
50 .i2s = { 45 .i2s = {
51 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI 46 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI
52 | QUIRK_NEED_RSTCLR, 47 | QUIRK_NEED_RSTCLR,
53 .src_clk = rclksrc_v5,
54 }, 48 },
55 }, 49 },
56}; 50};
@@ -72,18 +66,8 @@ struct platform_device s5pc100_device_iis0 = {
72 }, 66 },
73}; 67};
74 68
75static const char *rclksrc_v3[] = {
76 [0] = "iis",
77 [1] = "sclk_audio",
78};
79
80static struct s3c_audio_pdata i2sv3_pdata = { 69static struct s3c_audio_pdata i2sv3_pdata = {
81 .cfg_gpio = s5pc100_cfg_i2s, 70 .cfg_gpio = s5pc100_cfg_i2s,
82 .type = {
83 .i2s = {
84 .src_clk = rclksrc_v3,
85 },
86 },
87}; 71};
88 72
89static struct resource s5pc100_iis1_resource[] = { 73static struct resource s5pc100_iis1_resource[] = {