drivers/input/tablet/wacom_serial4.c
Source file repositories/reference/linux-study-clean/drivers/input/tablet/wacom_serial4.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/tablet/wacom_serial4.c- Extension
.c- Size
- 15692 bytes
- Lines
- 618
- Domain
- Driver Families
- Bucket
- drivers/input
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/completion.hlinux/init.hlinux/input.hlinux/interrupt.hlinux/kernel.hlinux/module.hlinux/serio.hlinux/slab.hlinux/string.h
Detected Declarations
struct wacomfunction wacom_handle_model_responsefunction wacom_handle_configuration_responsefunction wacom_handle_coordinates_responsefunction wacom_handle_responsefunction wacom_handle_packetfunction wacom_clear_data_buffunction wacom_interruptfunction tabletsfunction wacom_disconnectfunction wacom_sendfunction wacom_send_setup_stringfunction wacom_send_and_waitfunction wacom_setupfunction wacom_connect
Annotated Snippet
struct wacom {
struct input_dev *dev;
struct completion cmd_done;
int result;
u8 expect;
u8 eraser_mask;
unsigned int extra_z_bits;
unsigned int flags;
unsigned int res_x, res_y;
unsigned int max_x, max_y;
unsigned int tool;
unsigned int idx;
u8 data[DATA_SIZE];
char phys[32];
};
enum {
MODEL_CINTIQ = 0x504C, /* PL */
MODEL_CINTIQ2 = 0x4454, /* DT */
MODEL_DIGITIZER_II = 0x5544, /* UD */
MODEL_GRAPHIRE = 0x4554, /* ET */
MODEL_PENPARTNER = 0x4354, /* CT */
MODEL_ARTPAD_II = 0x4B54, /* KT */
};
static void wacom_handle_model_response(struct wacom *wacom)
{
int major_v, minor_v, r = 0;
char *p;
p = strrchr(wacom->data, 'V');
if (p)
r = sscanf(p + 1, "%u.%u", &major_v, &minor_v);
if (r != 2)
major_v = minor_v = 0;
switch (wacom->data[2] << 8 | wacom->data[3]) {
case MODEL_CINTIQ: /* UNTESTED */
case MODEL_CINTIQ2:
if ((wacom->data[2] << 8 | wacom->data[3]) == MODEL_CINTIQ) {
wacom->dev->name = "Wacom Cintiq";
wacom->dev->id.version = MODEL_CINTIQ;
} else {
wacom->dev->name = "Wacom Cintiq II";
wacom->dev->id.version = MODEL_CINTIQ2;
}
wacom->res_x = 508;
wacom->res_y = 508;
switch (wacom->data[5] << 8 | wacom->data[6]) {
case 0x3731: /* PL-710 */
wacom->res_x = 2540;
wacom->res_y = 2540;
fallthrough;
case 0x3535: /* PL-550 */
case 0x3830: /* PL-800 */
wacom->extra_z_bits = 2;
}
wacom->flags = F_COVERS_SCREEN;
break;
case MODEL_PENPARTNER:
wacom->dev->name = "Wacom Penpartner";
wacom->dev->id.version = MODEL_PENPARTNER;
wacom->res_x = 1000;
wacom->res_y = 1000;
break;
case MODEL_GRAPHIRE:
wacom->dev->name = "Wacom Graphire";
wacom->dev->id.version = MODEL_GRAPHIRE;
wacom->res_x = 1016;
wacom->res_y = 1016;
wacom->max_x = 5103;
wacom->max_y = 3711;
wacom->extra_z_bits = 2;
wacom->eraser_mask = 0x08;
wacom->flags = F_HAS_STYLUS2 | F_HAS_SCROLLWHEEL;
break;
case MODEL_ARTPAD_II:
case MODEL_DIGITIZER_II:
wacom->dev->name = "Wacom Digitizer II";
wacom->dev->id.version = MODEL_DIGITIZER_II;
if (major_v == 1 && minor_v <= 2)
wacom->extra_z_bits = 0; /* UNTESTED */
break;
default:
Annotation
- Immediate include surface: `linux/completion.h`, `linux/init.h`, `linux/input.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/module.h`, `linux/serio.h`, `linux/slab.h`.
- Detected declarations: `struct wacom`, `function wacom_handle_model_response`, `function wacom_handle_configuration_response`, `function wacom_handle_coordinates_response`, `function wacom_handle_response`, `function wacom_handle_packet`, `function wacom_clear_data_buf`, `function wacom_interrupt`, `function tablets`, `function wacom_disconnect`.
- Atlas domain: Driver Families / drivers/input.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.