diff options
author | Padmavathi Venna <padma.v@samsung.com> | 2011-11-02 07:04:08 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-12-22 20:10:33 -0500 |
commit | 02717bb9aaa0dd3a9fa9d61eb88beb35fccd8153 (patch) | |
tree | 20283361cffa6e961798907dbce87d4cb4ba5eb1 /arch/arm/mach-s5pc100 | |
parent | ba47917c686b287430bd6e3e019e187666df3e33 (diff) |
ARM: S5PC100: Add SPI clkdev support
Registered the SPI bus clocks with clkdev using generic
connection id.
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pc100')
-rw-r--r-- | arch/arm/mach-s5pc100/clock.c | 124 |
1 files changed, 73 insertions, 51 deletions
diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c index 69829ba9c01b..eba721b551fc 100644 --- a/arch/arm/mach-s5pc100/clock.c +++ b/arch/arm/mach-s5pc100/clock.c | |||
@@ -655,24 +655,6 @@ static struct clk init_clocks_off[] = { | |||
655 | .enable = s5pc100_d1_5_ctrl, | 655 | .enable = s5pc100_d1_5_ctrl, |
656 | .ctrlbit = (1 << 8), | 656 | .ctrlbit = (1 << 8), |
657 | }, { | 657 | }, { |
658 | .name = "spi_48m", | ||
659 | .devname = "s3c64xx-spi.0", | ||
660 | .parent = &clk_mout_48m.clk, | ||
661 | .enable = s5pc100_sclk0_ctrl, | ||
662 | .ctrlbit = (1 << 7), | ||
663 | }, { | ||
664 | .name = "spi_48m", | ||
665 | .devname = "s3c64xx-spi.1", | ||
666 | .parent = &clk_mout_48m.clk, | ||
667 | .enable = s5pc100_sclk0_ctrl, | ||
668 | .ctrlbit = (1 << 8), | ||
669 | }, { | ||
670 | .name = "spi_48m", | ||
671 | .devname = "s3c64xx-spi.2", | ||
672 | .parent = &clk_mout_48m.clk, | ||
673 | .enable = s5pc100_sclk0_ctrl, | ||
674 | .ctrlbit = (1 << 9), | ||
675 | }, { | ||
676 | .name = "mmc_48m", | 658 | .name = "mmc_48m", |
677 | .devname = "s3c-sdhci.0", | 659 | .devname = "s3c-sdhci.0", |
678 | .parent = &clk_mout_48m.clk, | 660 | .parent = &clk_mout_48m.clk, |
@@ -717,6 +699,30 @@ static struct clk clk_hsmmc0 = { | |||
717 | .ctrlbit = (1 << 5), | 699 | .ctrlbit = (1 << 5), |
718 | }; | 700 | }; |
719 | 701 | ||
702 | static struct clk clk_48m_spi0 = { | ||
703 | .name = "spi_48m", | ||
704 | .devname = "s3c64xx-spi.0", | ||
705 | .parent = &clk_mout_48m.clk, | ||
706 | .enable = s5pc100_sclk0_ctrl, | ||
707 | .ctrlbit = (1 << 7), | ||
708 | }; | ||
709 | |||
710 | static struct clk clk_48m_spi1 = { | ||
711 | .name = "spi_48m", | ||
712 | .devname = "s3c64xx-spi.1", | ||
713 | .parent = &clk_mout_48m.clk, | ||
714 | .enable = s5pc100_sclk0_ctrl, | ||
715 | .ctrlbit = (1 << 8), | ||
716 | }; | ||
717 | |||
718 | static struct clk clk_48m_spi2 = { | ||
719 | .name = "spi_48m", | ||
720 | .devname = "s3c64xx-spi.2", | ||
721 | .parent = &clk_mout_48m.clk, | ||
722 | .enable = s5pc100_sclk0_ctrl, | ||
723 | .ctrlbit = (1 << 9), | ||
724 | }; | ||
725 | |||
720 | static struct clk clk_vclk54m = { | 726 | static struct clk clk_vclk54m = { |
721 | .name = "vclk_54m", | 727 | .name = "vclk_54m", |
722 | .rate = 54000000, | 728 | .rate = 54000000, |
@@ -935,39 +941,6 @@ static struct clksrc_clk clk_sclk_spdif = { | |||
935 | static struct clksrc_clk clksrcs[] = { | 941 | static struct clksrc_clk clksrcs[] = { |
936 | { | 942 | { |
937 | .clk = { | 943 | .clk = { |
938 | .name = "sclk_spi", | ||
939 | .devname = "s3c64xx-spi.0", | ||
940 | .ctrlbit = (1 << 4), | ||
941 | .enable = s5pc100_sclk0_ctrl, | ||
942 | |||
943 | }, | ||
944 | .sources = &clk_src_group1, | ||
945 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 2 }, | ||
946 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 4, .size = 4 }, | ||
947 | }, { | ||
948 | .clk = { | ||
949 | .name = "sclk_spi", | ||
950 | .devname = "s3c64xx-spi.1", | ||
951 | .ctrlbit = (1 << 5), | ||
952 | .enable = s5pc100_sclk0_ctrl, | ||
953 | |||
954 | }, | ||
955 | .sources = &clk_src_group1, | ||
956 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 8, .size = 2 }, | ||
957 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 8, .size = 4 }, | ||
958 | }, { | ||
959 | .clk = { | ||
960 | .name = "sclk_spi", | ||
961 | .devname = "s3c64xx-spi.2", | ||
962 | .ctrlbit = (1 << 6), | ||
963 | .enable = s5pc100_sclk0_ctrl, | ||
964 | |||
965 | }, | ||
966 | .sources = &clk_src_group1, | ||
967 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 12, .size = 2 }, | ||
968 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 12, .size = 4 }, | ||
969 | }, { | ||
970 | .clk = { | ||
971 | .name = "sclk_mixer", | 944 | .name = "sclk_mixer", |
972 | .ctrlbit = (1 << 6), | 945 | .ctrlbit = (1 << 6), |
973 | .enable = s5pc100_sclk0_ctrl, | 946 | .enable = s5pc100_sclk0_ctrl, |
@@ -1108,6 +1081,42 @@ static struct clksrc_clk clk_sclk_mmc2 = { | |||
1108 | .reg_div = { .reg = S5P_CLK_DIV3, .shift = 8, .size = 4 }, | 1081 | .reg_div = { .reg = S5P_CLK_DIV3, .shift = 8, .size = 4 }, |
1109 | }; | 1082 | }; |
1110 | 1083 | ||
1084 | static struct clksrc_clk clk_sclk_spi0 = { | ||
1085 | .clk = { | ||
1086 | .name = "sclk_spi", | ||
1087 | .devname = "s3c64xx-spi.0", | ||
1088 | .ctrlbit = (1 << 4), | ||
1089 | .enable = s5pc100_sclk0_ctrl, | ||
1090 | }, | ||
1091 | .sources = &clk_src_group1, | ||
1092 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 2 }, | ||
1093 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 4, .size = 4 }, | ||
1094 | }; | ||
1095 | |||
1096 | static struct clksrc_clk clk_sclk_spi1 = { | ||
1097 | .clk = { | ||
1098 | .name = "sclk_spi", | ||
1099 | .devname = "s3c64xx-spi.1", | ||
1100 | .ctrlbit = (1 << 5), | ||
1101 | .enable = s5pc100_sclk0_ctrl, | ||
1102 | }, | ||
1103 | .sources = &clk_src_group1, | ||
1104 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 8, .size = 2 }, | ||
1105 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 8, .size = 4 }, | ||
1106 | }; | ||
1107 | |||
1108 | static struct clksrc_clk clk_sclk_spi2 = { | ||
1109 | .clk = { | ||
1110 | .name = "sclk_spi", | ||
1111 | .devname = "s3c64xx-spi.2", | ||
1112 | .ctrlbit = (1 << 6), | ||
1113 | .enable = s5pc100_sclk0_ctrl, | ||
1114 | }, | ||
1115 | .sources = &clk_src_group1, | ||
1116 | .reg_src = { .reg = S5P_CLK_SRC1, .shift = 12, .size = 2 }, | ||
1117 | .reg_div = { .reg = S5P_CLK_DIV2, .shift = 12, .size = 4 }, | ||
1118 | }; | ||
1119 | |||
1111 | /* Clock initialisation code */ | 1120 | /* Clock initialisation code */ |
1112 | static struct clksrc_clk *sysclks[] = { | 1121 | static struct clksrc_clk *sysclks[] = { |
1113 | &clk_mout_apll, | 1122 | &clk_mout_apll, |
@@ -1141,6 +1150,9 @@ static struct clk *clk_cdev[] = { | |||
1141 | &clk_hsmmc0, | 1150 | &clk_hsmmc0, |
1142 | &clk_hsmmc1, | 1151 | &clk_hsmmc1, |
1143 | &clk_hsmmc2, | 1152 | &clk_hsmmc2, |
1153 | &clk_48m_spi0, | ||
1154 | &clk_48m_spi1, | ||
1155 | &clk_48m_spi2, | ||
1144 | }; | 1156 | }; |
1145 | 1157 | ||
1146 | static struct clksrc_clk *clksrc_cdev[] = { | 1158 | static struct clksrc_clk *clksrc_cdev[] = { |
@@ -1148,6 +1160,9 @@ static struct clksrc_clk *clksrc_cdev[] = { | |||
1148 | &clk_sclk_mmc0, | 1160 | &clk_sclk_mmc0, |
1149 | &clk_sclk_mmc1, | 1161 | &clk_sclk_mmc1, |
1150 | &clk_sclk_mmc2, | 1162 | &clk_sclk_mmc2, |
1163 | &clk_sclk_spi0, | ||
1164 | &clk_sclk_spi1, | ||
1165 | &clk_sclk_spi2, | ||
1151 | }; | 1166 | }; |
1152 | 1167 | ||
1153 | void __init_or_cpufreq s5pc100_setup_clocks(void) | 1168 | void __init_or_cpufreq s5pc100_setup_clocks(void) |
@@ -1298,6 +1313,13 @@ static struct clk_lookup s5pc100_clk_lookup[] = { | |||
1298 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk), | 1313 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk), |
1299 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk), | 1314 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk), |
1300 | CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), | 1315 | CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), |
1316 | CLKDEV_INIT(NULL, "spi_busclk0", &clk_p), | ||
1317 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_48m_spi0), | ||
1318 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk2", &clk_sclk_spi0.clk), | ||
1319 | CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_48m_spi1), | ||
1320 | CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk2", &clk_sclk_spi1.clk), | ||
1321 | CLKDEV_INIT("s3c64xx-spi.2", "spi_busclk1", &clk_48m_spi2), | ||
1322 | CLKDEV_INIT("s3c64xx-spi.2", "spi_busclk2", &clk_sclk_spi2.clk), | ||
1301 | }; | 1323 | }; |
1302 | 1324 | ||
1303 | void __init s5pc100_register_clocks(void) | 1325 | void __init s5pc100_register_clocks(void) |