diff options
author | Rajeshwari Shinde <rajeshwari.s@samsung.com> | 2011-10-24 11:05:58 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-12-22 20:09:16 -0500 |
commit | a361d10a2b490812b051433b1aad5b4351372597 (patch) | |
tree | 7132392c01d78d275d12313056803e15e97c5f6b /arch/arm/mach-s3c2416/clock.c | |
parent | a60879e7ca17ea41bacd57e3cb2b56e48135f7a3 (diff) |
ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names
Add support for lookup of sdhci-s3c controller clocks using generic names
for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.
Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
[kgene.kim@samsung.com: fixed trailing whitespace]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c2416/clock.c')
-rw-r--r-- | arch/arm/mach-s3c2416/clock.c | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/arch/arm/mach-s3c2416/clock.c b/arch/arm/mach-s3c2416/clock.c index afbbe8bc21d1..59f54d1d7f8b 100644 --- a/arch/arm/mach-s3c2416/clock.c +++ b/arch/arm/mach-s3c2416/clock.c | |||
@@ -90,39 +90,38 @@ static struct clksrc_clk hsmmc_div[] = { | |||
90 | }, | 90 | }, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static struct clksrc_clk hsmmc_mux[] = { | 93 | static struct clksrc_clk hsmmc_mux0 = { |
94 | [0] = { | 94 | .clk = { |
95 | .clk = { | 95 | .name = "hsmmc-if", |
96 | .name = "hsmmc-if", | 96 | .devname = "s3c-sdhci.0", |
97 | .devname = "s3c-sdhci.0", | 97 | .ctrlbit = (1 << 6), |
98 | .ctrlbit = (1 << 6), | 98 | .enable = s3c2443_clkcon_enable_s, |
99 | .enable = s3c2443_clkcon_enable_s, | ||
100 | }, | ||
101 | .sources = &(struct clksrc_sources) { | ||
102 | .nr_sources = 2, | ||
103 | .sources = (struct clk *[]) { | ||
104 | [0] = &hsmmc_div[0].clk, | ||
105 | [1] = NULL, /* to fix */ | ||
106 | }, | ||
107 | }, | ||
108 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 16 }, | ||
109 | }, | 99 | }, |
110 | [1] = { | 100 | .sources = &(struct clksrc_sources) { |
111 | .clk = { | 101 | .nr_sources = 2, |
112 | .name = "hsmmc-if", | 102 | .sources = (struct clk * []) { |
113 | .devname = "s3c-sdhci.1", | 103 | [0] = &hsmmc_div[0].clk, |
114 | .ctrlbit = (1 << 12), | 104 | [1] = NULL, /* to fix */ |
115 | .enable = s3c2443_clkcon_enable_s, | ||
116 | }, | 105 | }, |
117 | .sources = &(struct clksrc_sources) { | 106 | }, |
118 | .nr_sources = 2, | 107 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 16 }, |
119 | .sources = (struct clk *[]) { | 108 | }; |
120 | [0] = &hsmmc_div[1].clk, | 109 | |
121 | [1] = NULL, /* to fix */ | 110 | static struct clksrc_clk hsmmc_mux1 = { |
122 | }, | 111 | .clk = { |
112 | .name = "hsmmc-if", | ||
113 | .devname = "s3c-sdhci.1", | ||
114 | .ctrlbit = (1 << 12), | ||
115 | .enable = s3c2443_clkcon_enable_s, | ||
116 | }, | ||
117 | .sources = &(struct clksrc_sources) { | ||
118 | .nr_sources = 2, | ||
119 | .sources = (struct clk * []) { | ||
120 | [0] = &hsmmc_div[1].clk, | ||
121 | [1] = NULL, /* to fix */ | ||
123 | }, | 122 | }, |
124 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 17 }, | ||
125 | }, | 123 | }, |
124 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 17 }, | ||
126 | }; | 125 | }; |
127 | 126 | ||
128 | static struct clk hsmmc0_clk = { | 127 | static struct clk hsmmc0_clk = { |
@@ -144,8 +143,14 @@ static struct clksrc_clk *clksrcs[] __initdata = { | |||
144 | &hsspi_mux, | 143 | &hsspi_mux, |
145 | &hsmmc_div[0], | 144 | &hsmmc_div[0], |
146 | &hsmmc_div[1], | 145 | &hsmmc_div[1], |
147 | &hsmmc_mux[0], | 146 | &hsmmc_mux0, |
148 | &hsmmc_mux[1], | 147 | &hsmmc_mux1, |
148 | }; | ||
149 | |||
150 | static struct clk_lookup s3c2416_clk_lookup[] = { | ||
151 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.0", &hsmmc0_clk), | ||
152 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &hsmmc_mux0.clk), | ||
153 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &hsmmc_mux1.clk), | ||
149 | }; | 154 | }; |
150 | 155 | ||
151 | void __init s3c2416_init_clocks(int xtal) | 156 | void __init s3c2416_init_clocks(int xtal) |
@@ -167,6 +172,7 @@ void __init s3c2416_init_clocks(int xtal) | |||
167 | s3c_register_clksrc(clksrcs[ptr], 1); | 172 | s3c_register_clksrc(clksrcs[ptr], 1); |
168 | 173 | ||
169 | s3c24xx_register_clock(&hsmmc0_clk); | 174 | s3c24xx_register_clock(&hsmmc0_clk); |
175 | clkdev_add_table(s3c2416_clk_lookup, ARRAY_SIZE(s3c2416_clk_lookup)); | ||
170 | 176 | ||
171 | s3c_pwmclk_init(); | 177 | s3c_pwmclk_init(); |
172 | 178 | ||