[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>

authored by David Brownell and committed by Dominik Brodowski 1fbece15 9eed2867

+7 -18
+7 -18
drivers/pcmcia/at91_cf.c
··· 241 241 csa = at91_sys_read(AT91_EBI_CSA); 242 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 244 /* nWAIT is _not_ a default setting */ 251 245 (void) at91_set_A_periph(AT91_PIN_PC6, 1); /* nWAIT */ 252 246 ··· 316 322 if (board->irq_pin) 317 323 free_irq(board->irq_pin, cf); 318 324 fail0a: 325 + device_init_wakeup(&pdev->dev, 0); 319 326 free_irq(board->det_pin, cf); 320 327 device_init_wakeup(&pdev->dev, 0); 321 328 fail0: ··· 355 360 struct at91_cf_data *board = cf->board; 356 361 357 362 pcmcia_socket_dev_suspend(&pdev->dev, mesg); 358 - if (device_may_wakeup(&pdev->dev)) 363 + if (device_may_wakeup(&pdev->dev)) { 359 364 enable_irq_wake(board->det_pin); 360 - else { 365 + if (board->irq_pin) 366 + enable_irq_wake(board->irq_pin); 367 + } else { 361 368 disable_irq_wake(board->det_pin); 362 - disable_irq(board->det_pin); 369 + if (board->irq_pin) 370 + disable_irq_wake(board->irq_pin); 363 371 } 364 - if (board->irq_pin) 365 - disable_irq(board->irq_pin); 366 372 return 0; 367 373 } 368 374 369 375 static int at91_cf_resume(struct platform_device *pdev) 370 376 { 371 - struct at91_cf_socket *cf = platform_get_drvdata(pdev); 372 - struct at91_cf_data *board = cf->board; 373 - 374 - if (board->irq_pin) 375 - enable_irq(board->irq_pin); 376 - if (!device_may_wakeup(&pdev->dev)) 377 - enable_irq(board->det_pin); 378 377 pcmcia_socket_dev_resume(&pdev->dev); 379 378 return 0; 380 379 }