Commit d20c58aa authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: fix the usb input drivers due to interrupt urb no automatic resubmission...

USB: fix the usb input drivers due to interrupt urb no automatic resubmission change to the usb core.
parent f821cacc
...@@ -134,9 +134,22 @@ aiptek_irq(struct urb *urb) ...@@ -134,9 +134,22 @@ aiptek_irq(struct urb *urb)
int y; int y;
int pressure; int pressure;
int proximity; int proximity;
int retval;
if (urb->status)
switch (urb->status) {
case 0:
/* success */
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
return; return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
goto exit;
}
if ((data[0] & 2) == 0) { if ((data[0] & 2) == 0) {
dbg("received unknown report #%d", data[0]); dbg("received unknown report #%d", data[0]);
...@@ -165,6 +178,11 @@ aiptek_irq(struct urb *urb) ...@@ -165,6 +178,11 @@ aiptek_irq(struct urb *urb)
input_sync(dev); input_sync(dev);
exit:
retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval)
err ("%s - usb_submit_urb failed with result %d",
__FUNCTION__, retval);
} }
struct aiptek_features aiptek_features[] = { struct aiptek_features aiptek_features[] = {
......
...@@ -78,14 +78,33 @@ static void powermate_config_complete(struct urb *urb); /* forward declararation ...@@ -78,14 +78,33 @@ static void powermate_config_complete(struct urb *urb); /* forward declararation
static void powermate_irq(struct urb *urb) static void powermate_irq(struct urb *urb)
{ {
struct powermate_device *pm = urb->context; struct powermate_device *pm = urb->context;
int retval;
if (urb->status)
switch (urb->status) {
case 0:
/* success */
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
return; return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
goto exit;
}
/* handle updates to device state */ /* handle updates to device state */
input_report_key(&pm->input, BTN_0, pm->data[0] & 0x01); input_report_key(&pm->input, BTN_0, pm->data[0] & 0x01);
input_report_rel(&pm->input, REL_DIAL, pm->data[1]); input_report_rel(&pm->input, REL_DIAL, pm->data[1]);
input_sync(&pm->input); input_sync(&pm->input);
exit:
retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval)
err ("%s - usb_submit_urb failed with result %d",
__FUNCTION__, retval);
} }
/* Decide if we need to issue a control message and do so. Must be called with pm->lock down */ /* Decide if we need to issue a control message and do so. Must be called with pm->lock down */
......
...@@ -108,8 +108,22 @@ static void wacom_pl_irq(struct urb *urb) ...@@ -108,8 +108,22 @@ static void wacom_pl_irq(struct urb *urb)
unsigned char *data = wacom->data; unsigned char *data = wacom->data;
struct input_dev *dev = &wacom->dev; struct input_dev *dev = &wacom->dev;
int prox, pressure; int prox, pressure;
int retval;
if (urb->status) return;
switch (urb->status) {
case 0:
/* success */
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
goto exit;
}
if (data[0] != 2) if (data[0] != 2)
dbg("received unknown report #%d", data[0]); dbg("received unknown report #%d", data[0]);
...@@ -135,6 +149,12 @@ static void wacom_pl_irq(struct urb *urb) ...@@ -135,6 +149,12 @@ static void wacom_pl_irq(struct urb *urb)
} }
input_sync(dev); input_sync(dev);
exit:
retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval)
err ("%s - usb_submit_urb failed with result %d",
__FUNCTION__, retval);
} }
static void wacom_penpartner_irq(struct urb *urb) static void wacom_penpartner_irq(struct urb *urb)
...@@ -142,8 +162,22 @@ static void wacom_penpartner_irq(struct urb *urb) ...@@ -142,8 +162,22 @@ static void wacom_penpartner_irq(struct urb *urb)
struct wacom *wacom = urb->context; struct wacom *wacom = urb->context;
unsigned char *data = wacom->data; unsigned char *data = wacom->data;
struct input_dev *dev = &wacom->dev; struct input_dev *dev = &wacom->dev;
int retval;
if (urb->status) return;
switch (urb->status) {
case 0:
/* success */
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
goto exit;
}
input_report_key(dev, BTN_TOOL_PEN, 1); input_report_key(dev, BTN_TOOL_PEN, 1);
input_report_abs(dev, ABS_X, data[2] << 8 | data[1]); input_report_abs(dev, ABS_X, data[2] << 8 | data[1]);
...@@ -152,6 +186,12 @@ static void wacom_penpartner_irq(struct urb *urb) ...@@ -152,6 +186,12 @@ static void wacom_penpartner_irq(struct urb *urb)
input_report_key(dev, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20)); input_report_key(dev, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20));
input_report_key(dev, BTN_STYLUS, (data[5] & 0x40)); input_report_key(dev, BTN_STYLUS, (data[5] & 0x40));
input_sync(dev); input_sync(dev);
exit:
retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval)
err ("%s - usb_submit_urb failed with result %d",
__FUNCTION__, retval);
} }
static void wacom_graphire_irq(struct urb *urb) static void wacom_graphire_irq(struct urb *urb)
...@@ -160,8 +200,22 @@ static void wacom_graphire_irq(struct urb *urb) ...@@ -160,8 +200,22 @@ static void wacom_graphire_irq(struct urb *urb)
unsigned char *data = wacom->data; unsigned char *data = wacom->data;
struct input_dev *dev = &wacom->dev; struct input_dev *dev = &wacom->dev;
int x, y; int x, y;
int retval;
if (urb->status) return;
switch (urb->status) {
case 0:
/* success */
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
goto exit;
}
if (data[0] != 2) if (data[0] != 2)
dbg("received unknown report #%d", data[0]); dbg("received unknown report #%d", data[0]);
...@@ -191,7 +245,7 @@ static void wacom_graphire_irq(struct urb *urb) ...@@ -191,7 +245,7 @@ static void wacom_graphire_irq(struct urb *urb)
input_report_abs(dev, ABS_Y, y); input_report_abs(dev, ABS_Y, y);
input_sync(dev); input_sync(dev);
return; goto exit;
} }
if (data[1] & 0x80) { if (data[1] & 0x80) {
...@@ -205,6 +259,12 @@ static void wacom_graphire_irq(struct urb *urb) ...@@ -205,6 +259,12 @@ static void wacom_graphire_irq(struct urb *urb)
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
input_sync(dev); input_sync(dev);
exit:
retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval)
err ("%s - usb_submit_urb failed with result %d",
__FUNCTION__, retval);
} }
static void wacom_intuos_irq(struct urb *urb) static void wacom_intuos_irq(struct urb *urb)
...@@ -214,8 +274,22 @@ static void wacom_intuos_irq(struct urb *urb) ...@@ -214,8 +274,22 @@ static void wacom_intuos_irq(struct urb *urb)
struct input_dev *dev = &wacom->dev; struct input_dev *dev = &wacom->dev;
unsigned int t; unsigned int t;
int idx; int idx;
int retval;
if (urb->status) return;
switch (urb->status) {
case 0:
/* success */
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
goto exit;
}
if (data[0] != 2) if (data[0] != 2)
dbg("received unknown report #%d", data[0]); dbg("received unknown report #%d", data[0]);
...@@ -253,13 +327,13 @@ static void wacom_intuos_irq(struct urb *urb) ...@@ -253,13 +327,13 @@ static void wacom_intuos_irq(struct urb *urb)
input_report_key(dev, wacom->tool[idx], 1); input_report_key(dev, wacom->tool[idx], 1);
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
input_sync(dev); input_sync(dev);
return; goto exit;
} }
if ((data[1] & 0xfe) == 0x80) { /* Exit report */ if ((data[1] & 0xfe) == 0x80) { /* Exit report */
input_report_key(dev, wacom->tool[idx], 0); input_report_key(dev, wacom->tool[idx], 0);
input_sync(dev); input_sync(dev);
return; goto exit;
} }
input_report_abs(dev, ABS_X, ((__u32)data[2] << 8) | data[3]); input_report_abs(dev, ABS_X, ((__u32)data[2] << 8) | data[3]);
...@@ -323,6 +397,12 @@ static void wacom_intuos_irq(struct urb *urb) ...@@ -323,6 +397,12 @@ static void wacom_intuos_irq(struct urb *urb)
} }
input_sync(dev); input_sync(dev);
exit:
retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval)
err ("%s - usb_submit_urb failed with result %d",
__FUNCTION__, retval);
} }
struct wacom_features wacom_features[] = { struct wacom_features wacom_features[] = {
......
...@@ -166,11 +166,30 @@ static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *d ...@@ -166,11 +166,30 @@ static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *d
static void xpad_irq_in(struct urb *urb) static void xpad_irq_in(struct urb *urb)
{ {
struct usb_xpad *xpad = urb->context; struct usb_xpad *xpad = urb->context;
int retval;
if (urb->status) switch (urb->status) {
case 0:
/* success */
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
return; return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
goto exit;
}
xpad_process_packet(xpad, 0, xpad->idata); xpad_process_packet(xpad, 0, xpad->idata);
exit:
retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval)
err ("%s - usb_submit_urb failed with result %d",
__FUNCTION__, retval);
} }
static int xpad_open (struct input_dev *dev) static int xpad_open (struct input_dev *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment