diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 19:00:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 19:00:48 -0400 |
commit | a6f707b601c3f85d4b816ea08a757ea1af4f1cc0 (patch) | |
tree | 86cea1675e515c6baca64cea812ebe2ccc6aa955 /drivers/pcmcia/at91_cf.c | |
parent | ef08e78268423fc4d7fbc3e54bd9a67fc8da7cc5 (diff) | |
parent | 80af9e6d7ae633309cc5bca96aee6a45117e7c98 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia
Pull a few PCMCIA updates from Dominik Brodowski.
Fix up trivial conflict (modified code in question had been removed) in
drivers/pcmcia/soc_common.c.
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia:
pcmcia at91_cf: fix raw gpio number usage
ARM: pxa: fix error handling in pxa2xx_drv_pcmcia_probe
pcmcia: Convert to DEFINE_PCI_DEVICE_TABLE
pcmcia: convert drivers/pcmcia/* to use module_platform_driver()
pcmcia: irq: Remove IRQF_DISABLED
Diffstat (limited to 'drivers/pcmcia/at91_cf.c')
-rw-r--r-- | drivers/pcmcia/at91_cf.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 1dd68f502634..9694c1e783a5 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c | |||
@@ -16,13 +16,13 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/gpio.h> | ||
19 | 20 | ||
20 | #include <pcmcia/ss.h> | 21 | #include <pcmcia/ss.h> |
21 | 22 | ||
22 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
24 | #include <asm/sizes.h> | 25 | #include <asm/sizes.h> |
25 | #include <asm/gpio.h> | ||
26 | 26 | ||
27 | #include <mach/board.h> | 27 | #include <mach/board.h> |
28 | #include <mach/at91rm9200_mc.h> | 28 | #include <mach/at91rm9200_mc.h> |
@@ -70,7 +70,7 @@ static irqreturn_t at91_cf_irq(int irq, void *_cf) | |||
70 | { | 70 | { |
71 | struct at91_cf_socket *cf = _cf; | 71 | struct at91_cf_socket *cf = _cf; |
72 | 72 | ||
73 | if (irq == cf->board->det_pin) { | 73 | if (irq == gpio_to_irq(cf->board->det_pin)) { |
74 | unsigned present = at91_cf_present(cf); | 74 | unsigned present = at91_cf_present(cf); |
75 | 75 | ||
76 | /* kick pccard as needed */ | 76 | /* kick pccard as needed */ |
@@ -96,8 +96,8 @@ static int at91_cf_get_status(struct pcmcia_socket *s, u_int *sp) | |||
96 | 96 | ||
97 | /* NOTE: CF is always 3VCARD */ | 97 | /* NOTE: CF is always 3VCARD */ |
98 | if (at91_cf_present(cf)) { | 98 | if (at91_cf_present(cf)) { |
99 | int rdy = cf->board->irq_pin; /* RDY/nIRQ */ | 99 | int rdy = gpio_is_valid(cf->board->irq_pin); /* RDY/nIRQ */ |
100 | int vcc = cf->board->vcc_pin; | 100 | int vcc = gpio_is_valid(cf->board->vcc_pin); |
101 | 101 | ||
102 | *sp = SS_DETECT | SS_3VCARD; | 102 | *sp = SS_DETECT | SS_3VCARD; |
103 | if (!rdy || gpio_get_value(rdy)) | 103 | if (!rdy || gpio_get_value(rdy)) |
@@ -118,7 +118,7 @@ at91_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s) | |||
118 | cf = container_of(sock, struct at91_cf_socket, socket); | 118 | cf = container_of(sock, struct at91_cf_socket, socket); |
119 | 119 | ||
120 | /* switch Vcc if needed and possible */ | 120 | /* switch Vcc if needed and possible */ |
121 | if (cf->board->vcc_pin) { | 121 | if (gpio_is_valid(cf->board->vcc_pin)) { |
122 | switch (s->Vcc) { | 122 | switch (s->Vcc) { |
123 | case 0: | 123 | case 0: |
124 | gpio_set_value(cf->board->vcc_pin, 0); | 124 | gpio_set_value(cf->board->vcc_pin, 0); |
@@ -222,7 +222,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) | |||
222 | struct resource *io; | 222 | struct resource *io; |
223 | int status; | 223 | int status; |
224 | 224 | ||
225 | if (!board || !board->det_pin || !board->rst_pin) | 225 | if (!board || !gpio_is_valid(board->det_pin) || !gpio_is_valid(board->rst_pin)) |
226 | return -ENODEV; | 226 | return -ENODEV; |
227 | 227 | ||
228 | io = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 228 | io = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -242,7 +242,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) | |||
242 | status = gpio_request(board->det_pin, "cf_det"); | 242 | status = gpio_request(board->det_pin, "cf_det"); |
243 | if (status < 0) | 243 | if (status < 0) |
244 | goto fail0; | 244 | goto fail0; |
245 | status = request_irq(board->det_pin, at91_cf_irq, 0, driver_name, cf); | 245 | status = request_irq(gpio_to_irq(board->det_pin), at91_cf_irq, 0, driver_name, cf); |
246 | if (status < 0) | 246 | if (status < 0) |
247 | goto fail00; | 247 | goto fail00; |
248 | device_init_wakeup(&pdev->dev, 1); | 248 | device_init_wakeup(&pdev->dev, 1); |
@@ -251,7 +251,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) | |||
251 | if (status < 0) | 251 | if (status < 0) |
252 | goto fail0a; | 252 | goto fail0a; |
253 | 253 | ||
254 | if (board->vcc_pin) { | 254 | if (gpio_is_valid(board->vcc_pin)) { |
255 | status = gpio_request(board->vcc_pin, "cf_vcc"); | 255 | status = gpio_request(board->vcc_pin, "cf_vcc"); |
256 | if (status < 0) | 256 | if (status < 0) |
257 | goto fail0b; | 257 | goto fail0b; |
@@ -263,15 +263,15 @@ static int __init at91_cf_probe(struct platform_device *pdev) | |||
263 | * unless we report that we handle everything (sigh). | 263 | * unless we report that we handle everything (sigh). |
264 | * (Note: DK board doesn't wire the IRQ pin...) | 264 | * (Note: DK board doesn't wire the IRQ pin...) |
265 | */ | 265 | */ |
266 | if (board->irq_pin) { | 266 | if (gpio_is_valid(board->irq_pin)) { |
267 | status = gpio_request(board->irq_pin, "cf_irq"); | 267 | status = gpio_request(board->irq_pin, "cf_irq"); |
268 | if (status < 0) | 268 | if (status < 0) |
269 | goto fail0c; | 269 | goto fail0c; |
270 | status = request_irq(board->irq_pin, at91_cf_irq, | 270 | status = request_irq(gpio_to_irq(board->irq_pin), at91_cf_irq, |
271 | IRQF_SHARED, driver_name, cf); | 271 | IRQF_SHARED, driver_name, cf); |
272 | if (status < 0) | 272 | if (status < 0) |
273 | goto fail0d; | 273 | goto fail0d; |
274 | cf->socket.pci_irq = board->irq_pin; | 274 | cf->socket.pci_irq = gpio_to_irq(board->irq_pin); |
275 | } else | 275 | } else |
276 | cf->socket.pci_irq = nr_irqs + 1; | 276 | cf->socket.pci_irq = nr_irqs + 1; |
277 | 277 | ||
@@ -290,7 +290,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) | |||
290 | } | 290 | } |
291 | 291 | ||
292 | pr_info("%s: irqs det #%d, io #%d\n", driver_name, | 292 | pr_info("%s: irqs det #%d, io #%d\n", driver_name, |
293 | board->det_pin, board->irq_pin); | 293 | gpio_to_irq(board->det_pin), gpio_to_irq(board->irq_pin)); |
294 | 294 | ||
295 | cf->socket.owner = THIS_MODULE; | 295 | cf->socket.owner = THIS_MODULE; |
296 | cf->socket.dev.parent = &pdev->dev; | 296 | cf->socket.dev.parent = &pdev->dev; |
@@ -312,19 +312,19 @@ fail2: | |||
312 | fail1: | 312 | fail1: |
313 | if (cf->socket.io_offset) | 313 | if (cf->socket.io_offset) |
314 | iounmap((void __iomem *) cf->socket.io_offset); | 314 | iounmap((void __iomem *) cf->socket.io_offset); |
315 | if (board->irq_pin) { | 315 | if (gpio_is_valid(board->irq_pin)) { |
316 | free_irq(board->irq_pin, cf); | 316 | free_irq(gpio_to_irq(board->irq_pin), cf); |
317 | fail0d: | 317 | fail0d: |
318 | gpio_free(board->irq_pin); | 318 | gpio_free(board->irq_pin); |
319 | } | 319 | } |
320 | fail0c: | 320 | fail0c: |
321 | if (board->vcc_pin) | 321 | if (gpio_is_valid(board->vcc_pin)) |
322 | gpio_free(board->vcc_pin); | 322 | gpio_free(board->vcc_pin); |
323 | fail0b: | 323 | fail0b: |
324 | gpio_free(board->rst_pin); | 324 | gpio_free(board->rst_pin); |
325 | fail0a: | 325 | fail0a: |
326 | device_init_wakeup(&pdev->dev, 0); | 326 | device_init_wakeup(&pdev->dev, 0); |
327 | free_irq(board->det_pin, cf); | 327 | free_irq(gpio_to_irq(board->det_pin), cf); |
328 | fail00: | 328 | fail00: |
329 | gpio_free(board->det_pin); | 329 | gpio_free(board->det_pin); |
330 | fail0: | 330 | fail0: |
@@ -341,15 +341,15 @@ static int __exit at91_cf_remove(struct platform_device *pdev) | |||
341 | pcmcia_unregister_socket(&cf->socket); | 341 | pcmcia_unregister_socket(&cf->socket); |
342 | release_mem_region(io->start, resource_size(io)); | 342 | release_mem_region(io->start, resource_size(io)); |
343 | iounmap((void __iomem *) cf->socket.io_offset); | 343 | iounmap((void __iomem *) cf->socket.io_offset); |
344 | if (board->irq_pin) { | 344 | if (gpio_is_valid(board->irq_pin)) { |
345 | free_irq(board->irq_pin, cf); | 345 | free_irq(gpio_to_irq(board->irq_pin), cf); |
346 | gpio_free(board->irq_pin); | 346 | gpio_free(board->irq_pin); |
347 | } | 347 | } |
348 | if (board->vcc_pin) | 348 | if (gpio_is_valid(board->vcc_pin)) |
349 | gpio_free(board->vcc_pin); | 349 | gpio_free(board->vcc_pin); |
350 | gpio_free(board->rst_pin); | 350 | gpio_free(board->rst_pin); |
351 | device_init_wakeup(&pdev->dev, 0); | 351 | device_init_wakeup(&pdev->dev, 0); |
352 | free_irq(board->det_pin, cf); | 352 | free_irq(gpio_to_irq(board->det_pin), cf); |
353 | gpio_free(board->det_pin); | 353 | gpio_free(board->det_pin); |
354 | kfree(cf); | 354 | kfree(cf); |
355 | return 0; | 355 | return 0; |
@@ -363,9 +363,9 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
363 | struct at91_cf_data *board = cf->board; | 363 | struct at91_cf_data *board = cf->board; |
364 | 364 | ||
365 | if (device_may_wakeup(&pdev->dev)) { | 365 | if (device_may_wakeup(&pdev->dev)) { |
366 | enable_irq_wake(board->det_pin); | 366 | enable_irq_wake(gpio_to_irq(board->det_pin)); |
367 | if (board->irq_pin) | 367 | if (gpio_is_valid(board->irq_pin)) |
368 | enable_irq_wake(board->irq_pin); | 368 | enable_irq_wake(gpio_to_irq(board->irq_pin)); |
369 | } | 369 | } |
370 | return 0; | 370 | return 0; |
371 | } | 371 | } |
@@ -376,9 +376,9 @@ static int at91_cf_resume(struct platform_device *pdev) | |||
376 | struct at91_cf_data *board = cf->board; | 376 | struct at91_cf_data *board = cf->board; |
377 | 377 | ||
378 | if (device_may_wakeup(&pdev->dev)) { | 378 | if (device_may_wakeup(&pdev->dev)) { |
379 | disable_irq_wake(board->det_pin); | 379 | disable_irq_wake(gpio_to_irq(board->det_pin)); |
380 | if (board->irq_pin) | 380 | if (gpio_is_valid(board->irq_pin)) |
381 | disable_irq_wake(board->irq_pin); | 381 | disable_irq_wake(gpio_to_irq(board->irq_pin)); |
382 | } | 382 | } |
383 | 383 | ||
384 | return 0; | 384 | return 0; |