diff options
author | Francesco Lavra <francescolavra@interfree.it> | 2009-12-08 03:54:11 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:53:07 -0500 |
commit | a91b0c502285fd0c569fae1222fdd945ef739233 (patch) | |
tree | b8aa93dca7ff9f2c7a7764cd6c9820e1570ed8d7 /drivers/usb/class/cdc-acm.c | |
parent | af2ac1a091bc8bee73d7837b73ebfb00b917aece (diff) |
cdc_acm: add reset_resume method
Add reset resume logic to the cdc acm driver
Signed-off-by: Francesco Lavra <francescolavra@interfree.it>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 34d4eb98829e..ef2e6f9c8906 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1460,6 +1460,23 @@ err_out: | |||
1460 | return rv; | 1460 | return rv; |
1461 | } | 1461 | } |
1462 | 1462 | ||
1463 | static int acm_reset_resume(struct usb_interface *intf) | ||
1464 | { | ||
1465 | struct acm *acm = usb_get_intfdata(intf); | ||
1466 | struct tty_struct *tty; | ||
1467 | |||
1468 | mutex_lock(&acm->mutex); | ||
1469 | if (acm->port.count) { | ||
1470 | tty = tty_port_tty_get(&acm->port); | ||
1471 | if (tty) { | ||
1472 | tty_hangup(tty); | ||
1473 | tty_kref_put(tty); | ||
1474 | } | ||
1475 | } | ||
1476 | mutex_unlock(&acm->mutex); | ||
1477 | return acm_resume(intf); | ||
1478 | } | ||
1479 | |||
1463 | #endif /* CONFIG_PM */ | 1480 | #endif /* CONFIG_PM */ |
1464 | 1481 | ||
1465 | #define NOKIA_PCSUITE_ACM_INFO(x) \ | 1482 | #define NOKIA_PCSUITE_ACM_INFO(x) \ |
@@ -1602,6 +1619,7 @@ static struct usb_driver acm_driver = { | |||
1602 | #ifdef CONFIG_PM | 1619 | #ifdef CONFIG_PM |
1603 | .suspend = acm_suspend, | 1620 | .suspend = acm_suspend, |
1604 | .resume = acm_resume, | 1621 | .resume = acm_resume, |
1622 | .reset_resume = acm_reset_resume, | ||
1605 | #endif | 1623 | #endif |
1606 | .id_table = acm_ids, | 1624 | .id_table = acm_ids, |
1607 | #ifdef CONFIG_PM | 1625 | #ifdef CONFIG_PM |