/*
- Wacom protocol 4 serial tablet driver
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; either version of 2 of the License, or (at your
- option) any later version. See the file COPYING in the main directory of
- this archive for more details.
- Many thanks to Bill Seremetis, without whom PenPartner support
- would not have been possible. Thanks to Patrick Mahoney.
- To do:
-
- support pad buttons; (requires access to a model with pad buttons)
-
- support (protocol 4-style) tilt (requires access to a > 1.4 rom model)
*/
- support (protocol 4-style) tilt (requires access to a > 1.4 rom model)
/*
- Wacom serial protocol 4 documentation taken from linuxwacom-0.9.9 code,
- protocol 4 uses 7 or 9 byte of data in the following format:
- Byte 1
- bit 7 Sync bit always 1
- bit 6 Pointing device detected
- bit 5 Cursor = 0 / Stylus = 1
- bit 4 Reserved
- bit 3 1 if a button on the pointing device has been pressed
- bit 2 P0 (optional)
- bit 1 X15
- bit 0 X14
- Byte 2
- bit 7 Always 0
- bits 6-0 = X13 - X7
- Byte 3
- bit 7 Always 0
- bits 6-0 = X6 - X0
- Byte 4
- bit 7 Always 0
- bit 6 B3
- bit 5 B2
- bit 4 B1
- bit 3 B0
- bit 2 P1 (optional)
- bit 1 Y15
- bit 0 Y14
- Byte 5
- bit 7 Always 0
- bits 6-0 = Y13 - Y7
- Byte 6
- bit 7 Always 0
- bits 6-0 = Y6 - Y0
- Byte 7
- bit 7 Always 0
- bit 6 Sign of pressure data; or wheel-rel for cursor tool
- bit 5 P7; or REL1 for cursor tool
- bit 4 P6; or REL0 for cursor tool
- bit 3 P5
- bit 2 P4
- bit 1 P3
- bit 0 P2
- byte 8 and 9 are optional and present only
- in tilt mode.
- Byte 8
- bit 7 Always 0
- bit 6 Sign of tilt X
- bit 5 Xt6
- bit 4 Xt5
- bit 3 Xt4
- bit 2 Xt3
- bit 1 Xt2
- bit 0 Xt1
- Byte 9
- bit 7 Always 0
- bit 6 Sign of tilt Y
- bit 5 Yt6
- bit 4 Yt5
- bit 3 Yt4
- bit 2 Yt3
- bit 1 Yt2
- bit 0 Yt1
*/
#include <linux/completion.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/serio.h>
#include <linux/slab.h>
#include <linux/string.h>
MODULE_AUTHOR(“Julian Squires julian@cipht.net, Hans de Goede hdegoede@redhat.com”);
MODULE_DESCRIPTION(“Wacom protocol 4 serial tablet driver”);
MODULE_LICENSE(“GPL”);
#define REQUEST_MODEL_AND_ROM_VERSION “~#”
#define REQUEST_MAX_COORDINATES “~C\r”
#define REQUEST_CONFIGURATION_STRING “~R\r”
#define REQUEST_RESET_TO_PROTOCOL_IV “\r#”
/*
- Note: sending “\r$\r” causes at least the Digitizer II to send
- packets in ASCII instead of binary. “\r#” seems to undo that.
*/
#define COMMAND_START_SENDING_PACKETS “ST\r”
#define COMMAND_STOP_SENDING_PACKETS “SP\r”
#define COMMAND_MULTI_MODE_INPUT “MU1\r”
#define COMMAND_ORIGIN_IN_UPPER_LEFT “OC1\r”
#define COMM