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