diff options
author | Dima Zavin <dima@android.com> | 2009-05-22 23:21:50 -0400 |
---|---|---|
committer | Daniel Walker <dwalker@codeaurora.org> | 2010-05-12 12:14:50 -0400 |
commit | 830d843b75338b94b7c769a2c3b59b04744a9323 (patch) | |
tree | 0493d36d70521d1c05f048e7ef979554a2a02a90 /arch/arm/mach-msm/devices.c | |
parent | 5d4f77ffefdcfbe9432db371126b74478964b4a0 (diff) |
[ARM] msm: sdcc: Make slot status irq be a resource
Also, convert all SDCC IRQ resources to be named. No longer pass status_irq
in the platform_data
Signed-off-by: Dima Zavin <dima@android.com>
Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Diffstat (limited to 'arch/arm/mach-msm/devices.c')
-rw-r--r-- | arch/arm/mach-msm/devices.c | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/arch/arm/mach-msm/devices.c b/arch/arm/mach-msm/devices.c index 39bc474455c3..982f1da60160 100644 --- a/arch/arm/mach-msm/devices.c +++ b/arch/arm/mach-msm/devices.c | |||
@@ -165,8 +165,19 @@ static struct resource resources_sdc1[] = { | |||
165 | }, | 165 | }, |
166 | { | 166 | { |
167 | .start = INT_SDC1_0, | 167 | .start = INT_SDC1_0, |
168 | .end = INT_SDC1_0, | ||
169 | .flags = IORESOURCE_IRQ, | ||
170 | .name = "cmd_irq", | ||
171 | }, | ||
172 | { | ||
173 | .start = INT_SDC1_1, | ||
168 | .end = INT_SDC1_1, | 174 | .end = INT_SDC1_1, |
169 | .flags = IORESOURCE_IRQ, | 175 | .flags = IORESOURCE_IRQ, |
176 | .name = "pio_irq", | ||
177 | }, | ||
178 | { | ||
179 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, | ||
180 | .name = "status_irq" | ||
170 | }, | 181 | }, |
171 | { | 182 | { |
172 | .start = 8, | 183 | .start = 8, |
@@ -183,8 +194,19 @@ static struct resource resources_sdc2[] = { | |||
183 | }, | 194 | }, |
184 | { | 195 | { |
185 | .start = INT_SDC2_0, | 196 | .start = INT_SDC2_0, |
197 | .end = INT_SDC2_0, | ||
198 | .flags = IORESOURCE_IRQ, | ||
199 | .name = "cmd_irq", | ||
200 | }, | ||
201 | { | ||
202 | .start = INT_SDC2_1, | ||
186 | .end = INT_SDC2_1, | 203 | .end = INT_SDC2_1, |
187 | .flags = IORESOURCE_IRQ, | 204 | .flags = IORESOURCE_IRQ, |
205 | .name = "pio_irq", | ||
206 | }, | ||
207 | { | ||
208 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, | ||
209 | .name = "status_irq" | ||
188 | }, | 210 | }, |
189 | { | 211 | { |
190 | .start = 8, | 212 | .start = 8, |
@@ -201,8 +223,19 @@ static struct resource resources_sdc3[] = { | |||
201 | }, | 223 | }, |
202 | { | 224 | { |
203 | .start = INT_SDC3_0, | 225 | .start = INT_SDC3_0, |
226 | .end = INT_SDC3_0, | ||
227 | .flags = IORESOURCE_IRQ, | ||
228 | .name = "cmd_irq", | ||
229 | }, | ||
230 | { | ||
231 | .start = INT_SDC3_1, | ||
204 | .end = INT_SDC3_1, | 232 | .end = INT_SDC3_1, |
205 | .flags = IORESOURCE_IRQ, | 233 | .flags = IORESOURCE_IRQ, |
234 | .name = "pio_irq", | ||
235 | }, | ||
236 | { | ||
237 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, | ||
238 | .name = "status_irq" | ||
206 | }, | 239 | }, |
207 | { | 240 | { |
208 | .start = 8, | 241 | .start = 8, |
@@ -219,8 +252,19 @@ static struct resource resources_sdc4[] = { | |||
219 | }, | 252 | }, |
220 | { | 253 | { |
221 | .start = INT_SDC4_0, | 254 | .start = INT_SDC4_0, |
255 | .end = INT_SDC4_0, | ||
256 | .flags = IORESOURCE_IRQ, | ||
257 | .name = "cmd_irq", | ||
258 | }, | ||
259 | { | ||
260 | .start = INT_SDC4_1, | ||
222 | .end = INT_SDC4_1, | 261 | .end = INT_SDC4_1, |
223 | .flags = IORESOURCE_IRQ, | 262 | .flags = IORESOURCE_IRQ, |
263 | .name = "pio_irq", | ||
264 | }, | ||
265 | { | ||
266 | .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, | ||
267 | .name = "status_irq" | ||
224 | }, | 268 | }, |
225 | { | 269 | { |
226 | .start = 8, | 270 | .start = 8, |
@@ -276,15 +320,27 @@ static struct platform_device *msm_sdcc_devices[] __initdata = { | |||
276 | &msm_device_sdc4, | 320 | &msm_device_sdc4, |
277 | }; | 321 | }; |
278 | 322 | ||
279 | int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat) | 323 | int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat, |
324 | unsigned int stat_irq, unsigned long stat_irq_flags) | ||
280 | { | 325 | { |
281 | struct platform_device *pdev; | 326 | struct platform_device *pdev; |
327 | struct resource *res; | ||
282 | 328 | ||
283 | if (controller < 1 || controller > 4) | 329 | if (controller < 1 || controller > 4) |
284 | return -EINVAL; | 330 | return -EINVAL; |
285 | 331 | ||
286 | pdev = msm_sdcc_devices[controller-1]; | 332 | pdev = msm_sdcc_devices[controller-1]; |
287 | pdev->dev.platform_data = plat; | 333 | pdev->dev.platform_data = plat; |
334 | |||
335 | res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq"); | ||
336 | if (!res) | ||
337 | return -EINVAL; | ||
338 | else if (stat_irq) { | ||
339 | res->start = res->end = stat_irq; | ||
340 | res->flags &= ~IORESOURCE_DISABLED; | ||
341 | res->flags |= stat_irq_flags; | ||
342 | } | ||
343 | |||
288 | return platform_device_register(pdev); | 344 | return platform_device_register(pdev); |
289 | } | 345 | } |
290 | 346 | ||