提交 b426571c 编写于 作者: D Dmitry Torokhov

Input: acecad - fix some formatting issues

Also switch to using input_set_abd_params() helper.
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 5492f6f8
...@@ -66,18 +66,18 @@ static void usb_acecad_irq(struct urb *urb) ...@@ -66,18 +66,18 @@ static void usb_acecad_irq(struct urb *urb)
int prox, status; int prox, status;
switch (urb->status) { switch (urb->status) {
case 0: case 0:
/* success */ /* success */
break; break;
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __func__, urb->status); dbg("%s - urb shutting down with status: %d", __func__, urb->status);
return; return;
default: default:
dbg("%s - nonzero urb status received: %d", __func__, urb->status); dbg("%s - nonzero urb status received: %d", __func__, urb->status);
goto resubmit; goto resubmit;
} }
prox = (data[0] & 0x04) >> 2; prox = (data[0] & 0x04) >> 2;
...@@ -135,7 +135,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ ...@@ -135,7 +135,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
struct usb_acecad *acecad; struct usb_acecad *acecad;
struct input_dev *input_dev; struct input_dev *input_dev;
int pipe, maxp; int pipe, maxp;
int err = -ENOMEM; int err;
if (interface->desc.bNumEndpoints != 1) if (interface->desc.bNumEndpoints != 1)
return -ENODEV; return -ENODEV;
...@@ -193,40 +193,36 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ ...@@ -193,40 +193,36 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
input_dev->close = usb_acecad_close; input_dev->close = usb_acecad_close;
input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
input_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) | input_dev->keybit[BIT_WORD(BTN_LEFT)] =
BIT_MASK(ABS_PRESSURE); BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
input_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
input_dev->keybit[BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_TOOL_PEN) | input_dev->keybit[BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_TOOL_PEN) |
BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS) | BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS) |
BIT_MASK(BTN_STYLUS2); BIT_MASK(BTN_STYLUS2);
switch (id->driver_info) { switch (id->driver_info) {
case 0: case 0:
input_dev->absmax[ABS_X] = 5000; input_set_abs_params(input_dev, ABS_X, 0, 5000, 4, 0);
input_dev->absmax[ABS_Y] = 3750; input_set_abs_params(input_dev, ABS_Y, 0, 3750, 4, 0);
input_dev->absmax[ABS_PRESSURE] = 512; input_set_abs_params(input_dev, ABS_PRESSURE, 0, 512, 0, 0);
if (!strlen(acecad->name)) if (!strlen(acecad->name))
snprintf(acecad->name, sizeof(acecad->name), snprintf(acecad->name, sizeof(acecad->name),
"USB Acecad Flair Tablet %04x:%04x", "USB Acecad Flair Tablet %04x:%04x",
le16_to_cpu(dev->descriptor.idVendor), le16_to_cpu(dev->descriptor.idVendor),
le16_to_cpu(dev->descriptor.idProduct)); le16_to_cpu(dev->descriptor.idProduct));
break; break;
case 1:
input_dev->absmax[ABS_X] = 3000; case 1:
input_dev->absmax[ABS_Y] = 2250; input_set_abs_params(input_dev, ABS_X, 0, 53000, 4, 0);
input_dev->absmax[ABS_PRESSURE] = 1024; input_set_abs_params(input_dev, ABS_Y, 0, 2250, 4, 0);
if (!strlen(acecad->name)) input_set_abs_params(input_dev, ABS_PRESSURE, 0, 1024, 0, 0);
snprintf(acecad->name, sizeof(acecad->name), if (!strlen(acecad->name))
"USB Acecad 302 Tablet %04x:%04x", snprintf(acecad->name, sizeof(acecad->name),
le16_to_cpu(dev->descriptor.idVendor), "USB Acecad 302 Tablet %04x:%04x",
le16_to_cpu(dev->descriptor.idProduct)); le16_to_cpu(dev->descriptor.idVendor),
break; le16_to_cpu(dev->descriptor.idProduct));
break;
} }
input_dev->absfuzz[ABS_X] = 4;
input_dev->absfuzz[ABS_Y] = 4;
usb_fill_int_urb(acecad->irq, dev, pipe, usb_fill_int_urb(acecad->irq, dev, pipe,
acecad->data, maxp > 8 ? 8 : maxp, acecad->data, maxp > 8 ? 8 : maxp,
usb_acecad_irq, acecad, endpoint->bInterval); usb_acecad_irq, acecad, endpoint->bInterval);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部