Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Wacom protocol 4 serial tablet driver
0004  *
0005  * Copyright 2014      Hans de Goede <hdegoede@redhat.com>
0006  * Copyright 2011-2012 Julian Squires <julian@cipht.net>
0007  *
0008  * Many thanks to Bill Seremetis, without whom PenPartner support
0009  * would not have been possible. Thanks to Patrick Mahoney.
0010  *
0011  * This driver was developed with reference to much code written by others,
0012  * particularly:
0013  *  - elo, gunze drivers by Vojtech Pavlik <vojtech@ucw.cz>;
0014  *  - wacom_w8001 driver by Jaya Kumar <jayakumar.lkml@gmail.com>;
0015  *  - the USB wacom input driver, credited to many people
0016  *    (see drivers/input/tablet/wacom.h);
0017  *  - new and old versions of linuxwacom / xf86-input-wacom credited to
0018  *    Frederic Lepied, France. <Lepied@XFree86.org> and
0019  *    Ping Cheng, Wacom. <pingc@wacom.com>;
0020  *  - and xf86wacom.c (a presumably ancient version of the linuxwacom code),
0021  *    by Frederic Lepied and Raph Levien <raph@gtk.org>.
0022  *
0023  * To do:
0024  *  - support pad buttons; (requires access to a model with pad buttons)
0025  *  - support (protocol 4-style) tilt (requires access to a > 1.4 rom model)
0026  */
0027 
0028 /*
0029  * Wacom serial protocol 4 documentation taken from linuxwacom-0.9.9 code,
0030  * protocol 4 uses 7 or 9 byte of data in the following format:
0031  *
0032  *  Byte 1
0033  *  bit 7  Sync bit always 1
0034  *  bit 6  Pointing device detected
0035  *  bit 5  Cursor = 0 / Stylus = 1
0036  *  bit 4  Reserved
0037  *  bit 3  1 if a button on the pointing device has been pressed
0038  *  bit 2  P0 (optional)
0039  *  bit 1  X15
0040  *  bit 0  X14
0041  *
0042  *  Byte 2
0043  *  bit 7  Always 0
0044  *  bits 6-0 = X13 - X7
0045  *
0046  *  Byte 3
0047  *  bit 7  Always 0
0048  *  bits 6-0 = X6 - X0
0049  *
0050  *  Byte 4
0051  *  bit 7  Always 0
0052  *  bit 6  B3
0053  *  bit 5  B2
0054  *  bit 4  B1
0055  *  bit 3  B0
0056  *  bit 2  P1 (optional)
0057  *  bit 1  Y15
0058  *  bit 0  Y14
0059  *
0060  *  Byte 5
0061  *  bit 7  Always 0
0062  *  bits 6-0 = Y13 - Y7
0063  *
0064  *  Byte 6
0065  *  bit 7  Always 0
0066  *  bits 6-0 = Y6 - Y0
0067  *
0068  *  Byte 7
0069  *  bit 7 Always 0
0070  *  bit 6  Sign of pressure data; or wheel-rel for cursor tool
0071  *  bit 5  P7; or REL1 for cursor tool
0072  *  bit 4  P6; or REL0 for cursor tool
0073  *  bit 3  P5
0074  *  bit 2  P4
0075  *  bit 1  P3
0076  *  bit 0  P2
0077  *
0078  *  byte 8 and 9 are optional and present only
0079  *  in tilt mode.
0080  *
0081  *  Byte 8
0082  *  bit 7 Always 0
0083  *  bit 6 Sign of tilt X
0084  *  bit 5  Xt6
0085  *  bit 4  Xt5
0086  *  bit 3  Xt4
0087  *  bit 2  Xt3
0088  *  bit 1  Xt2
0089  *  bit 0  Xt1
0090  *
0091  *  Byte 9
0092  *  bit 7 Always 0
0093  *  bit 6 Sign of tilt Y
0094  *  bit 5  Yt6
0095  *  bit 4  Yt5
0096  *  bit 3  Yt4
0097  *  bit 2  Yt3
0098  *  bit 1  Yt2
0099  *  bit 0  Yt1
0100  */
0101 
0102 #include <linux/completion.h>
0103 #include <linux/init.h>
0104 #include <linux/input.h>
0105 #include <linux/interrupt.h>
0106 #include <linux/kernel.h>
0107 #include <linux/module.h>
0108 #include <linux/serio.h>
0109 #include <linux/slab.h>
0110 #include <linux/string.h>
0111 
0112 MODULE_AUTHOR("Julian Squires <julian@cipht.net>, Hans de Goede <hdegoede@redhat.com>");
0113 MODULE_DESCRIPTION("Wacom protocol 4 serial tablet driver");
0114 MODULE_LICENSE("GPL");
0115 
0116 #define REQUEST_MODEL_AND_ROM_VERSION   "~#"
0117 #define REQUEST_MAX_COORDINATES     "~C\r"
0118 #define REQUEST_CONFIGURATION_STRING    "~R\r"
0119 #define REQUEST_RESET_TO_PROTOCOL_IV    "\r#"
0120 /*
0121  * Note: sending "\r$\r" causes at least the Digitizer II to send
0122  * packets in ASCII instead of binary.  "\r#" seems to undo that.
0123  */
0124 
0125 #define COMMAND_START_SENDING_PACKETS       "ST\r"
0126 #define COMMAND_STOP_SENDING_PACKETS        "SP\r"
0127 #define COMMAND_MULTI_MODE_INPUT        "MU1\r"
0128 #define COMMAND_ORIGIN_IN_UPPER_LEFT        "OC1\r"
0129 #define COMMAND_ENABLE_ALL_MACRO_BUTTONS    "~M0\r"
0130 #define COMMAND_DISABLE_GROUP_1_MACRO_BUTTONS   "~M1\r"
0131 #define COMMAND_TRANSMIT_AT_MAX_RATE        "IT0\r"
0132 #define COMMAND_DISABLE_INCREMENTAL_MODE    "IN0\r"
0133 #define COMMAND_ENABLE_CONTINUOUS_MODE      "SR\r"
0134 #define COMMAND_ENABLE_PRESSURE_MODE        "PH1\r"
0135 #define COMMAND_Z_FILTER            "ZF1\r"
0136 
0137 /* Note that this is a protocol 4 packet without tilt information. */
0138 #define PACKET_LENGTH       7
0139 #define DATA_SIZE       32
0140 
0141 /* flags */
0142 #define F_COVERS_SCREEN     0x01
0143 #define F_HAS_STYLUS2       0x02
0144 #define F_HAS_SCROLLWHEEL   0x04
0145 
0146 /* device IDs */
0147 #define STYLUS_DEVICE_ID    0x02
0148 #define CURSOR_DEVICE_ID    0x06
0149 #define ERASER_DEVICE_ID    0x0A
0150 
0151 enum { STYLUS = 1, ERASER, CURSOR };
0152 
0153 static const struct {
0154     int device_id;
0155     int input_id;
0156 } tools[] = {
0157     { 0, 0 },
0158     { STYLUS_DEVICE_ID, BTN_TOOL_PEN },
0159     { ERASER_DEVICE_ID, BTN_TOOL_RUBBER },
0160     { CURSOR_DEVICE_ID, BTN_TOOL_MOUSE },
0161 };
0162 
0163 struct wacom {
0164     struct input_dev *dev;
0165     struct completion cmd_done;
0166     int result;
0167     u8 expect;
0168     u8 eraser_mask;
0169     unsigned int extra_z_bits;
0170     unsigned int flags;
0171     unsigned int res_x, res_y;
0172     unsigned int max_x, max_y;
0173     unsigned int tool;
0174     unsigned int idx;
0175     u8 data[DATA_SIZE];
0176     char phys[32];
0177 };
0178 
0179 enum {
0180     MODEL_CINTIQ        = 0x504C, /* PL */
0181     MODEL_CINTIQ2       = 0x4454, /* DT */
0182     MODEL_DIGITIZER_II  = 0x5544, /* UD */
0183     MODEL_GRAPHIRE      = 0x4554, /* ET */
0184     MODEL_PENPARTNER    = 0x4354, /* CT */
0185     MODEL_ARTPAD_II     = 0x4B54, /* KT */
0186 };
0187 
0188 static void wacom_handle_model_response(struct wacom *wacom)
0189 {
0190     int major_v, minor_v, r = 0;
0191     char *p;
0192 
0193     p = strrchr(wacom->data, 'V');
0194     if (p)
0195         r = sscanf(p + 1, "%u.%u", &major_v, &minor_v);
0196     if (r != 2)
0197         major_v = minor_v = 0;
0198 
0199     switch (wacom->data[2] << 8 | wacom->data[3]) {
0200     case MODEL_CINTIQ:  /* UNTESTED */
0201     case MODEL_CINTIQ2:
0202         if ((wacom->data[2] << 8 | wacom->data[3]) == MODEL_CINTIQ) {
0203             wacom->dev->name = "Wacom Cintiq";
0204             wacom->dev->id.version = MODEL_CINTIQ;
0205         } else {
0206             wacom->dev->name = "Wacom Cintiq II";
0207             wacom->dev->id.version = MODEL_CINTIQ2;
0208         }
0209         wacom->res_x = 508;
0210         wacom->res_y = 508;
0211 
0212         switch (wacom->data[5] << 8 | wacom->data[6]) {
0213         case 0x3731: /* PL-710 */
0214             wacom->res_x = 2540;
0215             wacom->res_y = 2540;
0216             fallthrough;
0217         case 0x3535: /* PL-550 */
0218         case 0x3830: /* PL-800 */
0219             wacom->extra_z_bits = 2;
0220         }
0221 
0222         wacom->flags = F_COVERS_SCREEN;
0223         break;
0224 
0225     case MODEL_PENPARTNER:
0226         wacom->dev->name = "Wacom Penpartner";
0227         wacom->dev->id.version = MODEL_PENPARTNER;
0228         wacom->res_x = 1000;
0229         wacom->res_y = 1000;
0230         break;
0231 
0232     case MODEL_GRAPHIRE:
0233         wacom->dev->name = "Wacom Graphire";
0234         wacom->dev->id.version = MODEL_GRAPHIRE;
0235         wacom->res_x = 1016;
0236         wacom->res_y = 1016;
0237         wacom->max_x = 5103;
0238         wacom->max_y = 3711;
0239         wacom->extra_z_bits = 2;
0240         wacom->eraser_mask = 0x08;
0241         wacom->flags = F_HAS_STYLUS2 | F_HAS_SCROLLWHEEL;
0242         break;
0243 
0244     case MODEL_ARTPAD_II:
0245     case MODEL_DIGITIZER_II:
0246         wacom->dev->name = "Wacom Digitizer II";
0247         wacom->dev->id.version = MODEL_DIGITIZER_II;
0248         if (major_v == 1 && minor_v <= 2)
0249             wacom->extra_z_bits = 0; /* UNTESTED */
0250         break;
0251 
0252     default:
0253         dev_err(&wacom->dev->dev, "Unsupported Wacom model %s\n",
0254             wacom->data);
0255         wacom->result = -ENODEV;
0256         return;
0257     }
0258 
0259     dev_info(&wacom->dev->dev, "%s tablet, version %u.%u\n",
0260          wacom->dev->name, major_v, minor_v);
0261 }
0262 
0263 static void wacom_handle_configuration_response(struct wacom *wacom)
0264 {
0265     int r, skip;
0266 
0267     dev_dbg(&wacom->dev->dev, "Configuration string: %s\n", wacom->data);
0268     r = sscanf(wacom->data, "~R%x,%u,%u,%u,%u", &skip, &skip, &skip,
0269            &wacom->res_x, &wacom->res_y);
0270     if (r != 5)
0271         dev_warn(&wacom->dev->dev, "could not get resolution\n");
0272 }
0273 
0274 static void wacom_handle_coordinates_response(struct wacom *wacom)
0275 {
0276     int r;
0277 
0278     dev_dbg(&wacom->dev->dev, "Coordinates string: %s\n", wacom->data);
0279     r = sscanf(wacom->data, "~C%u,%u", &wacom->max_x, &wacom->max_y);
0280     if (r != 2)
0281         dev_warn(&wacom->dev->dev, "could not get max coordinates\n");
0282 }
0283 
0284 static void wacom_handle_response(struct wacom *wacom)
0285 {
0286     if (wacom->data[0] != '~' || wacom->data[1] != wacom->expect) {
0287         dev_err(&wacom->dev->dev,
0288             "Wacom got an unexpected response: %s\n", wacom->data);
0289         wacom->result = -EIO;
0290     } else {
0291         wacom->result = 0;
0292 
0293         switch (wacom->data[1]) {
0294         case '#':
0295             wacom_handle_model_response(wacom);
0296             break;
0297         case 'R':
0298             wacom_handle_configuration_response(wacom);
0299             break;
0300         case 'C':
0301             wacom_handle_coordinates_response(wacom);
0302             break;
0303         }
0304     }
0305 
0306     complete(&wacom->cmd_done);
0307 }
0308 
0309 static void wacom_handle_packet(struct wacom *wacom)
0310 {
0311     u8 in_proximity_p, stylus_p, button;
0312     unsigned int tool;
0313     int x, y, z;
0314 
0315     in_proximity_p = wacom->data[0] & 0x40;
0316     stylus_p = wacom->data[0] & 0x20;
0317     button = (wacom->data[3] & 0x78) >> 3;
0318     x = (wacom->data[0] & 3) << 14 | wacom->data[1]<<7 | wacom->data[2];
0319     y = (wacom->data[3] & 3) << 14 | wacom->data[4]<<7 | wacom->data[5];
0320 
0321     if (in_proximity_p && stylus_p) {
0322         z = wacom->data[6] & 0x7f;
0323         if (wacom->extra_z_bits >= 1)
0324             z = z << 1 | (wacom->data[3] & 0x4) >> 2;
0325         if (wacom->extra_z_bits > 1)
0326             z = z << 1 | (wacom->data[0] & 0x4) >> 2;
0327         z = z ^ (0x40 << wacom->extra_z_bits);
0328     } else {
0329         z = -1;
0330     }
0331 
0332     if (stylus_p)
0333         tool = (button & wacom->eraser_mask) ? ERASER : STYLUS;
0334     else
0335         tool = CURSOR;
0336 
0337     if (tool != wacom->tool && wacom->tool != 0) {
0338         input_report_key(wacom->dev, tools[wacom->tool].input_id, 0);
0339         input_sync(wacom->dev);
0340     }
0341     wacom->tool = tool;
0342 
0343     input_report_key(wacom->dev, tools[tool].input_id, in_proximity_p);
0344     input_report_abs(wacom->dev, ABS_MISC,
0345              in_proximity_p ? tools[tool].device_id : 0);
0346     input_report_abs(wacom->dev, ABS_X, x);
0347     input_report_abs(wacom->dev, ABS_Y, y);
0348     input_report_abs(wacom->dev, ABS_PRESSURE, z);
0349     if (stylus_p) {
0350         input_report_key(wacom->dev, BTN_TOUCH, button & 1);
0351         input_report_key(wacom->dev, BTN_STYLUS, button & 2);
0352         input_report_key(wacom->dev, BTN_STYLUS2, button & 4);
0353     } else {
0354         input_report_key(wacom->dev, BTN_LEFT, button & 1);
0355         input_report_key(wacom->dev, BTN_RIGHT, button & 2);
0356         input_report_key(wacom->dev, BTN_MIDDLE, button & 4);
0357         /* handle relative wheel for non-stylus device */
0358         z = (wacom->data[6] & 0x30) >> 4;
0359         if (wacom->data[6] & 0x40)
0360             z = -z;
0361         input_report_rel(wacom->dev, REL_WHEEL, z);
0362     }
0363     input_sync(wacom->dev);
0364 }
0365 
0366 static void wacom_clear_data_buf(struct wacom *wacom)
0367 {
0368     memset(wacom->data, 0, DATA_SIZE);
0369     wacom->idx = 0;
0370 }
0371 
0372 static irqreturn_t wacom_interrupt(struct serio *serio, unsigned char data,
0373                    unsigned int flags)
0374 {
0375     struct wacom *wacom = serio_get_drvdata(serio);
0376 
0377     if (data & 0x80)
0378         wacom->idx = 0;
0379 
0380     /*
0381      * We're either expecting a carriage return-terminated ASCII
0382      * response string, or a seven-byte packet with the MSB set on
0383      * the first byte.
0384      *
0385      * Note however that some tablets (the PenPartner, for
0386      * example) don't send a carriage return at the end of a
0387      * command.  We handle these by waiting for timeout.
0388      */
0389     if (data == '\r' && !(wacom->data[0] & 0x80)) {
0390         wacom_handle_response(wacom);
0391         wacom_clear_data_buf(wacom);
0392         return IRQ_HANDLED;
0393     }
0394 
0395     /* Leave place for 0 termination */
0396     if (wacom->idx > (DATA_SIZE - 2)) {
0397         dev_dbg(&wacom->dev->dev,
0398             "throwing away %d bytes of garbage\n", wacom->idx);
0399         wacom_clear_data_buf(wacom);
0400     }
0401     wacom->data[wacom->idx++] = data;
0402 
0403     if (wacom->idx == PACKET_LENGTH && (wacom->data[0] & 0x80)) {
0404         wacom_handle_packet(wacom);
0405         wacom_clear_data_buf(wacom);
0406     }
0407 
0408     return IRQ_HANDLED;
0409 }
0410 
0411 static void wacom_disconnect(struct serio *serio)
0412 {
0413     struct wacom *wacom = serio_get_drvdata(serio);
0414 
0415     serio_close(serio);
0416     serio_set_drvdata(serio, NULL);
0417     input_unregister_device(wacom->dev);
0418     kfree(wacom);
0419 }
0420 
0421 static int wacom_send(struct serio *serio, const u8 *command)
0422 {
0423     int err = 0;
0424 
0425     for (; !err && *command; command++)
0426         err = serio_write(serio, *command);
0427 
0428     return err;
0429 }
0430 
0431 static int wacom_send_setup_string(struct wacom *wacom, struct serio *serio)
0432 {
0433     const u8 *cmd;
0434 
0435     switch (wacom->dev->id.version) {
0436     case MODEL_CINTIQ:  /* UNTESTED */
0437         cmd = COMMAND_ORIGIN_IN_UPPER_LEFT
0438             COMMAND_TRANSMIT_AT_MAX_RATE
0439             COMMAND_ENABLE_CONTINUOUS_MODE
0440             COMMAND_START_SENDING_PACKETS;
0441         break;
0442 
0443     case MODEL_PENPARTNER:
0444         cmd = COMMAND_ENABLE_PRESSURE_MODE
0445             COMMAND_START_SENDING_PACKETS;
0446         break;
0447 
0448     default:
0449         cmd = COMMAND_MULTI_MODE_INPUT
0450             COMMAND_ORIGIN_IN_UPPER_LEFT
0451             COMMAND_ENABLE_ALL_MACRO_BUTTONS
0452             COMMAND_DISABLE_GROUP_1_MACRO_BUTTONS
0453             COMMAND_TRANSMIT_AT_MAX_RATE
0454             COMMAND_DISABLE_INCREMENTAL_MODE
0455             COMMAND_ENABLE_CONTINUOUS_MODE
0456             COMMAND_Z_FILTER
0457             COMMAND_START_SENDING_PACKETS;
0458         break;
0459     }
0460 
0461     return wacom_send(serio, cmd);
0462 }
0463 
0464 static int wacom_send_and_wait(struct wacom *wacom, struct serio *serio,
0465                    const u8 *cmd, const char *desc)
0466 {
0467     int err;
0468     unsigned long u;
0469 
0470     wacom->expect = cmd[1];
0471     init_completion(&wacom->cmd_done);
0472 
0473     err = wacom_send(serio, cmd);
0474     if (err)
0475         return err;
0476 
0477     u = wait_for_completion_timeout(&wacom->cmd_done, HZ);
0478     if (u == 0) {
0479         /* Timeout, process what we've received. */
0480         wacom_handle_response(wacom);
0481     }
0482 
0483     wacom->expect = 0;
0484     return wacom->result;
0485 }
0486 
0487 static int wacom_setup(struct wacom *wacom, struct serio *serio)
0488 {
0489     int err;
0490 
0491     /* Note that setting the link speed is the job of inputattach.
0492      * We assume that reset negotiation has already happened,
0493      * here. */
0494     err = wacom_send_and_wait(wacom, serio, REQUEST_MODEL_AND_ROM_VERSION,
0495                   "model and version");
0496     if (err)
0497         return err;
0498 
0499     if (!(wacom->res_x && wacom->res_y)) {
0500         err = wacom_send_and_wait(wacom, serio,
0501                       REQUEST_CONFIGURATION_STRING,
0502                       "configuration string");
0503         if (err)
0504             return err;
0505     }
0506 
0507     if (!(wacom->max_x && wacom->max_y)) {
0508         err = wacom_send_and_wait(wacom, serio,
0509                       REQUEST_MAX_COORDINATES,
0510                       "coordinates string");
0511         if (err)
0512             return err;
0513     }
0514 
0515     return wacom_send_setup_string(wacom, serio);
0516 }
0517 
0518 static int wacom_connect(struct serio *serio, struct serio_driver *drv)
0519 {
0520     struct wacom *wacom;
0521     struct input_dev *input_dev;
0522     int err = -ENOMEM;
0523 
0524     wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
0525     input_dev = input_allocate_device();
0526     if (!wacom || !input_dev)
0527         goto free_device;
0528 
0529     wacom->dev = input_dev;
0530     wacom->extra_z_bits = 1;
0531     wacom->eraser_mask = 0x04;
0532     wacom->tool = wacom->idx = 0;
0533     snprintf(wacom->phys, sizeof(wacom->phys), "%s/input0", serio->phys);
0534     input_dev->phys = wacom->phys;
0535     input_dev->id.bustype = BUS_RS232;
0536     input_dev->id.vendor  = SERIO_WACOM_IV;
0537     input_dev->id.product = serio->id.extra;
0538     input_dev->dev.parent = &serio->dev;
0539 
0540     input_dev->evbit[0] =
0541         BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) | BIT_MASK(EV_REL);
0542     set_bit(ABS_MISC, input_dev->absbit);
0543     set_bit(BTN_TOOL_PEN, input_dev->keybit);
0544     set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
0545     set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
0546     set_bit(BTN_TOUCH, input_dev->keybit);
0547     set_bit(BTN_STYLUS, input_dev->keybit);
0548     set_bit(BTN_LEFT, input_dev->keybit);
0549     set_bit(BTN_RIGHT, input_dev->keybit);
0550     set_bit(BTN_MIDDLE, input_dev->keybit);
0551 
0552     serio_set_drvdata(serio, wacom);
0553 
0554     err = serio_open(serio, drv);
0555     if (err)
0556         goto free_device;
0557 
0558     err = wacom_setup(wacom, serio);
0559     if (err)
0560         goto close_serio;
0561 
0562     set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
0563     if (!(wacom->flags & F_COVERS_SCREEN))
0564         __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
0565 
0566     if (wacom->flags & F_HAS_STYLUS2)
0567         __set_bit(BTN_STYLUS2, input_dev->keybit);
0568 
0569     if (wacom->flags & F_HAS_SCROLLWHEEL)
0570         __set_bit(REL_WHEEL, input_dev->relbit);
0571 
0572     input_abs_set_res(wacom->dev, ABS_X, wacom->res_x);
0573     input_abs_set_res(wacom->dev, ABS_Y, wacom->res_y);
0574     input_set_abs_params(wacom->dev, ABS_X, 0, wacom->max_x, 0, 0);
0575     input_set_abs_params(wacom->dev, ABS_Y, 0, wacom->max_y, 0, 0);
0576     input_set_abs_params(wacom->dev, ABS_PRESSURE, -1,
0577                  (1 << (7 + wacom->extra_z_bits)) - 1, 0, 0);
0578 
0579     err = input_register_device(wacom->dev);
0580     if (err)
0581         goto close_serio;
0582 
0583     return 0;
0584 
0585 close_serio:
0586     serio_close(serio);
0587 free_device:
0588     serio_set_drvdata(serio, NULL);
0589     input_free_device(input_dev);
0590     kfree(wacom);
0591     return err;
0592 }
0593 
0594 static const struct serio_device_id wacom_serio_ids[] = {
0595     {
0596         .type   = SERIO_RS232,
0597         .proto  = SERIO_WACOM_IV,
0598         .id = SERIO_ANY,
0599         .extra  = SERIO_ANY,
0600     },
0601     { 0 }
0602 };
0603 
0604 MODULE_DEVICE_TABLE(serio, wacom_serio_ids);
0605 
0606 static struct serio_driver wacom_drv = {
0607     .driver     = {
0608         .name   = "wacom_serial4",
0609     },
0610     .description    = "Wacom protocol 4 serial tablet driver",
0611     .id_table   = wacom_serio_ids,
0612     .interrupt  = wacom_interrupt,
0613     .connect    = wacom_connect,
0614     .disconnect = wacom_disconnect,
0615 };
0616 
0617 module_serio_driver(wacom_drv);