Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93237
b: refs/heads/master
c: 76d057c
h: refs/heads/master
i:
  93235: edae502
v: v3
  • Loading branch information
Oliver Neukum authored and Dmitry Torokhov committed Apr 4, 2008
1 parent 3b08025 commit cc08e57
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0fab8e04dfe79376b410b48c817f5fe921b345b
refs/heads/master: 76d057ce5a48034c97f604a0a25a87093e072c71
31 changes: 19 additions & 12 deletions trunk/drivers/input/touchscreen/usbtouchscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,19 +396,24 @@ static int gunze_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
static int dmc_tsc10_init(struct usbtouch_usb *usbtouch)
{
struct usb_device *dev = usbtouch->udev;
int ret;
unsigned char buf[2];
int ret = -ENOMEM;
unsigned char *buf;

buf = kmalloc(2, GFP_KERNEL);
if (!buf)
goto err_nobuf;
/* reset */
buf[0] = buf[1] = 0xFF;
ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0),
TSC10_CMD_RESET,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0, 0, buf, 2, USB_CTRL_SET_TIMEOUT);
if (ret < 0)
return ret;
if (buf[0] != 0x06 || buf[1] != 0x00)
return -ENODEV;
goto err_out;
if (buf[0] != 0x06 || buf[1] != 0x00) {
ret = -ENODEV;
goto err_out;
}

/* set coordinate output rate */
buf[0] = buf[1] = 0xFF;
Expand All @@ -417,20 +422,22 @@ static int dmc_tsc10_init(struct usbtouch_usb *usbtouch)
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
TSC10_RATE_150, 0, buf, 2, USB_CTRL_SET_TIMEOUT);
if (ret < 0)
return ret;
goto err_out;
if ((buf[0] != 0x06 || buf[1] != 0x00) &&
(buf[0] != 0x15 || buf[1] != 0x01))
return -ENODEV;
(buf[0] != 0x15 || buf[1] != 0x01)) {
ret = -ENODEV;
goto err_out;
}

/* start sending data */
ret = usb_control_msg(dev, usb_rcvctrlpipe (dev, 0),
TSC10_CMD_DATA1,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
if (ret < 0)
return ret;

return 0;
err_out:
kfree(buf);
err_nobuf:
return ret;
}


Expand Down

0 comments on commit cc08e57

Please sign in to comment.