diff options
Diffstat (limited to 'arch/arm/mach-msm/devices-qsd8x50.c')
-rw-r--r-- | arch/arm/mach-msm/devices-qsd8x50.c | 196 |
1 files changed, 196 insertions, 0 deletions
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c index a4b798f20ccb..b1a8f0f680a7 100644 --- a/arch/arm/mach-msm/devices-qsd8x50.c +++ b/arch/arm/mach-msm/devices-qsd8x50.c | |||
@@ -124,6 +124,194 @@ struct platform_device msm_device_hsusb_host = { | |||
124 | }, | 124 | }, |
125 | }; | 125 | }; |
126 | 126 | ||
127 | static struct resource resources_sdc1[] = { | ||
128 | { | ||
129 | .start = MSM_SDC1_PHYS, | ||
130 | .end = MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1, | ||
131 | .flags = IORESOURCE_MEM, | ||
132 | }, | ||
133 | { | ||
134 | .start = INT_SDC1_0, | ||
135 | .end = INT_SDC1_0, | ||
136 | .flags = IORESOURCE_IRQ, | ||
137 | .name = "cmd_irq", | ||
138 | }, | ||
139 | { | ||
140 | .start = INT_SDC1_1, | ||
141 | .end = INT_SDC1_1, | ||
142 | .flags = IORESOURCE_IRQ, | ||
143 | .name = "pio_irq", | ||
144 | }, | ||
145 | { | ||
146 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, | ||
147 | .name = "status_irq" | ||
148 | }, | ||
149 | { | ||
150 | .start = 8, | ||
151 | .end = 8, | ||
152 | .flags = IORESOURCE_DMA, | ||
153 | }, | ||
154 | }; | ||
155 | |||
156 | static struct resource resources_sdc2[] = { | ||
157 | { | ||
158 | .start = MSM_SDC2_PHYS, | ||
159 | .end = MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1, | ||
160 | .flags = IORESOURCE_MEM, | ||
161 | }, | ||
162 | { | ||
163 | .start = INT_SDC2_0, | ||
164 | .end = INT_SDC2_0, | ||
165 | .flags = IORESOURCE_IRQ, | ||
166 | .name = "cmd_irq", | ||
167 | }, | ||
168 | { | ||
169 | .start = INT_SDC2_1, | ||
170 | .end = INT_SDC2_1, | ||
171 | .flags = IORESOURCE_IRQ, | ||
172 | .name = "pio_irq", | ||
173 | }, | ||
174 | { | ||
175 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, | ||
176 | .name = "status_irq" | ||
177 | }, | ||
178 | { | ||
179 | .start = 8, | ||
180 | .end = 8, | ||
181 | .flags = IORESOURCE_DMA, | ||
182 | }, | ||
183 | }; | ||
184 | |||
185 | static struct resource resources_sdc3[] = { | ||
186 | { | ||
187 | .start = MSM_SDC3_PHYS, | ||
188 | .end = MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1, | ||
189 | .flags = IORESOURCE_MEM, | ||
190 | }, | ||
191 | { | ||
192 | .start = INT_SDC3_0, | ||
193 | .end = INT_SDC3_0, | ||
194 | .flags = IORESOURCE_IRQ, | ||
195 | .name = "cmd_irq", | ||
196 | }, | ||
197 | { | ||
198 | .start = INT_SDC3_1, | ||
199 | .end = INT_SDC3_1, | ||
200 | .flags = IORESOURCE_IRQ, | ||
201 | .name = "pio_irq", | ||
202 | }, | ||
203 | { | ||
204 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, | ||
205 | .name = "status_irq" | ||
206 | }, | ||
207 | { | ||
208 | .start = 8, | ||
209 | .end = 8, | ||
210 | .flags = IORESOURCE_DMA, | ||
211 | }, | ||
212 | }; | ||
213 | |||
214 | static struct resource resources_sdc4[] = { | ||
215 | { | ||
216 | .start = MSM_SDC4_PHYS, | ||
217 | .end = MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1, | ||
218 | .flags = IORESOURCE_MEM, | ||
219 | }, | ||
220 | { | ||
221 | .start = INT_SDC4_0, | ||
222 | .end = INT_SDC4_0, | ||
223 | .flags = IORESOURCE_IRQ, | ||
224 | .name = "cmd_irq", | ||
225 | }, | ||
226 | { | ||
227 | .start = INT_SDC4_1, | ||
228 | .end = INT_SDC4_1, | ||
229 | .flags = IORESOURCE_IRQ, | ||
230 | .name = "pio_irq", | ||
231 | }, | ||
232 | { | ||
233 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, | ||
234 | .name = "status_irq" | ||
235 | }, | ||
236 | { | ||
237 | .start = 8, | ||
238 | .end = 8, | ||
239 | .flags = IORESOURCE_DMA, | ||
240 | }, | ||
241 | }; | ||
242 | |||
243 | struct platform_device msm_device_sdc1 = { | ||
244 | .name = "msm_sdcc", | ||
245 | .id = 1, | ||
246 | .num_resources = ARRAY_SIZE(resources_sdc1), | ||
247 | .resource = resources_sdc1, | ||
248 | .dev = { | ||
249 | .coherent_dma_mask = 0xffffffff, | ||
250 | }, | ||
251 | }; | ||
252 | |||
253 | struct platform_device msm_device_sdc2 = { | ||
254 | .name = "msm_sdcc", | ||
255 | .id = 2, | ||
256 | .num_resources = ARRAY_SIZE(resources_sdc2), | ||
257 | .resource = resources_sdc2, | ||
258 | .dev = { | ||
259 | .coherent_dma_mask = 0xffffffff, | ||
260 | }, | ||
261 | }; | ||
262 | |||
263 | struct platform_device msm_device_sdc3 = { | ||
264 | .name = "msm_sdcc", | ||
265 | .id = 3, | ||
266 | .num_resources = ARRAY_SIZE(resources_sdc3), | ||
267 | .resource = resources_sdc3, | ||
268 | .dev = { | ||
269 | .coherent_dma_mask = 0xffffffff, | ||
270 | }, | ||
271 | }; | ||
272 | |||
273 | struct platform_device msm_device_sdc4 = { | ||
274 | .name = "msm_sdcc", | ||
275 | .id = 4, | ||
276 | .num_resources = ARRAY_SIZE(resources_sdc4), | ||
277 | .resource = resources_sdc4, | ||
278 | .dev = { | ||
279 | .coherent_dma_mask = 0xffffffff, | ||
280 | }, | ||
281 | }; | ||
282 | |||
283 | static struct platform_device *msm_sdcc_devices[] __initdata = { | ||
284 | &msm_device_sdc1, | ||
285 | &msm_device_sdc2, | ||
286 | &msm_device_sdc3, | ||
287 | &msm_device_sdc4, | ||
288 | }; | ||
289 | |||
290 | int __init msm_add_sdcc(unsigned int controller, | ||
291 | struct msm_mmc_platform_data *plat, | ||
292 | unsigned int stat_irq, unsigned long stat_irq_flags) | ||
293 | { | ||
294 | struct platform_device *pdev; | ||
295 | struct resource *res; | ||
296 | |||
297 | if (controller < 1 || controller > 4) | ||
298 | return -EINVAL; | ||
299 | |||
300 | pdev = msm_sdcc_devices[controller-1]; | ||
301 | pdev->dev.platform_data = plat; | ||
302 | |||
303 | res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq"); | ||
304 | if (!res) | ||
305 | return -EINVAL; | ||
306 | else if (stat_irq) { | ||
307 | res->start = res->end = stat_irq; | ||
308 | res->flags &= ~IORESOURCE_DISABLED; | ||
309 | res->flags |= stat_irq_flags; | ||
310 | } | ||
311 | |||
312 | return platform_device_register(pdev); | ||
313 | } | ||
314 | |||
127 | struct clk msm_clocks_8x50[] = { | 315 | struct clk msm_clocks_8x50[] = { |
128 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), | 316 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), |
129 | CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), | 317 | CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), |
@@ -144,6 +332,14 @@ struct clk msm_clocks_8x50[] = { | |||
144 | CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN), | 332 | CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN), |
145 | CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), | 333 | CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), |
146 | CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), | 334 | CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), |
335 | CLK_PCOM("sdc_clk", SDC1_CLK, &msm_device_sdc1.dev, OFF), | ||
336 | CLK_PCOM("sdc_pclk", SDC1_P_CLK, &msm_device_sdc1.dev, OFF), | ||
337 | CLK_PCOM("sdc_clk", SDC2_CLK, &msm_device_sdc2.dev, OFF), | ||
338 | CLK_PCOM("sdc_pclk", SDC2_P_CLK, &msm_device_sdc2.dev, OFF), | ||
339 | CLK_PCOM("sdc_clk", SDC3_CLK, &msm_device_sdc3.dev, OFF), | ||
340 | CLK_PCOM("sdc_pclk", SDC3_P_CLK, &msm_device_sdc3.dev, OFF), | ||
341 | CLK_PCOM("sdc_clk", SDC4_CLK, &msm_device_sdc4.dev, OFF), | ||
342 | CLK_PCOM("sdc_pclk", SDC4_P_CLK, &msm_device_sdc4.dev, OFF), | ||
147 | CLK_PCOM("spi_clk", SPI_CLK, NULL, 0), | 343 | CLK_PCOM("spi_clk", SPI_CLK, NULL, 0), |
148 | CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), | 344 | CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), |
149 | CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), | 345 | CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), |