Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144414
b: refs/heads/master
c: 0385c5e
h: refs/heads/master
v: v3
  • Loading branch information
Bob Copeland authored and Dmitry Torokhov committed Apr 28, 2009
1 parent 73c2726 commit c4588f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 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: 384318ecd2eb4fdbcbe7c4df6e8bb55986bf52d4
refs/heads/master: 0385c5ee3ca96bfe244610bf459abf66682ff202
24 changes: 18 additions & 6 deletions trunk/drivers/input/mouse/appletouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,23 +255,31 @@ MODULE_PARM_DESC(debug, "Activate debugging output");
*/
static int atp_geyser_init(struct usb_device *udev)
{
char data[8];
char *data;
int size;
int i;
int ret;

data = kmalloc(8, GFP_KERNEL);
if (!data) {
err("Out of memory");
return -ENOMEM;
}

size = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
ATP_GEYSER_MODE_READ_REQUEST_ID,
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
ATP_GEYSER_MODE_REQUEST_VALUE,
ATP_GEYSER_MODE_REQUEST_INDEX, &data, 8, 5000);
ATP_GEYSER_MODE_REQUEST_INDEX, data, 8, 5000);

if (size != 8) {
dprintk("atp_geyser_init: read error\n");
for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]);

err("Failed to read mode from device.");
return -EIO;
ret = -EIO;
goto out_free;
}

/* Apply the mode switch */
Expand All @@ -281,17 +289,21 @@ static int atp_geyser_init(struct usb_device *udev)
ATP_GEYSER_MODE_WRITE_REQUEST_ID,
USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
ATP_GEYSER_MODE_REQUEST_VALUE,
ATP_GEYSER_MODE_REQUEST_INDEX, &data, 8, 5000);
ATP_GEYSER_MODE_REQUEST_INDEX, data, 8, 5000);

if (size != 8) {
dprintk("atp_geyser_init: write error\n");
for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]);

err("Failed to request geyser raw mode");
return -EIO;
ret = -EIO;
goto out_free;
}
return 0;
ret = 0;
out_free:
kfree(data);
return ret;
}

/*
Expand Down

0 comments on commit c4588f8

Please sign in to comment.