aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5p64x0
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
commitd690b313a6008215428d4bae303c9ecab593b508 (patch)
tree1f319febbc9d1a2370d4b7f7e86591bd55bf591c /arch/arm/mach-s5p64x0
parenteaff82ed0f18022d089dbb157df49c0d79379168 (diff)
ARM: S5P64X0: 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>
Diffstat (limited to 'arch/arm/mach-s5p64x0')
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6440.c49
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6450.c61
-rw-r--r--arch/arm/mach-s5p64x0/dev-audio.c12
3 files changed, 75 insertions, 47 deletions
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c
index 000445596ec4..5112371079d0 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6440.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c
@@ -243,12 +243,6 @@ static struct clk init_clocks_off[] = {
243 .enable = s5p64x0_pclk_ctrl, 243 .enable = s5p64x0_pclk_ctrl,
244 .ctrlbit = (1 << 25), 244 .ctrlbit = (1 << 25),
245 }, { 245 }, {
246 .name = "iis",
247 .devname = "samsung-i2s.0",
248 .parent = &clk_pclk_low.clk,
249 .enable = s5p64x0_pclk_ctrl,
250 .ctrlbit = (1 << 26),
251 }, {
252 .name = "dsim", 246 .name = "dsim",
253 .parent = &clk_pclk_low.clk, 247 .parent = &clk_pclk_low.clk,
254 .enable = s5p64x0_pclk_ctrl, 248 .enable = s5p64x0_pclk_ctrl,
@@ -405,15 +399,6 @@ static struct clksrc_clk clksrcs[] = {
405 .sources = &clkset_group1, 399 .sources = &clkset_group1,
406 .reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 8, .size = 2 }, 400 .reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 8, .size = 2 },
407 .reg_div = { .reg = S5P64X0_CLK_DIV3, .shift = 4, .size = 4 }, 401 .reg_div = { .reg = S5P64X0_CLK_DIV3, .shift = 4, .size = 4 },
408 }, {
409 .clk = {
410 .name = "sclk_audio2",
411 .ctrlbit = (1 << 11),
412 .enable = s5p64x0_sclk_ctrl,
413 },
414 .sources = &clkset_audio,
415 .reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 0, .size = 3 },
416 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 24, .size = 4 },
417 }, 402 },
418}; 403};
419 404
@@ -464,6 +449,26 @@ static struct clksrc_clk clk_sclk_uclk = {
464 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, 449 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 },
465}; 450};
466 451
452static struct clk clk_i2s0 = {
453 .name = "iis",
454 .devname = "samsung-i2s.0",
455 .parent = &clk_pclk_low.clk,
456 .enable = s5p64x0_pclk_ctrl,
457 .ctrlbit = (1 << 26),
458};
459
460static struct clksrc_clk clk_audio_bus2 = {
461 .clk = {
462 .name = "sclk_audio2",
463 .devname = "samsung-i2s.0",
464 .ctrlbit = (1 << 11),
465 .enable = s5p64x0_sclk_ctrl,
466 },
467 .sources = &clkset_audio,
468 .reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 0, .size = 3 },
469 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 24, .size = 4 },
470};
471
467static struct clksrc_clk clk_sclk_spi0 = { 472static struct clksrc_clk clk_sclk_spi0 = {
468 .clk = { 473 .clk = {
469 .name = "sclk_spi", 474 .name = "sclk_spi",
@@ -506,13 +511,18 @@ static struct clk dummy_apb_pclk = {
506 .id = -1, 511 .id = -1,
507}; 512};
508 513
514static struct clk *clk_cdev[] = {
515 &clk_i2s0,
516};
517
509static struct clksrc_clk *clksrc_cdev[] = { 518static struct clksrc_clk *clksrc_cdev[] = {
510 &clk_sclk_uclk, 519 &clk_sclk_uclk,
511 &clk_sclk_spi0, 520 &clk_sclk_spi0,
512 &clk_sclk_spi1, 521 &clk_sclk_spi1,
513 &clk_sclk_mmc0, 522 &clk_sclk_mmc0,
514 &clk_sclk_mmc1, 523 &clk_sclk_mmc1,
515 &clk_sclk_mmc2 524 &clk_sclk_mmc2,
525 &clk_audio_bus2,
516}; 526};
517 527
518static struct clk_lookup s5p6440_clk_lookup[] = { 528static struct clk_lookup s5p6440_clk_lookup[] = {
@@ -524,6 +534,8 @@ static struct clk_lookup s5p6440_clk_lookup[] = {
524 CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk), 534 CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
525 CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk), 535 CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
526 CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), 536 CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
537 CLKDEV_INIT("samsung-i2s.0", "i2s_opclk0", &clk_i2s0),
538 CLKDEV_INIT("samsung-i2s.0", "i2s_opclk1", &clk_audio_bus2.clk),
527}; 539};
528 540
529void __init_or_cpufreq s5p6440_setup_clocks(void) 541void __init_or_cpufreq s5p6440_setup_clocks(void)
@@ -596,12 +608,17 @@ static struct clk *clks[] __initdata = {
596void __init s5p6440_register_clocks(void) 608void __init s5p6440_register_clocks(void)
597{ 609{
598 int ptr; 610 int ptr;
611 unsigned int cnt;
599 612
600 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 613 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
601 614
602 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 615 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++)
603 s3c_register_clksrc(sysclks[ptr], 1); 616 s3c_register_clksrc(sysclks[ptr], 1);
604 617
618 s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev));
619 for (cnt = 0; cnt < ARRAY_SIZE(clk_cdev); cnt++)
620 s3c_disable_clocks(clk_cdev[cnt], 1);
621
605 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 622 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
606 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 623 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
607 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) 624 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++)
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6450.c b/arch/arm/mach-s5p64x0/clock-s5p6450.c
index f3e0ef3d27c9..154dea702d70 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6450.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6450.c
@@ -247,24 +247,6 @@ static struct clk init_clocks_off[] = {
247 .enable = s5p64x0_pclk_ctrl, 247 .enable = s5p64x0_pclk_ctrl,
248 .ctrlbit = (1 << 22), 248 .ctrlbit = (1 << 22),
249 }, { 249 }, {
250 .name = "iis",
251 .devname = "samsung-i2s.0",
252 .parent = &clk_pclk_low.clk,
253 .enable = s5p64x0_pclk_ctrl,
254 .ctrlbit = (1 << 26),
255 }, {
256 .name = "iis",
257 .devname = "samsung-i2s.1",
258 .parent = &clk_pclk_low.clk,
259 .enable = s5p64x0_pclk_ctrl,
260 .ctrlbit = (1 << 15),
261 }, {
262 .name = "iis",
263 .devname = "samsung-i2s.2",
264 .parent = &clk_pclk_low.clk,
265 .enable = s5p64x0_pclk_ctrl,
266 .ctrlbit = (1 << 16),
267 }, {
268 .name = "i2c", 250 .name = "i2c",
269 .devname = "s3c2440-i2c.1", 251 .devname = "s3c2440-i2c.1",
270 .parent = &clk_pclk_low.clk, 252 .parent = &clk_pclk_low.clk,
@@ -402,6 +384,7 @@ static struct clksrc_sources clkset_sclk_audio0 = {
402static struct clksrc_clk clk_sclk_audio0 = { 384static struct clksrc_clk clk_sclk_audio0 = {
403 .clk = { 385 .clk = {
404 .name = "audio-bus", 386 .name = "audio-bus",
387 .devname = "samsung-i2s.0",
405 .enable = s5p64x0_sclk_ctrl, 388 .enable = s5p64x0_sclk_ctrl,
406 .ctrlbit = (1 << 8), 389 .ctrlbit = (1 << 8),
407 .parent = &clk_dout_epll.clk, 390 .parent = &clk_dout_epll.clk,
@@ -549,6 +532,36 @@ static struct clksrc_clk clk_sclk_spi1 = {
549 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 }, 532 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 },
550}; 533};
551 534
535static struct clk clk_i2s0 = {
536 .name = "iis",
537 .devname = "samsung-i2s.0",
538 .parent = &clk_pclk_low.clk,
539 .enable = s5p64x0_pclk_ctrl,
540 .ctrlbit = (1 << 26),
541};
542
543static struct clk clk_i2s1 = {
544 .name = "iis",
545 .devname = "samsung-i2s.1",
546 .parent = &clk_pclk_low.clk,
547 .enable = s5p64x0_pclk_ctrl,
548 .ctrlbit = (1 << 15),
549};
550
551static struct clk clk_i2s2 = {
552 .name = "iis",
553 .devname = "samsung-i2s.2",
554 .parent = &clk_pclk_low.clk,
555 .enable = s5p64x0_pclk_ctrl,
556 .ctrlbit = (1 << 16),
557};
558
559static struct clk *clk_cdev[] = {
560 &clk_i2s0,
561 &clk_i2s1,
562 &clk_i2s2,
563};
564
552static struct clksrc_clk *clksrc_cdev[] = { 565static struct clksrc_clk *clksrc_cdev[] = {
553 &clk_sclk_uclk, 566 &clk_sclk_uclk,
554 &clk_sclk_spi0, 567 &clk_sclk_spi0,
@@ -556,6 +569,7 @@ static struct clksrc_clk *clksrc_cdev[] = {
556 &clk_sclk_mmc0, 569 &clk_sclk_mmc0,
557 &clk_sclk_mmc1, 570 &clk_sclk_mmc1,
558 &clk_sclk_mmc2, 571 &clk_sclk_mmc2,
572 &clk_sclk_audio0,
559}; 573};
560 574
561static struct clk_lookup s5p6450_clk_lookup[] = { 575static struct clk_lookup s5p6450_clk_lookup[] = {
@@ -567,6 +581,10 @@ static struct clk_lookup s5p6450_clk_lookup[] = {
567 CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk), 581 CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
568 CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk), 582 CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
569 CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), 583 CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
584 CLKDEV_INIT("samsung-i2s.0", "i2s_opclk0", &clk_i2s0),
585 CLKDEV_INIT("samsung-i2s.0", "i2s_opclk1", &clk_sclk_audio0.clk),
586 CLKDEV_INIT("samsung-i2s.1", "i2s_opclk0", &clk_i2s1),
587 CLKDEV_INIT("samsung-i2s.2", "i2s_opclk0", &clk_i2s2),
570}; 588};
571 589
572/* Clock initialization code */ 590/* Clock initialization code */
@@ -584,7 +602,6 @@ static struct clksrc_clk *sysclks[] = {
584 &clk_pclk, 602 &clk_pclk,
585 &clk_hclk_low, 603 &clk_hclk_low,
586 &clk_pclk_low, 604 &clk_pclk_low,
587 &clk_sclk_audio0,
588}; 605};
589 606
590static struct clk dummy_apb_pclk = { 607static struct clk dummy_apb_pclk = {
@@ -661,10 +678,16 @@ void __init_or_cpufreq s5p6450_setup_clocks(void)
661void __init s5p6450_register_clocks(void) 678void __init s5p6450_register_clocks(void)
662{ 679{
663 int ptr; 680 int ptr;
681 unsigned int cnt;
664 682
665 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 683 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++)
666 s3c_register_clksrc(sysclks[ptr], 1); 684 s3c_register_clksrc(sysclks[ptr], 1);
667 685
686
687 s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev));
688 for (cnt = 0; cnt < ARRAY_SIZE(clk_cdev); cnt++)
689 s3c_disable_clocks(clk_cdev[cnt], 1);
690
668 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 691 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
669 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 692 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
670 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) 693 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++)
diff --git a/arch/arm/mach-s5p64x0/dev-audio.c b/arch/arm/mach-s5p64x0/dev-audio.c
index a0d6edfd23a0..723d4773c323 100644
--- a/arch/arm/mach-s5p64x0/dev-audio.c
+++ b/arch/arm/mach-s5p64x0/dev-audio.c
@@ -19,11 +19,6 @@
19#include <mach/dma.h> 19#include <mach/dma.h>
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21 21
22static const char *rclksrc[] = {
23 [0] = "iis",
24 [1] = "sclk_audio2",
25};
26
27static int s5p6440_cfg_i2s(struct platform_device *pdev) 22static int s5p6440_cfg_i2s(struct platform_device *pdev)
28{ 23{
29 switch (pdev->id) { 24 switch (pdev->id) {
@@ -45,7 +40,6 @@ static struct s3c_audio_pdata s5p6440_i2s_pdata = {
45 .type = { 40 .type = {
46 .i2s = { 41 .i2s = {
47 .quirks = QUIRK_PRI_6CHAN, 42 .quirks = QUIRK_PRI_6CHAN,
48 .src_clk = rclksrc,
49 }, 43 },
50 }, 44 },
51}; 45};
@@ -93,7 +87,6 @@ static struct s3c_audio_pdata s5p6450_i2s0_pdata = {
93 .type = { 87 .type = {
94 .i2s = { 88 .i2s = {
95 .quirks = QUIRK_PRI_6CHAN, 89 .quirks = QUIRK_PRI_6CHAN,
96 .src_clk = rclksrc,
97 }, 90 },
98 }, 91 },
99}; 92};
@@ -110,11 +103,6 @@ struct platform_device s5p6450_device_iis0 = {
110 103
111static struct s3c_audio_pdata s5p6450_i2s_pdata = { 104static struct s3c_audio_pdata s5p6450_i2s_pdata = {
112 .cfg_gpio = s5p6450_cfg_i2s, 105 .cfg_gpio = s5p6450_cfg_i2s,
113 .type = {
114 .i2s = {
115 .src_clk = rclksrc,
116 },
117 },
118}; 106};
119 107
120static struct resource s5p6450_i2s1_resource[] = { 108static struct resource s5p6450_i2s1_resource[] = {