aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/itmtouch.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-05-29 03:29:01 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-05-29 03:29:01 -0400
commit05f091ab4c8c1f12f8dd38ee789489904fea327d (patch)
tree6ad1f600921354b3ea834b84f33ce9397f6818a5 /drivers/usb/input/itmtouch.c
parentab0c3443ad2de03383f2549195badf64779d08a1 (diff)
Input: whitespace fixes in drivers/usb/input
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb/input/itmtouch.c')
-rw-r--r--drivers/usb/input/itmtouch.c55
1 files changed, 24 insertions, 31 deletions
diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c
index 4c27c104f63e..5122a7f701a9 100644
--- a/drivers/usb/input/itmtouch.c
+++ b/drivers/usb/input/itmtouch.c
@@ -18,14 +18,14 @@
18 * Based upon original work by Chris Collins <xfire-itmtouch@xware.cx>. 18 * Based upon original work by Chris Collins <xfire-itmtouch@xware.cx>.
19 * 19 *
20 * Kudos to ITM for providing me with the datasheet for the panel, 20 * Kudos to ITM for providing me with the datasheet for the panel,
21 * even though it was a day later than I had finished writing this 21 * even though it was a day later than I had finished writing this
22 * driver. 22 * driver.
23 * 23 *
24 * It has meant that I've been able to correct my interpretation of the 24 * It has meant that I've been able to correct my interpretation of the
25 * protocol packets however. 25 * protocol packets however.
26 * 26 *
27 * CC -- 2003/9/29 27 * CC -- 2003/9/29
28 * 28 *
29 * History 29 * History
30 * 1.0 & 1.1 2003 (CC) vojtech@suse.cz 30 * 1.0 & 1.1 2003 (CC) vojtech@suse.cz
31 * Original version for 2.4.x kernels 31 * Original version for 2.4.x kernels
@@ -33,10 +33,10 @@
33 * 1.2 02/03/2005 (HCE) hc@mivu.no 33 * 1.2 02/03/2005 (HCE) hc@mivu.no
34 * Complete rewrite to support Linux 2.6.10, thanks to mtouchusb.c for hints. 34 * Complete rewrite to support Linux 2.6.10, thanks to mtouchusb.c for hints.
35 * Unfortunately no calibration support at this time. 35 * Unfortunately no calibration support at this time.
36 * 36 *
37 * 1.2.1 09/03/2005 (HCE) hc@mivu.no 37 * 1.2.1 09/03/2005 (HCE) hc@mivu.no
38 * Code cleanup and adjusting syntax to start matching kernel standards 38 * Code cleanup and adjusting syntax to start matching kernel standards
39 * 39 *
40 *****************************************************************************/ 40 *****************************************************************************/
41 41
42#include <linux/config.h> 42#include <linux/config.h>
@@ -71,7 +71,7 @@ MODULE_DESCRIPTION( DRIVER_DESC );
71MODULE_LICENSE( DRIVER_LICENSE ); 71MODULE_LICENSE( DRIVER_LICENSE );
72 72
73struct itmtouch_dev { 73struct itmtouch_dev {
74 struct usb_device *usbdev; /* usb device */ 74 struct usb_device *usbdev; /* usb device */
75 struct input_dev inputdev; /* input device */ 75 struct input_dev inputdev; /* input device */
76 struct urb *readurb; /* urb */ 76 struct urb *readurb; /* urb */
77 char rbuf[ITM_BUFSIZE]; /* data */ 77 char rbuf[ITM_BUFSIZE]; /* data */
@@ -121,7 +121,7 @@ static void itmtouch_irq(struct urb *urb, struct pt_regs *regs)
121 input_report_abs(dev, ABS_X, (data[0] & 0x1F) << 7 | (data[3] & 0x7F)); 121 input_report_abs(dev, ABS_X, (data[0] & 0x1F) << 7 | (data[3] & 0x7F));
122 input_report_abs(dev, ABS_Y, (data[1] & 0x1F) << 7 | (data[4] & 0x7F)); 122 input_report_abs(dev, ABS_Y, (data[1] & 0x1F) << 7 | (data[4] & 0x7F));
123 } 123 }
124 124
125 input_report_abs(dev, ABS_PRESSURE, (data[2] & 1) << 7 | (data[5] & 0x7F)); 125 input_report_abs(dev, ABS_PRESSURE, (data[2] & 1) << 7 | (data[5] & 0x7F));
126 input_report_key(dev, BTN_TOUCH, ~data[7] & 0x20); 126 input_report_key(dev, BTN_TOUCH, ~data[7] & 0x20);
127 input_sync(dev); 127 input_sync(dev);
@@ -142,8 +142,7 @@ static int itmtouch_open(struct input_dev *input)
142 142
143 itmtouch->readurb->dev = itmtouch->usbdev; 143 itmtouch->readurb->dev = itmtouch->usbdev;
144 144
145 if (usb_submit_urb(itmtouch->readurb, GFP_KERNEL)) 145 if (usb_submit_urb(itmtouch->readurb, GFP_KERNEL)) {
146 {
147 itmtouch->users--; 146 itmtouch->users--;
148 return -EIO; 147 return -EIO;
149 } 148 }
@@ -178,13 +177,13 @@ static int itmtouch_probe(struct usb_interface *intf, const struct usb_device_id
178 } 177 }
179 178
180 itmtouch->usbdev = udev; 179 itmtouch->usbdev = udev;
181 180
182 itmtouch->inputdev.private = itmtouch; 181 itmtouch->inputdev.private = itmtouch;
183 itmtouch->inputdev.open = itmtouch_open; 182 itmtouch->inputdev.open = itmtouch_open;
184 itmtouch->inputdev.close = itmtouch_close; 183 itmtouch->inputdev.close = itmtouch_close;
185 184
186 usb_make_path(udev, path, PATH_SIZE); 185 usb_make_path(udev, path, PATH_SIZE);
187 186
188 itmtouch->inputdev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 187 itmtouch->inputdev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
189 itmtouch->inputdev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE); 188 itmtouch->inputdev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE);
190 itmtouch->inputdev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); 189 itmtouch->inputdev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
@@ -194,12 +193,12 @@ static int itmtouch_probe(struct usb_interface *intf, const struct usb_device_id
194 itmtouch->inputdev.id.bustype = BUS_USB; 193 itmtouch->inputdev.id.bustype = BUS_USB;
195 itmtouch->inputdev.id.vendor = udev->descriptor.idVendor; 194 itmtouch->inputdev.id.vendor = udev->descriptor.idVendor;
196 itmtouch->inputdev.id.product = udev->descriptor.idProduct; 195 itmtouch->inputdev.id.product = udev->descriptor.idProduct;
197 itmtouch->inputdev.id.version = udev->descriptor.bcdDevice; 196 itmtouch->inputdev.id.version = udev->descriptor.bcdDevice;
198 itmtouch->inputdev.dev = &intf->dev; 197 itmtouch->inputdev.dev = &intf->dev;
199 198
200 if (!strlen(itmtouch->name)) 199 if (!strlen(itmtouch->name))
201 sprintf(itmtouch->name, "USB ITM touchscreen"); 200 sprintf(itmtouch->name, "USB ITM touchscreen");
202 201
203 /* device limits */ 202 /* device limits */
204 /* as specified by the ITM datasheet, X and Y are 12bit, 203 /* as specified by the ITM datasheet, X and Y are 12bit,
205 * Z (pressure) is 8 bit. However, the fields are defined up 204 * Z (pressure) is 8 bit. However, the fields are defined up
@@ -212,26 +211,20 @@ static int itmtouch_probe(struct usb_interface *intf, const struct usb_device_id
212 /* initialise the URB so we can read from the transport stream */ 211 /* initialise the URB so we can read from the transport stream */
213 pipe = usb_rcvintpipe(itmtouch->usbdev, endpoint->bEndpointAddress); 212 pipe = usb_rcvintpipe(itmtouch->usbdev, endpoint->bEndpointAddress);
214 maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); 213 maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
215 214
216 if (maxp > ITM_BUFSIZE) 215 if (maxp > ITM_BUFSIZE)
217 maxp = ITM_BUFSIZE; 216 maxp = ITM_BUFSIZE;
218 217
219 itmtouch->readurb = usb_alloc_urb(0, GFP_KERNEL); 218 itmtouch->readurb = usb_alloc_urb(0, GFP_KERNEL);
220 219
221 if (!itmtouch->readurb) { 220 if (!itmtouch->readurb) {
222 dbg("%s - usb_alloc_urb failed: itmtouch->readurb", __FUNCTION__); 221 dbg("%s - usb_alloc_urb failed: itmtouch->readurb", __FUNCTION__);
223 kfree(itmtouch); 222 kfree(itmtouch);
224 return -ENOMEM; 223 return -ENOMEM;
225 } 224 }
226 225
227 usb_fill_int_urb(itmtouch->readurb, 226 usb_fill_int_urb(itmtouch->readurb, itmtouch->usbdev, pipe, itmtouch->rbuf,
228 itmtouch->usbdev, 227 maxp, itmtouch_irq, itmtouch, endpoint->bInterval);
229 pipe,
230 itmtouch->rbuf,
231 maxp,
232 itmtouch_irq,
233 itmtouch,
234 endpoint->bInterval);
235 228
236 input_register_device(&itmtouch->inputdev); 229 input_register_device(&itmtouch->inputdev);
237 230
@@ -242,7 +235,7 @@ static int itmtouch_probe(struct usb_interface *intf, const struct usb_device_id
242} 235}
243 236
244static void itmtouch_disconnect(struct usb_interface *intf) 237static void itmtouch_disconnect(struct usb_interface *intf)
245{ 238{
246 struct itmtouch_dev *itmtouch = usb_get_intfdata(intf); 239 struct itmtouch_dev *itmtouch = usb_get_intfdata(intf);
247 240
248 usb_set_intfdata(intf, NULL); 241 usb_set_intfdata(intf, NULL);
@@ -258,11 +251,11 @@ static void itmtouch_disconnect(struct usb_interface *intf)
258MODULE_DEVICE_TABLE(usb, itmtouch_ids); 251MODULE_DEVICE_TABLE(usb, itmtouch_ids);
259 252
260static struct usb_driver itmtouch_driver = { 253static struct usb_driver itmtouch_driver = {
261 .owner = THIS_MODULE, 254 .owner = THIS_MODULE,
262 .name = "itmtouch", 255 .name = "itmtouch",
263 .probe = itmtouch_probe, 256 .probe = itmtouch_probe,
264 .disconnect = itmtouch_disconnect, 257 .disconnect = itmtouch_disconnect,
265 .id_table = itmtouch_ids, 258 .id_table = itmtouch_ids,
266}; 259};
267 260
268static int __init itmtouch_init(void) 261static int __init itmtouch_init(void)