aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-04-21 01:30:22 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-04-21 01:34:19 -0400
commitb426571ceab9fbdd50be33a4cb379a119c6028a2 (patch)
treee6d277c60ee336baee0369ba7b7abc905f526dc3 /drivers/input/tablet
parent5492f6f801c81c9663417cd8e48e759775977c83 (diff)
Input: acecad - fix some formatting issues
Also switch to using input_set_abd_params() helper. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r--drivers/input/tablet/acecad.c76
1 files changed, 36 insertions, 40 deletions
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index 1697ec2c308a..214378b05db7 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -66,18 +66,18 @@ static void usb_acecad_irq(struct urb *urb)
66 int prox, status; 66 int prox, status;
67 67
68 switch (urb->status) { 68 switch (urb->status) {
69 case 0: 69 case 0:
70 /* success */ 70 /* success */
71 break; 71 break;
72 case -ECONNRESET: 72 case -ECONNRESET:
73 case -ENOENT: 73 case -ENOENT:
74 case -ESHUTDOWN: 74 case -ESHUTDOWN:
75 /* this urb is terminated, clean up */ 75 /* this urb is terminated, clean up */
76 dbg("%s - urb shutting down with status: %d", __func__, urb->status); 76 dbg("%s - urb shutting down with status: %d", __func__, urb->status);
77 return; 77 return;
78 default: 78 default:
79 dbg("%s - nonzero urb status received: %d", __func__, urb->status); 79 dbg("%s - nonzero urb status received: %d", __func__, urb->status);
80 goto resubmit; 80 goto resubmit;
81 } 81 }
82 82
83 prox = (data[0] & 0x04) >> 2; 83 prox = (data[0] & 0x04) >> 2;
@@ -135,7 +135,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
135 struct usb_acecad *acecad; 135 struct usb_acecad *acecad;
136 struct input_dev *input_dev; 136 struct input_dev *input_dev;
137 int pipe, maxp; 137 int pipe, maxp;
138 int err = -ENOMEM; 138 int err;
139 139
140 if (interface->desc.bNumEndpoints != 1) 140 if (interface->desc.bNumEndpoints != 1)
141 return -ENODEV; 141 return -ENODEV;
@@ -193,40 +193,36 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
193 input_dev->close = usb_acecad_close; 193 input_dev->close = usb_acecad_close;
194 194
195 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 195 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
196 input_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) | 196 input_dev->keybit[BIT_WORD(BTN_LEFT)] =
197 BIT_MASK(ABS_PRESSURE); 197 BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
198 input_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
199 BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
200 input_dev->keybit[BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_TOOL_PEN) | 198 input_dev->keybit[BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_TOOL_PEN) |
201 BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS) | 199 BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS) |
202 BIT_MASK(BTN_STYLUS2); 200 BIT_MASK(BTN_STYLUS2);
203 201
204 switch (id->driver_info) { 202 switch (id->driver_info) {
205 case 0: 203 case 0:
206 input_dev->absmax[ABS_X] = 5000; 204 input_set_abs_params(input_dev, ABS_X, 0, 5000, 4, 0);
207 input_dev->absmax[ABS_Y] = 3750; 205 input_set_abs_params(input_dev, ABS_Y, 0, 3750, 4, 0);
208 input_dev->absmax[ABS_PRESSURE] = 512; 206 input_set_abs_params(input_dev, ABS_PRESSURE, 0, 512, 0, 0);
209 if (!strlen(acecad->name)) 207 if (!strlen(acecad->name))
210 snprintf(acecad->name, sizeof(acecad->name), 208 snprintf(acecad->name, sizeof(acecad->name),
211 "USB Acecad Flair Tablet %04x:%04x", 209 "USB Acecad Flair Tablet %04x:%04x",
212 le16_to_cpu(dev->descriptor.idVendor), 210 le16_to_cpu(dev->descriptor.idVendor),
213 le16_to_cpu(dev->descriptor.idProduct)); 211 le16_to_cpu(dev->descriptor.idProduct));
214 break; 212 break;
215 case 1: 213
216 input_dev->absmax[ABS_X] = 3000; 214 case 1:
217 input_dev->absmax[ABS_Y] = 2250; 215 input_set_abs_params(input_dev, ABS_X, 0, 53000, 4, 0);
218 input_dev->absmax[ABS_PRESSURE] = 1024; 216 input_set_abs_params(input_dev, ABS_Y, 0, 2250, 4, 0);
219 if (!strlen(acecad->name)) 217 input_set_abs_params(input_dev, ABS_PRESSURE, 0, 1024, 0, 0);
220 snprintf(acecad->name, sizeof(acecad->name), 218 if (!strlen(acecad->name))
221 "USB Acecad 302 Tablet %04x:%04x", 219 snprintf(acecad->name, sizeof(acecad->name),
222 le16_to_cpu(dev->descriptor.idVendor), 220 "USB Acecad 302 Tablet %04x:%04x",
223 le16_to_cpu(dev->descriptor.idProduct)); 221 le16_to_cpu(dev->descriptor.idVendor),
224 break; 222 le16_to_cpu(dev->descriptor.idProduct));
223 break;
225 } 224 }
226 225
227 input_dev->absfuzz[ABS_X] = 4;
228 input_dev->absfuzz[ABS_Y] = 4;
229
230 usb_fill_int_urb(acecad->irq, dev, pipe, 226 usb_fill_int_urb(acecad->irq, dev, pipe,
231 acecad->data, maxp > 8 ? 8 : maxp, 227 acecad->data, maxp > 8 ? 8 : maxp,
232 usb_acecad_irq, acecad, endpoint->bInterval); 228 usb_acecad_irq, acecad, endpoint->bInterval);