aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/at91_cf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/at91_cf.c')
-rw-r--r--drivers/pcmcia/at91_cf.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 7f5df9a9f393..3bcb7dc32995 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -241,12 +241,6 @@ static int __init at91_cf_probe(struct platform_device *pdev)
241 csa = at91_sys_read(AT91_EBI_CSA); 241 csa = at91_sys_read(AT91_EBI_CSA);
242 at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH); 242 at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH);
243 243
244 /* force poweron defaults for these pins ... */
245 (void) at91_set_A_periph(AT91_PIN_PC9, 0); /* A25/CFRNW */
246 (void) at91_set_A_periph(AT91_PIN_PC10, 0); /* NCS4/CFCS */
247 (void) at91_set_A_periph(AT91_PIN_PC11, 0); /* NCS5/CFCE1 */
248 (void) at91_set_A_periph(AT91_PIN_PC12, 0); /* NCS6/CFCE2 */
249
250 /* nWAIT is _not_ a default setting */ 244 /* nWAIT is _not_ a default setting */
251 (void) at91_set_A_periph(AT91_PIN_PC6, 1); /* nWAIT */ 245 (void) at91_set_A_periph(AT91_PIN_PC6, 1); /* nWAIT */
252 246
@@ -316,12 +310,14 @@ static int __init at91_cf_probe(struct platform_device *pdev)
316 return 0; 310 return 0;
317 311
318fail2: 312fail2:
319 iounmap((void __iomem *) cf->socket.io_offset);
320 release_mem_region(io->start, io->end + 1 - io->start); 313 release_mem_region(io->start, io->end + 1 - io->start);
321fail1: 314fail1:
315 if (cf->socket.io_offset)
316 iounmap((void __iomem *) cf->socket.io_offset);
322 if (board->irq_pin) 317 if (board->irq_pin)
323 free_irq(board->irq_pin, cf); 318 free_irq(board->irq_pin, cf);
324fail0a: 319fail0a:
320 device_init_wakeup(&pdev->dev, 0);
325 free_irq(board->det_pin, cf); 321 free_irq(board->det_pin, cf);
326 device_init_wakeup(&pdev->dev, 0); 322 device_init_wakeup(&pdev->dev, 0);
327fail0: 323fail0:
@@ -360,26 +356,20 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
360 struct at91_cf_data *board = cf->board; 356 struct at91_cf_data *board = cf->board;
361 357
362 pcmcia_socket_dev_suspend(&pdev->dev, mesg); 358 pcmcia_socket_dev_suspend(&pdev->dev, mesg);
363 if (device_may_wakeup(&pdev->dev)) 359 if (device_may_wakeup(&pdev->dev)) {
364 enable_irq_wake(board->det_pin); 360 enable_irq_wake(board->det_pin);
365 else { 361 if (board->irq_pin)
362 enable_irq_wake(board->irq_pin);
363 } else {
366 disable_irq_wake(board->det_pin); 364 disable_irq_wake(board->det_pin);
367 disable_irq(board->det_pin); 365 if (board->irq_pin)
366 disable_irq_wake(board->irq_pin);
368 } 367 }
369 if (board->irq_pin)
370 disable_irq(board->irq_pin);
371 return 0; 368 return 0;
372} 369}
373 370
374static int at91_cf_resume(struct platform_device *pdev) 371static int at91_cf_resume(struct platform_device *pdev)
375{ 372{
376 struct at91_cf_socket *cf = platform_get_drvdata(pdev);
377 struct at91_cf_data *board = cf->board;
378
379 if (board->irq_pin)
380 enable_irq(board->irq_pin);
381 if (!device_may_wakeup(&pdev->dev))
382 enable_irq(board->det_pin);
383 pcmcia_socket_dev_resume(&pdev->dev); 373 pcmcia_socket_dev_resume(&pdev->dev);
384 return 0; 374 return 0;
385} 375}