linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 6/8] usbtouchscreen: fix NEXIO ACK and USB disconnect
@ 2009-12-22  0:23 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2009-12-22  0:23 UTC (permalink / raw)
  To: dtor
  Cc: linux-input, akpm, linux, daniel.ritz, ddstreet, dmitry.torokhov,
	floe, greg, jim-linux, oliver

From: Ondrej Zary <linux@rainbow-software.org>

Fix sending ACK urbs and oops on USB disconnecting NEXIO touchscreen.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jim Persson <jim-linux@nurd.se>
Cc: Florian Echtler <floe@butterbrot.org>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Daniel Ritz <daniel.ritz@gmx.ch>
Cc: Greg KH <greg@kroah.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/input/touchscreen/usbtouchscreen.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff -puN drivers/input/touchscreen/usbtouchscreen.c~usbtouchscreen-fix-nexio-ack-and-usb-disconnect drivers/input/touchscreen/usbtouchscreen.c
--- a/drivers/input/touchscreen/usbtouchscreen.c~usbtouchscreen-fix-nexio-ack-and-usb-disconnect
+++ a/drivers/input/touchscreen/usbtouchscreen.c
@@ -728,6 +728,10 @@ struct nexio_touch_packet {
 static unsigned char nexio_ack_pkt[2] = { 0xaa, 0x02 };
 static unsigned char nexio_init_pkt[4] = { 0x82, 0x04, 0x0a, 0x0f };
 
+static void nexio_ack_complete(struct urb *urb)
+{
+}
+
 static int nexio_init(struct usbtouch_usb *usbtouch)
 {
 	struct usb_device *dev = interface_to_usbdev(usbtouch->interface);
@@ -811,8 +815,8 @@ static int nexio_init(struct usbtouch_us
 		goto err_ack_buf;
 	}
 	usb_fill_bulk_urb(priv->ack, dev, usb_sndbulkpipe(dev, output_ep),
-			  priv->ack_buf, sizeof(priv->ack_buf), NULL,
-			  usbtouch);
+			  priv->ack_buf, sizeof(nexio_ack_pkt),
+			  nexio_ack_complete, usbtouch);
 	ret = 0;
 	goto out_buf;
 err_ack_buf:
@@ -1227,6 +1231,7 @@ static void usbtouch_irq(struct urb *urb
 	case -ECONNRESET:
 	case -ENOENT:
 	case -ESHUTDOWN:
+	case -EPIPE:
 		/* this urb is terminated, clean up */
 		dbg("%s - urb shutting down with status: %d",
 		    __func__, urb->status);
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-22  0:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-22  0:23 [patch 6/8] usbtouchscreen: fix NEXIO ACK and USB disconnect akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).