aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-07-04 16:13:55 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-07-04 16:13:55 -0400
commit404c3bc30cb1361e1b3533643326ab472d24a618 (patch)
tree156cc9032c8aee17167d926c5bdae009ba8f36d2 /drivers/input/tablet
parent6795a524f0b049ceb5417d5036ab5e233345b900 (diff)
parent6887a4131da3adaab011613776d865f4bcfb5678 (diff)
Merge commit 'v3.5-rc5' into next
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r--drivers/input/tablet/acecad.c15
-rw-r--r--drivers/input/tablet/aiptek.c28
-rw-r--r--drivers/input/tablet/gtco.c110
-rw-r--r--drivers/input/tablet/kbtab.c15
-rw-r--r--drivers/input/tablet/wacom_sys.c11
5 files changed, 104 insertions, 75 deletions
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index f8b0b1df9138..e062ec899ca1 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -51,6 +51,7 @@ struct usb_acecad {
51 char name[128]; 51 char name[128];
52 char phys[64]; 52 char phys[64];
53 struct usb_device *usbdev; 53 struct usb_device *usbdev;
54 struct usb_interface *intf;
54 struct input_dev *input; 55 struct input_dev *input;
55 struct urb *irq; 56 struct urb *irq;
56 57
@@ -63,6 +64,7 @@ static void usb_acecad_irq(struct urb *urb)
63 struct usb_acecad *acecad = urb->context; 64 struct usb_acecad *acecad = urb->context;
64 unsigned char *data = acecad->data; 65 unsigned char *data = acecad->data;
65 struct input_dev *dev = acecad->input; 66 struct input_dev *dev = acecad->input;
67 struct usb_interface *intf = acecad->intf;
66 int prox, status; 68 int prox, status;
67 69
68 switch (urb->status) { 70 switch (urb->status) {
@@ -73,10 +75,12 @@ static void usb_acecad_irq(struct urb *urb)
73 case -ENOENT: 75 case -ENOENT:
74 case -ESHUTDOWN: 76 case -ESHUTDOWN:
75 /* this urb is terminated, clean up */ 77 /* this urb is terminated, clean up */
76 dbg("%s - urb shutting down with status: %d", __func__, urb->status); 78 dev_dbg(&intf->dev, "%s - urb shutting down with status: %d\n",
79 __func__, urb->status);
77 return; 80 return;
78 default: 81 default:
79 dbg("%s - nonzero urb status received: %d", __func__, urb->status); 82 dev_dbg(&intf->dev, "%s - nonzero urb status received: %d\n",
83 __func__, urb->status);
80 goto resubmit; 84 goto resubmit;
81 } 85 }
82 86
@@ -105,8 +109,10 @@ static void usb_acecad_irq(struct urb *urb)
105resubmit: 109resubmit:
106 status = usb_submit_urb(urb, GFP_ATOMIC); 110 status = usb_submit_urb(urb, GFP_ATOMIC);
107 if (status) 111 if (status)
108 err("can't resubmit intr, %s-%s/input0, status %d", 112 dev_err(&intf->dev,
109 acecad->usbdev->bus->bus_name, acecad->usbdev->devpath, status); 113 "can't resubmit intr, %s-%s/input0, status %d\n",
114 acecad->usbdev->bus->bus_name,
115 acecad->usbdev->devpath, status);
110} 116}
111 117
112static int usb_acecad_open(struct input_dev *dev) 118static int usb_acecad_open(struct input_dev *dev)
@@ -168,6 +174,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
168 } 174 }
169 175
170 acecad->usbdev = dev; 176 acecad->usbdev = dev;
177 acecad->intf = intf;
171 acecad->input = input_dev; 178 acecad->input = input_dev;
172 179
173 if (dev->manufacturer) 180 if (dev->manufacturer)
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index a33d3470c47a..ee83c3904ee8 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -309,6 +309,7 @@ struct aiptek_settings {
309struct aiptek { 309struct aiptek {
310 struct input_dev *inputdev; /* input device struct */ 310 struct input_dev *inputdev; /* input device struct */
311 struct usb_device *usbdev; /* usb device struct */ 311 struct usb_device *usbdev; /* usb device struct */
312 struct usb_interface *intf; /* usb interface struct */
312 struct urb *urb; /* urb for incoming reports */ 313 struct urb *urb; /* urb for incoming reports */
313 dma_addr_t data_dma; /* our dma stuffage */ 314 dma_addr_t data_dma; /* our dma stuffage */
314 struct aiptek_features features; /* tablet's array of features */ 315 struct aiptek_features features; /* tablet's array of features */
@@ -435,6 +436,7 @@ static void aiptek_irq(struct urb *urb)
435 struct aiptek *aiptek = urb->context; 436 struct aiptek *aiptek = urb->context;
436 unsigned char *data = aiptek->data; 437 unsigned char *data = aiptek->data;
437 struct input_dev *inputdev = aiptek->inputdev; 438 struct input_dev *inputdev = aiptek->inputdev;
439 struct usb_interface *intf = aiptek->intf;
438 int jitterable = 0; 440 int jitterable = 0;
439 int retval, macro, x, y, z, left, right, middle, p, dv, tip, bs, pck; 441 int retval, macro, x, y, z, left, right, middle, p, dv, tip, bs, pck;
440 442
@@ -447,13 +449,13 @@ static void aiptek_irq(struct urb *urb)
447 case -ENOENT: 449 case -ENOENT:
448 case -ESHUTDOWN: 450 case -ESHUTDOWN:
449 /* This urb is terminated, clean up */ 451 /* This urb is terminated, clean up */
450 dbg("%s - urb shutting down with status: %d", 452 dev_dbg(&intf->dev, "%s - urb shutting down with status: %d\n",
451 __func__, urb->status); 453 __func__, urb->status);
452 return; 454 return;
453 455
454 default: 456 default:
455 dbg("%s - nonzero urb status received: %d", 457 dev_dbg(&intf->dev, "%s - nonzero urb status received: %d\n",
456 __func__, urb->status); 458 __func__, urb->status);
457 goto exit; 459 goto exit;
458 } 460 }
459 461
@@ -785,7 +787,7 @@ static void aiptek_irq(struct urb *urb)
785 1 | AIPTEK_REPORT_TOOL_UNKNOWN); 787 1 | AIPTEK_REPORT_TOOL_UNKNOWN);
786 input_sync(inputdev); 788 input_sync(inputdev);
787 } else { 789 } else {
788 dbg("Unknown report %d", data[0]); 790 dev_dbg(&intf->dev, "Unknown report %d\n", data[0]);
789 } 791 }
790 792
791 /* Jitter may occur when the user presses a button on the stlyus 793 /* Jitter may occur when the user presses a button on the stlyus
@@ -811,8 +813,9 @@ static void aiptek_irq(struct urb *urb)
811exit: 813exit:
812 retval = usb_submit_urb(urb, GFP_ATOMIC); 814 retval = usb_submit_urb(urb, GFP_ATOMIC);
813 if (retval != 0) { 815 if (retval != 0) {
814 err("%s - usb_submit_urb failed with result %d", 816 dev_err(&intf->dev,
815 __func__, retval); 817 "%s - usb_submit_urb failed with result %d\n",
818 __func__, retval);
816 } 819 }
817} 820}
818 821
@@ -912,8 +915,9 @@ aiptek_command(struct aiptek *aiptek, unsigned char command, unsigned char data)
912 915
913 if ((ret = 916 if ((ret =
914 aiptek_set_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) { 917 aiptek_set_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) {
915 dbg("aiptek_program: failed, tried to send: 0x%02x 0x%02x", 918 dev_dbg(&aiptek->intf->dev,
916 command, data); 919 "aiptek_program: failed, tried to send: 0x%02x 0x%02x\n",
920 command, data);
917 } 921 }
918 kfree(buf); 922 kfree(buf);
919 return ret < 0 ? ret : 0; 923 return ret < 0 ? ret : 0;
@@ -947,8 +951,9 @@ aiptek_query(struct aiptek *aiptek, unsigned char command, unsigned char data)
947 951
948 if ((ret = 952 if ((ret =
949 aiptek_get_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) { 953 aiptek_get_report(aiptek, 3, 2, buf, sizeof_buf)) != sizeof_buf) {
950 dbg("aiptek_query failed: returned 0x%02x 0x%02x 0x%02x", 954 dev_dbg(&aiptek->intf->dev,
951 buf[0], buf[1], buf[2]); 955 "aiptek_query failed: returned 0x%02x 0x%02x 0x%02x\n",
956 buf[0], buf[1], buf[2]);
952 ret = -EIO; 957 ret = -EIO;
953 } else { 958 } else {
954 ret = get_unaligned_le16(buf + 1); 959 ret = get_unaligned_le16(buf + 1);
@@ -1726,6 +1731,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
1726 1731
1727 aiptek->inputdev = inputdev; 1732 aiptek->inputdev = inputdev;
1728 aiptek->usbdev = usbdev; 1733 aiptek->usbdev = usbdev;
1734 aiptek->intf = intf;
1729 aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber; 1735 aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber;
1730 aiptek->inDelay = 0; 1736 aiptek->inDelay = 0;
1731 aiptek->endDelay = 0; 1737 aiptek->endDelay = 0;
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 89a297801dce..29e01ab6859f 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -2,8 +2,6 @@
2 2
3GTCO digitizer USB driver 3GTCO digitizer USB driver
4 4
5Use the err() and dbg() macros from usb.h for system logging
6
7TO CHECK: Is pressure done right on report 5? 5TO CHECK: Is pressure done right on report 5?
8 6
9Copyright (C) 2006 GTCO CalComp 7Copyright (C) 2006 GTCO CalComp
@@ -108,6 +106,7 @@ struct gtco {
108 106
109 struct input_dev *inputdevice; /* input device struct pointer */ 107 struct input_dev *inputdevice; /* input device struct pointer */
110 struct usb_device *usbdev; /* the usb device for this device */ 108 struct usb_device *usbdev; /* the usb device for this device */
109 struct usb_interface *intf; /* the usb interface for this device */
111 struct urb *urbinfo; /* urb for incoming reports */ 110 struct urb *urbinfo; /* urb for incoming reports */
112 dma_addr_t buf_dma; /* dma addr of the data buffer*/ 111 dma_addr_t buf_dma; /* dma addr of the data buffer*/
113 unsigned char * buffer; /* databuffer for reports */ 112 unsigned char * buffer; /* databuffer for reports */
@@ -202,6 +201,7 @@ struct hid_descriptor
202static void parse_hid_report_descriptor(struct gtco *device, char * report, 201static void parse_hid_report_descriptor(struct gtco *device, char * report,
203 int length) 202 int length)
204{ 203{
204 struct device *ddev = &device->intf->dev;
205 int x, i = 0; 205 int x, i = 0;
206 206
207 /* Tag primitive vars */ 207 /* Tag primitive vars */
@@ -228,7 +228,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
228 char indentstr[10] = ""; 228 char indentstr[10] = "";
229 229
230 230
231 dbg("======>>>>>>PARSE<<<<<<======"); 231 dev_dbg(ddev, "======>>>>>>PARSE<<<<<<======\n");
232 232
233 /* Walk this report and pull out the info we need */ 233 /* Walk this report and pull out the info we need */
234 while (i < length) { 234 while (i < length) {
@@ -277,11 +277,11 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
277 else if (data == 3) 277 else if (data == 3)
278 strcpy(globtype, "Var|Const"); 278 strcpy(globtype, "Var|Const");
279 279
280 dbg("::::: Saving Report: %d input #%d Max: 0x%X(%d) Min:0x%X(%d) of %d bits", 280 dev_dbg(ddev, "::::: Saving Report: %d input #%d Max: 0x%X(%d) Min:0x%X(%d) of %d bits\n",
281 globalval[TAG_GLOB_REPORT_ID], inputnum, 281 globalval[TAG_GLOB_REPORT_ID], inputnum,
282 globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX], 282 globalval[TAG_GLOB_LOG_MAX], globalval[TAG_GLOB_LOG_MAX],
283 globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN], 283 globalval[TAG_GLOB_LOG_MIN], globalval[TAG_GLOB_LOG_MIN],
284 globalval[TAG_GLOB_REPORT_SZ] * globalval[TAG_GLOB_REPORT_CNT]); 284 globalval[TAG_GLOB_REPORT_SZ] * globalval[TAG_GLOB_REPORT_CNT]);
285 285
286 286
287 /* 287 /*
@@ -292,7 +292,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
292 */ 292 */
293 switch (inputnum) { 293 switch (inputnum) {
294 case 0: /* X coord */ 294 case 0: /* X coord */
295 dbg("GER: X Usage: 0x%x", usage); 295 dev_dbg(ddev, "GER: X Usage: 0x%x\n", usage);
296 if (device->max_X == 0) { 296 if (device->max_X == 0) {
297 device->max_X = globalval[TAG_GLOB_LOG_MAX]; 297 device->max_X = globalval[TAG_GLOB_LOG_MAX];
298 device->min_X = globalval[TAG_GLOB_LOG_MIN]; 298 device->min_X = globalval[TAG_GLOB_LOG_MIN];
@@ -300,7 +300,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
300 break; 300 break;
301 301
302 case 1: /* Y coord */ 302 case 1: /* Y coord */
303 dbg("GER: Y Usage: 0x%x", usage); 303 dev_dbg(ddev, "GER: Y Usage: 0x%x\n", usage);
304 if (device->max_Y == 0) { 304 if (device->max_Y == 0) {
305 device->max_Y = globalval[TAG_GLOB_LOG_MAX]; 305 device->max_Y = globalval[TAG_GLOB_LOG_MAX];
306 device->min_Y = globalval[TAG_GLOB_LOG_MIN]; 306 device->min_Y = globalval[TAG_GLOB_LOG_MIN];
@@ -350,10 +350,10 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
350 maintype = 'S'; 350 maintype = 'S';
351 351
352 if (data == 0) { 352 if (data == 0) {
353 dbg("======>>>>>> Physical"); 353 dev_dbg(ddev, "======>>>>>> Physical\n");
354 strcpy(globtype, "Physical"); 354 strcpy(globtype, "Physical");
355 } else 355 } else
356 dbg("======>>>>>>"); 356 dev_dbg(ddev, "======>>>>>>\n");
357 357
358 /* Indent the debug output */ 358 /* Indent the debug output */
359 indent++; 359 indent++;
@@ -368,7 +368,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
368 break; 368 break;
369 369
370 case TAG_MAIN_COL_END: 370 case TAG_MAIN_COL_END:
371 dbg("<<<<<<======"); 371 dev_dbg(ddev, "<<<<<<======\n");
372 maintype = 'E'; 372 maintype = 'E';
373 indent--; 373 indent--;
374 for (x = 0; x < indent; x++) 374 for (x = 0; x < indent; x++)
@@ -384,18 +384,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
384 384
385 switch (size) { 385 switch (size) {
386 case 1: 386 case 1:
387 dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", 387 dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
388 indentstr, tag, maintype, size, globtype, data); 388 indentstr, tag, maintype, size, globtype, data);
389 break; 389 break;
390 390
391 case 2: 391 case 2:
392 dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", 392 dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
393 indentstr, tag, maintype, size, globtype, data16); 393 indentstr, tag, maintype, size, globtype, data16);
394 break; 394 break;
395 395
396 case 4: 396 case 4:
397 dbg("%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x", 397 dev_dbg(ddev, "%sMAINTAG:(%d) %c SIZE: %d Data: %s 0x%x\n",
398 indentstr, tag, maintype, size, globtype, data32); 398 indentstr, tag, maintype, size, globtype, data32);
399 break; 399 break;
400 } 400 }
401 break; 401 break;
@@ -465,26 +465,26 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
465 if (tag < TAG_GLOB_MAX) { 465 if (tag < TAG_GLOB_MAX) {
466 switch (size) { 466 switch (size) {
467 case 1: 467 case 1:
468 dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", 468 dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
469 indentstr, globtype, tag, size, data); 469 indentstr, globtype, tag, size, data);
470 globalval[tag] = data; 470 globalval[tag] = data;
471 break; 471 break;
472 472
473 case 2: 473 case 2:
474 dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", 474 dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
475 indentstr, globtype, tag, size, data16); 475 indentstr, globtype, tag, size, data16);
476 globalval[tag] = data16; 476 globalval[tag] = data16;
477 break; 477 break;
478 478
479 case 4: 479 case 4:
480 dbg("%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x", 480 dev_dbg(ddev, "%sGLOBALTAG:%s(%d) SIZE: %d Data: 0x%x\n",
481 indentstr, globtype, tag, size, data32); 481 indentstr, globtype, tag, size, data32);
482 globalval[tag] = data32; 482 globalval[tag] = data32;
483 break; 483 break;
484 } 484 }
485 } else { 485 } else {
486 dbg("%sGLOBALTAG: ILLEGAL TAG:%d SIZE: %d ", 486 dev_dbg(ddev, "%sGLOBALTAG: ILLEGAL TAG:%d SIZE: %d\n",
487 indentstr, tag, size); 487 indentstr, tag, size);
488 } 488 }
489 break; 489 break;
490 490
@@ -511,18 +511,18 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
511 511
512 switch (size) { 512 switch (size) {
513 case 1: 513 case 1:
514 dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", 514 dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
515 indentstr, tag, globtype, size, data); 515 indentstr, tag, globtype, size, data);
516 break; 516 break;
517 517
518 case 2: 518 case 2:
519 dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", 519 dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
520 indentstr, tag, globtype, size, data16); 520 indentstr, tag, globtype, size, data16);
521 break; 521 break;
522 522
523 case 4: 523 case 4:
524 dbg("%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x", 524 dev_dbg(ddev, "%sLOCALTAG:(%d) %s SIZE: %d Data: 0x%x\n",
525 indentstr, tag, globtype, size, data32); 525 indentstr, tag, globtype, size, data32);
526 break; 526 break;
527 } 527 }
528 528
@@ -714,8 +714,9 @@ static void gtco_urb_callback(struct urb *urbinfo)
714 * the rest as 0 714 * the rest as 0
715 */ 715 */
716 val = device->buffer[5] & MASK_BUTTON; 716 val = device->buffer[5] & MASK_BUTTON;
717 dbg("======>>>>>>REPORT 1: val 0x%X(%d)", 717 dev_dbg(&device->intf->dev,
718 val, val); 718 "======>>>>>>REPORT 1: val 0x%X(%d)\n",
719 val, val);
719 720
720 /* 721 /*
721 * We don't apply any meaning to the button 722 * We don't apply any meaning to the button
@@ -808,7 +809,8 @@ static void gtco_urb_callback(struct urb *urbinfo)
808 resubmit: 809 resubmit:
809 rc = usb_submit_urb(urbinfo, GFP_ATOMIC); 810 rc = usb_submit_urb(urbinfo, GFP_ATOMIC);
810 if (rc != 0) 811 if (rc != 0)
811 err("usb_submit_urb failed rc=0x%x", rc); 812 dev_err(&device->intf->dev,
813 "usb_submit_urb failed rc=0x%x\n", rc);
812} 814}
813 815
814/* 816/*
@@ -838,7 +840,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
838 gtco = kzalloc(sizeof(struct gtco), GFP_KERNEL); 840 gtco = kzalloc(sizeof(struct gtco), GFP_KERNEL);
839 input_dev = input_allocate_device(); 841 input_dev = input_allocate_device();
840 if (!gtco || !input_dev) { 842 if (!gtco || !input_dev) {
841 err("No more memory"); 843 dev_err(&usbinterface->dev, "No more memory\n");
842 error = -ENOMEM; 844 error = -ENOMEM;
843 goto err_free_devs; 845 goto err_free_devs;
844 } 846 }
@@ -848,12 +850,13 @@ static int gtco_probe(struct usb_interface *usbinterface,
848 850
849 /* Save interface information */ 851 /* Save interface information */
850 gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface)); 852 gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface));
853 gtco->intf = usbinterface;
851 854
852 /* Allocate some data for incoming reports */ 855 /* Allocate some data for incoming reports */
853 gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE, 856 gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE,
854 GFP_KERNEL, &gtco->buf_dma); 857 GFP_KERNEL, &gtco->buf_dma);
855 if (!gtco->buffer) { 858 if (!gtco->buffer) {
856 err("No more memory for us buffers"); 859 dev_err(&usbinterface->dev, "No more memory for us buffers\n");
857 error = -ENOMEM; 860 error = -ENOMEM;
858 goto err_free_devs; 861 goto err_free_devs;
859 } 862 }
@@ -861,7 +864,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
861 /* Allocate URB for reports */ 864 /* Allocate URB for reports */
862 gtco->urbinfo = usb_alloc_urb(0, GFP_KERNEL); 865 gtco->urbinfo = usb_alloc_urb(0, GFP_KERNEL);
863 if (!gtco->urbinfo) { 866 if (!gtco->urbinfo) {
864 err("Failed to allocate URB"); 867 dev_err(&usbinterface->dev, "Failed to allocate URB\n");
865 error = -ENOMEM; 868 error = -ENOMEM;
866 goto err_free_buf; 869 goto err_free_buf;
867 } 870 }
@@ -873,14 +876,14 @@ static int gtco_probe(struct usb_interface *usbinterface,
873 endpoint = &usbinterface->altsetting[0].endpoint[0].desc; 876 endpoint = &usbinterface->altsetting[0].endpoint[0].desc;
874 877
875 /* Some debug */ 878 /* Some debug */
876 dbg("gtco # interfaces: %d", usbinterface->num_altsetting); 879 dev_dbg(&usbinterface->dev, "gtco # interfaces: %d\n", usbinterface->num_altsetting);
877 dbg("num endpoints: %d", usbinterface->cur_altsetting->desc.bNumEndpoints); 880 dev_dbg(&usbinterface->dev, "num endpoints: %d\n", usbinterface->cur_altsetting->desc.bNumEndpoints);
878 dbg("interface class: %d", usbinterface->cur_altsetting->desc.bInterfaceClass); 881 dev_dbg(&usbinterface->dev, "interface class: %d\n", usbinterface->cur_altsetting->desc.bInterfaceClass);
879 dbg("endpoint: attribute:0x%x type:0x%x", endpoint->bmAttributes, endpoint->bDescriptorType); 882 dev_dbg(&usbinterface->dev, "endpoint: attribute:0x%x type:0x%x\n", endpoint->bmAttributes, endpoint->bDescriptorType);
880 if (usb_endpoint_xfer_int(endpoint)) 883 if (usb_endpoint_xfer_int(endpoint))
881 dbg("endpoint: we have interrupt endpoint\n"); 884 dev_dbg(&usbinterface->dev, "endpoint: we have interrupt endpoint\n");
882 885
883 dbg("endpoint extra len:%d ", usbinterface->altsetting[0].extralen); 886 dev_dbg(&usbinterface->dev, "endpoint extra len:%d\n", usbinterface->altsetting[0].extralen);
884 887
885 /* 888 /*
886 * Find the HID descriptor so we can find out the size of the 889 * Find the HID descriptor so we can find out the size of the
@@ -888,17 +891,19 @@ static int gtco_probe(struct usb_interface *usbinterface,
888 */ 891 */
889 if (usb_get_extra_descriptor(usbinterface->cur_altsetting, 892 if (usb_get_extra_descriptor(usbinterface->cur_altsetting,
890 HID_DEVICE_TYPE, &hid_desc) != 0){ 893 HID_DEVICE_TYPE, &hid_desc) != 0){
891 err("Can't retrieve exta USB descriptor to get hid report descriptor length"); 894 dev_err(&usbinterface->dev,
895 "Can't retrieve exta USB descriptor to get hid report descriptor length\n");
892 error = -EIO; 896 error = -EIO;
893 goto err_free_urb; 897 goto err_free_urb;
894 } 898 }
895 899
896 dbg("Extra descriptor success: type:%d len:%d", 900 dev_dbg(&usbinterface->dev,
897 hid_desc->bDescriptorType, hid_desc->wDescriptorLength); 901 "Extra descriptor success: type:%d len:%d\n",
902 hid_desc->bDescriptorType, hid_desc->wDescriptorLength);
898 903
899 report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL); 904 report = kzalloc(le16_to_cpu(hid_desc->wDescriptorLength), GFP_KERNEL);
900 if (!report) { 905 if (!report) {
901 err("No more memory for report"); 906 dev_err(&usbinterface->dev, "No more memory for report\n");
902 error = -ENOMEM; 907 error = -ENOMEM;
903 goto err_free_urb; 908 goto err_free_urb;
904 } 909 }
@@ -915,7 +920,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
915 le16_to_cpu(hid_desc->wDescriptorLength), 920 le16_to_cpu(hid_desc->wDescriptorLength),
916 5000); /* 5 secs */ 921 5000); /* 5 secs */
917 922
918 dbg("usb_control_msg result: %d", result); 923 dev_dbg(&usbinterface->dev, "usb_control_msg result: %d\n", result);
919 if (result == le16_to_cpu(hid_desc->wDescriptorLength)) { 924 if (result == le16_to_cpu(hid_desc->wDescriptorLength)) {
920 parse_hid_report_descriptor(gtco, report, result); 925 parse_hid_report_descriptor(gtco, report, result);
921 break; 926 break;
@@ -926,8 +931,9 @@ static int gtco_probe(struct usb_interface *usbinterface,
926 931
927 /* If we didn't get the report, fail */ 932 /* If we didn't get the report, fail */
928 if (result != le16_to_cpu(hid_desc->wDescriptorLength)) { 933 if (result != le16_to_cpu(hid_desc->wDescriptorLength)) {
929 err("Failed to get HID Report Descriptor of size: %d", 934 dev_err(&usbinterface->dev,
930 hid_desc->wDescriptorLength); 935 "Failed to get HID Report Descriptor of size: %d\n",
936 hid_desc->wDescriptorLength);
931 error = -EIO; 937 error = -EIO;
932 goto err_free_urb; 938 goto err_free_urb;
933 } 939 }
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c
index 85a5b40333ac..3fba74b9b602 100644
--- a/drivers/input/tablet/kbtab.c
+++ b/drivers/input/tablet/kbtab.c
@@ -33,6 +33,7 @@ struct kbtab {
33 dma_addr_t data_dma; 33 dma_addr_t data_dma;
34 struct input_dev *dev; 34 struct input_dev *dev;
35 struct usb_device *usbdev; 35 struct usb_device *usbdev;
36 struct usb_interface *intf;
36 struct urb *irq; 37 struct urb *irq;
37 char phys[32]; 38 char phys[32];
38}; 39};
@@ -53,10 +54,14 @@ static void kbtab_irq(struct urb *urb)
53 case -ENOENT: 54 case -ENOENT:
54 case -ESHUTDOWN: 55 case -ESHUTDOWN:
55 /* this urb is terminated, clean up */ 56 /* this urb is terminated, clean up */
56 dbg("%s - urb shutting down with status: %d", __func__, urb->status); 57 dev_dbg(&kbtab->intf->dev,
58 "%s - urb shutting down with status: %d\n",
59 __func__, urb->status);
57 return; 60 return;
58 default: 61 default:
59 dbg("%s - nonzero urb status received: %d", __func__, urb->status); 62 dev_dbg(&kbtab->intf->dev,
63 "%s - nonzero urb status received: %d\n",
64 __func__, urb->status);
60 goto exit; 65 goto exit;
61 } 66 }
62 67
@@ -80,8 +85,9 @@ static void kbtab_irq(struct urb *urb)
80 exit: 85 exit:
81 retval = usb_submit_urb(urb, GFP_ATOMIC); 86 retval = usb_submit_urb(urb, GFP_ATOMIC);
82 if (retval) 87 if (retval)
83 err("%s - usb_submit_urb failed with result %d", 88 dev_err(&kbtab->intf->dev,
84 __func__, retval); 89 "%s - usb_submit_urb failed with result %d\n",
90 __func__, retval);
85} 91}
86 92
87static struct usb_device_id kbtab_ids[] = { 93static struct usb_device_id kbtab_ids[] = {
@@ -131,6 +137,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
131 goto fail2; 137 goto fail2;
132 138
133 kbtab->usbdev = dev; 139 kbtab->usbdev = dev;
140 kbtab->intf = intf;
134 kbtab->dev = input_dev; 141 kbtab->dev = input_dev;
135 142
136 usb_make_path(dev, kbtab->phys, sizeof(kbtab->phys)); 143 usb_make_path(dev, kbtab->phys, sizeof(kbtab->phys));
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index c24ab5468e02..9a854e2d15dc 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -100,6 +100,7 @@ static int wacom_set_report(struct usb_interface *intf, u8 type, u8 id,
100static void wacom_sys_irq(struct urb *urb) 100static void wacom_sys_irq(struct urb *urb)
101{ 101{
102 struct wacom *wacom = urb->context; 102 struct wacom *wacom = urb->context;
103 struct device *dev = &wacom->intf->dev;
103 int retval; 104 int retval;
104 105
105 switch (urb->status) { 106 switch (urb->status) {
@@ -110,10 +111,12 @@ static void wacom_sys_irq(struct urb *urb)
110 case -ENOENT: 111 case -ENOENT:
111 case -ESHUTDOWN: 112 case -ESHUTDOWN:
112 /* this urb is terminated, clean up */ 113 /* this urb is terminated, clean up */
113 dbg("%s - urb shutting down with status: %d", __func__, urb->status); 114 dev_dbg(dev, "%s - urb shutting down with status: %d\n",
115 __func__, urb->status);
114 return; 116 return;
115 default: 117 default:
116 dbg("%s - nonzero urb status received: %d", __func__, urb->status); 118 dev_dbg(dev, "%s - nonzero urb status received: %d\n",
119 __func__, urb->status);
117 goto exit; 120 goto exit;
118 } 121 }
119 122
@@ -123,8 +126,8 @@ static void wacom_sys_irq(struct urb *urb)
123 usb_mark_last_busy(wacom->usbdev); 126 usb_mark_last_busy(wacom->usbdev);
124 retval = usb_submit_urb(urb, GFP_ATOMIC); 127 retval = usb_submit_urb(urb, GFP_ATOMIC);
125 if (retval) 128 if (retval)
126 err ("%s - usb_submit_urb failed with result %d", 129 dev_err(dev, "%s - usb_submit_urb failed with result %d\n",
127 __func__, retval); 130 __func__, retval);
128} 131}
129 132
130static int wacom_open(struct input_dev *dev) 133static int wacom_open(struct input_dev *dev)