diff options
Diffstat (limited to 'drivers/scsi/pcmcia/fdomain_stub.c')
-rw-r--r-- | drivers/scsi/pcmcia/fdomain_stub.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index db8f5cd85ffe..9e1d68c14694 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c | |||
@@ -256,6 +256,30 @@ static void fdomain_release(dev_link_t *link) | |||
256 | 256 | ||
257 | /*====================================================================*/ | 257 | /*====================================================================*/ |
258 | 258 | ||
259 | static int fdomain_suspend(struct pcmcia_device *dev) | ||
260 | { | ||
261 | dev_link_t *link = dev_to_instance(dev); | ||
262 | |||
263 | link->state |= DEV_SUSPEND; | ||
264 | if (link->state & DEV_CONFIG) | ||
265 | pcmcia_release_configuration(link->handle); | ||
266 | |||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | static int fdomain_resume(struct pcmcia_device *dev) | ||
271 | { | ||
272 | dev_link_t *link = dev_to_instance(dev); | ||
273 | |||
274 | link->state &= ~DEV_SUSPEND; | ||
275 | if (link->state & DEV_CONFIG) { | ||
276 | pcmcia_request_configuration(link->handle, &link->conf); | ||
277 | fdomain_16x0_bus_reset(NULL); | ||
278 | } | ||
279 | |||
280 | return 0; | ||
281 | } | ||
282 | |||
259 | static int fdomain_event(event_t event, int priority, | 283 | static int fdomain_event(event_t event, int priority, |
260 | event_callback_args_t *args) | 284 | event_callback_args_t *args) |
261 | { | 285 | { |
@@ -273,22 +297,6 @@ static int fdomain_event(event_t event, int priority, | |||
273 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 297 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
274 | fdomain_config(link); | 298 | fdomain_config(link); |
275 | break; | 299 | break; |
276 | case CS_EVENT_PM_SUSPEND: | ||
277 | link->state |= DEV_SUSPEND; | ||
278 | /* Fall through... */ | ||
279 | case CS_EVENT_RESET_PHYSICAL: | ||
280 | if (link->state & DEV_CONFIG) | ||
281 | pcmcia_release_configuration(link->handle); | ||
282 | break; | ||
283 | case CS_EVENT_PM_RESUME: | ||
284 | link->state &= ~DEV_SUSPEND; | ||
285 | /* Fall through... */ | ||
286 | case CS_EVENT_CARD_RESET: | ||
287 | if (link->state & DEV_CONFIG) { | ||
288 | pcmcia_request_configuration(link->handle, &link->conf); | ||
289 | fdomain_16x0_bus_reset(NULL); | ||
290 | } | ||
291 | break; | ||
292 | } | 300 | } |
293 | return 0; | 301 | return 0; |
294 | } /* fdomain_event */ | 302 | } /* fdomain_event */ |
@@ -311,6 +319,8 @@ static struct pcmcia_driver fdomain_cs_driver = { | |||
311 | .event = fdomain_event, | 319 | .event = fdomain_event, |
312 | .detach = fdomain_detach, | 320 | .detach = fdomain_detach, |
313 | .id_table = fdomain_ids, | 321 | .id_table = fdomain_ids, |
322 | .suspend = fdomain_suspend, | ||
323 | .resume = fdomain_resume, | ||
314 | }; | 324 | }; |
315 | 325 | ||
316 | static int __init init_fdomain_cs(void) | 326 | static int __init init_fdomain_cs(void) |