diff mbox

[RFC/RFT,2/5] USB: usbtouch: Implement reset_resume()

Message ID 201003121542.11340.oliver@neukum.org (mailing list archive)
State New, archived
Headers show

Commit Message

Oliver Neukum March 12, 2010, 2:42 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 6db0a03..8836761 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1310,6 +1310,26 @@  static int usbtouch_resume(struct usb_interface *intf)
 	return rv;
 }
 
+static int usbtouch_reset_resume(struct usb_interface *intf)
+{
+	struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
+	int rv;
+
+	/* device specific init */
+	if (usbtouch->type->init) {
+		rv = usbtouch->type->init(usbtouch);
+		if (rv) {
+			dbg("%s - type->init() failed, err: %d", __func__, rv);
+			goto err_out;
+		}
+	}
+	
+	rv = usbtouch_resume(intf);
+
+err_out:
+	return rv;
+}
+
 static void usbtouch_free_buffers(struct usb_device *udev,
 				  struct usbtouch_usb *usbtouch)
 {
@@ -1501,6 +1521,7 @@  static struct usb_driver usbtouch_driver = {
 	.disconnect	= usbtouch_disconnect,
 	.suspend	= usbtouch_suspend,
 	.resume		= usbtouch_resume,
+	.reset_resume	= usbtouch_reset_resume,
 	.id_table	= usbtouch_devices,
 };