aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/elsa_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hisax/elsa_cs.c')
-rw-r--r--drivers/isdn/hisax/elsa_cs.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 6fc6868de0b0..0cbe04593d87 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -447,6 +447,32 @@ static void elsa_cs_release(dev_link_t *link)
447 link->state &= ~DEV_CONFIG; 447 link->state &= ~DEV_CONFIG;
448} /* elsa_cs_release */ 448} /* elsa_cs_release */
449 449
450static int elsa_suspend(struct pcmcia_device *p_dev)
451{
452 dev_link_t *link = dev_to_instance(p_dev);
453 local_info_t *dev = link->priv;
454
455 link->state |= DEV_SUSPEND;
456 dev->busy = 1;
457 if (link->state & DEV_CONFIG)
458 pcmcia_release_configuration(link->handle);
459
460 return 0;
461}
462
463static int elsa_resume(struct pcmcia_device *p_dev)
464{
465 dev_link_t *link = dev_to_instance(p_dev);
466 local_info_t *dev = link->priv;
467
468 link->state &= ~DEV_SUSPEND;
469 if (link->state & DEV_CONFIG)
470 pcmcia_request_configuration(link->handle, &link->conf);
471 dev->busy = 0;
472
473 return 0;
474}
475
450/*====================================================================== 476/*======================================================================
451 477
452 The card status event handler. Mostly, this schedules other 478 The card status event handler. Mostly, this schedules other
@@ -465,7 +491,6 @@ static int elsa_cs_event(event_t event, int priority,
465 event_callback_args_t *args) 491 event_callback_args_t *args)
466{ 492{
467 dev_link_t *link = args->client_data; 493 dev_link_t *link = args->client_data;
468 local_info_t *dev = link->priv;
469 494
470 DEBUG(1, "elsa_cs_event(%d)\n", event); 495 DEBUG(1, "elsa_cs_event(%d)\n", event);
471 496
@@ -481,23 +506,6 @@ static int elsa_cs_event(event_t event, int priority,
481 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 506 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
482 elsa_cs_config(link); 507 elsa_cs_config(link);
483 break; 508 break;
484 case CS_EVENT_PM_SUSPEND:
485 link->state |= DEV_SUSPEND;
486 /* Fall through... */
487 case CS_EVENT_RESET_PHYSICAL:
488 /* Mark the device as stopped, to block IO until later */
489 dev->busy = 1;
490 if (link->state & DEV_CONFIG)
491 pcmcia_release_configuration(link->handle);
492 break;
493 case CS_EVENT_PM_RESUME:
494 link->state &= ~DEV_SUSPEND;
495 /* Fall through... */
496 case CS_EVENT_CARD_RESET:
497 if (link->state & DEV_CONFIG)
498 pcmcia_request_configuration(link->handle, &link->conf);
499 dev->busy = 0;
500 break;
501 } 509 }
502 return 0; 510 return 0;
503} /* elsa_cs_event */ 511} /* elsa_cs_event */
@@ -518,6 +526,8 @@ static struct pcmcia_driver elsa_cs_driver = {
518 .event = elsa_cs_event, 526 .event = elsa_cs_event,
519 .detach = elsa_cs_detach, 527 .detach = elsa_cs_detach,
520 .id_table = elsa_ids, 528 .id_table = elsa_ids,
529 .suspend = elsa_suspend,
530 .resume = elsa_resume,
521}; 531};
522 532
523static int __init init_elsa_cs(void) 533static int __init init_elsa_cs(void)