diff options
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 24 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 3 |
2 files changed, 25 insertions, 2 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 62dd92270525..130a57351c69 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * USB Serial Converter driver | 2 | * USB Serial Converter driver |
3 | * | 3 | * |
4 | * Copyright (C) 1999 - 2005 Greg Kroah-Hartman (greg@kroah.com) | 4 | * Copyright (C) 1999 - 2012 Greg Kroah-Hartman (greg@kroah.com) |
5 | * Copyright (C) 2000 Peter Berger (pberger@brimson.com) | 5 | * Copyright (C) 2000 Peter Berger (pberger@brimson.com) |
6 | * Copyright (C) 2000 Al Borchers (borchers@steinerpoint.com) | 6 | * Copyright (C) 2000 Al Borchers (borchers@steinerpoint.com) |
7 | * | 7 | * |
@@ -1166,6 +1166,20 @@ int usb_serial_resume(struct usb_interface *intf) | |||
1166 | } | 1166 | } |
1167 | EXPORT_SYMBOL(usb_serial_resume); | 1167 | EXPORT_SYMBOL(usb_serial_resume); |
1168 | 1168 | ||
1169 | static int usb_serial_reset_resume(struct usb_interface *intf) | ||
1170 | { | ||
1171 | struct usb_serial *serial = usb_get_intfdata(intf); | ||
1172 | int rv; | ||
1173 | |||
1174 | serial->suspending = 0; | ||
1175 | if (serial->type->reset_resume) | ||
1176 | rv = serial->type->reset_resume(serial); | ||
1177 | else | ||
1178 | rv = usb_serial_generic_resume(serial); | ||
1179 | |||
1180 | return rv; | ||
1181 | } | ||
1182 | |||
1169 | static const struct tty_operations serial_ops = { | 1183 | static const struct tty_operations serial_ops = { |
1170 | .open = serial_open, | 1184 | .open = serial_open, |
1171 | .close = serial_close, | 1185 | .close = serial_close, |
@@ -1403,6 +1417,14 @@ int usb_serial_register_drivers(struct usb_serial_driver *const serial_drivers[] | |||
1403 | udriver->resume = usb_serial_resume; | 1417 | udriver->resume = usb_serial_resume; |
1404 | udriver->probe = usb_serial_probe; | 1418 | udriver->probe = usb_serial_probe; |
1405 | udriver->disconnect = usb_serial_disconnect; | 1419 | udriver->disconnect = usb_serial_disconnect; |
1420 | |||
1421 | /* we only set the reset_resume field if the serial_driver has one */ | ||
1422 | for (sd = serial_drivers; *sd; ++sd) { | ||
1423 | if ((*sd)->reset_resume) | ||
1424 | udriver->reset_resume = usb_serial_reset_resume; | ||
1425 | break; | ||
1426 | } | ||
1427 | |||
1406 | rc = usb_register(udriver); | 1428 | rc = usb_register(udriver); |
1407 | if (rc) | 1429 | if (rc) |
1408 | return rc; | 1430 | return rc; |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index c9f65146a039..86c0b451745d 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * USB Serial Converter stuff | 2 | * USB Serial Converter stuff |
3 | * | 3 | * |
4 | * Copyright (C) 1999 - 2005 | 4 | * Copyright (C) 1999 - 2012 |
5 | * Greg Kroah-Hartman (greg@kroah.com) | 5 | * Greg Kroah-Hartman (greg@kroah.com) |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -249,6 +249,7 @@ struct usb_serial_driver { | |||
249 | 249 | ||
250 | int (*suspend)(struct usb_serial *serial, pm_message_t message); | 250 | int (*suspend)(struct usb_serial *serial, pm_message_t message); |
251 | int (*resume)(struct usb_serial *serial); | 251 | int (*resume)(struct usb_serial *serial); |
252 | int (*reset_resume)(struct usb_serial *serial); | ||
252 | 253 | ||
253 | /* serial function calls */ | 254 | /* serial function calls */ |
254 | /* Called by console and by the tty layer */ | 255 | /* Called by console and by the tty layer */ |