diff options
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/parport_cs.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index 24e6aacddb74..4c89853785ed 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c | |||
@@ -325,6 +325,28 @@ void parport_cs_release(dev_link_t *link) | |||
325 | 325 | ||
326 | } /* parport_cs_release */ | 326 | } /* parport_cs_release */ |
327 | 327 | ||
328 | static int parport_suspend(struct pcmcia_device *dev) | ||
329 | { | ||
330 | dev_link_t *link = dev_to_instance(dev); | ||
331 | |||
332 | link->state |= DEV_SUSPEND; | ||
333 | if (link->state & DEV_CONFIG) | ||
334 | pcmcia_release_configuration(link->handle); | ||
335 | |||
336 | return 0; | ||
337 | } | ||
338 | |||
339 | static int parport_resume(struct pcmcia_device *dev) | ||
340 | { | ||
341 | dev_link_t *link = dev_to_instance(dev); | ||
342 | |||
343 | link->state &= ~DEV_SUSPEND; | ||
344 | if (DEV_OK(link)) | ||
345 | pcmcia_request_configuration(link->handle, &link->conf); | ||
346 | |||
347 | return 0; | ||
348 | } | ||
349 | |||
328 | /*====================================================================== | 350 | /*====================================================================== |
329 | 351 | ||
330 | The card status event handler. Mostly, this schedules other | 352 | The card status event handler. Mostly, this schedules other |
@@ -349,20 +371,6 @@ int parport_event(event_t event, int priority, | |||
349 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 371 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
350 | parport_config(link); | 372 | parport_config(link); |
351 | break; | 373 | break; |
352 | case CS_EVENT_PM_SUSPEND: | ||
353 | link->state |= DEV_SUSPEND; | ||
354 | /* Fall through... */ | ||
355 | case CS_EVENT_RESET_PHYSICAL: | ||
356 | if (link->state & DEV_CONFIG) | ||
357 | pcmcia_release_configuration(link->handle); | ||
358 | break; | ||
359 | case CS_EVENT_PM_RESUME: | ||
360 | link->state &= ~DEV_SUSPEND; | ||
361 | /* Fall through... */ | ||
362 | case CS_EVENT_CARD_RESET: | ||
363 | if (DEV_OK(link)) | ||
364 | pcmcia_request_configuration(link->handle, &link->conf); | ||
365 | break; | ||
366 | } | 374 | } |
367 | return 0; | 375 | return 0; |
368 | } /* parport_event */ | 376 | } /* parport_event */ |
@@ -383,7 +391,8 @@ static struct pcmcia_driver parport_cs_driver = { | |||
383 | .event = parport_event, | 391 | .event = parport_event, |
384 | .detach = parport_detach, | 392 | .detach = parport_detach, |
385 | .id_table = parport_ids, | 393 | .id_table = parport_ids, |
386 | 394 | .suspend = parport_suspend, | |
395 | .resume = parport_resume, | ||
387 | }; | 396 | }; |
388 | 397 | ||
389 | static int __init init_parport_cs(void) | 398 | static int __init init_parport_cs(void) |