aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-07-01 16:39:55 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2006-10-25 21:59:37 -0400
commit1fbece150a230d0ab447cfb2fc4df10fb89f0d8c (patch)
treedf0be71e6d75fd22dd964a84b708403560a10e64 /drivers/pcmcia
parent9eed28679282238210ad5e80bb91df30fec6d7db (diff)
[PATCH] pcmcia: at91_cf update
More correct AT91 CF wakeup logic ... only enable/disable the IRQ wakeup capability, not the IRQ itself. That way the we know that the IRQ will be disabled correctly, in suspend/resume logic instead of ARM IRQ code. Most of the pin multiplexing setup has moved to the devices.c setup code. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/at91_cf.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 7f5df9a9f393..f8db6e342cbb 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
@@ -322,6 +316,7 @@ fail1:
322 if (board->irq_pin) 316 if (board->irq_pin)
323 free_irq(board->irq_pin, cf); 317 free_irq(board->irq_pin, cf);
324fail0a: 318fail0a:
319 device_init_wakeup(&pdev->dev, 0);
325 free_irq(board->det_pin, cf); 320 free_irq(board->det_pin, cf);
326 device_init_wakeup(&pdev->dev, 0); 321 device_init_wakeup(&pdev->dev, 0);
327fail0: 322fail0:
@@ -360,26 +355,20 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
360 struct at91_cf_data *board = cf->board; 355 struct at91_cf_data *board = cf->board;
361 356
362 pcmcia_socket_dev_suspend(&pdev->dev, mesg); 357 pcmcia_socket_dev_suspend(&pdev->dev, mesg);
363 if (device_may_wakeup(&pdev->dev)) 358 if (device_may_wakeup(&pdev->dev)) {
364 enable_irq_wake(board->det_pin); 359 enable_irq_wake(board->det_pin);
365 else { 360 if (board->irq_pin)
361 enable_irq_wake(board->irq_pin);
362 } else {
366 disable_irq_wake(board->det_pin); 363 disable_irq_wake(board->det_pin);
367 disable_irq(board->det_pin); 364 if (board->irq_pin)
365 disable_irq_wake(board->irq_pin);
368 } 366 }
369 if (board->irq_pin)
370 disable_irq(board->irq_pin);
371 return 0; 367 return 0;
372} 368}
373 369
374static int at91_cf_resume(struct platform_device *pdev) 370static int at91_cf_resume(struct platform_device *pdev)
375{ 371{
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); 372 pcmcia_socket_dev_resume(&pdev->dev);
384 return 0; 373 return 0;
385} 374}