# linuxwacom/input-wacom architecture

> Architecture diagram of the GitHub repository linuxwacom/input-wacom, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/linuxwacom/input-wacom
- Repository: https://github.com/linuxwacom/input-wacom

## Overview

input-wacom provides Linux kernel drivers that translate Wacom tablet input into Linux input-device events, with an additional serial-input attachment utility. The principal workflow is tablet reports entering a bus-specific driver, being interpreted and reported as input events. The HID system layer also manages device setup and shared features such as batteries, wireless devices, remotes, and LEDs. Excerpts are partial, so links between unsampled subsystems are omitted unless the README or indexed source references support them.

Main entry points: [`4.18/wacom_sys.c`](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c) (HID system layer), [`4.18/wacom_wac.c`](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_wac.c) (Report interpretation), [`4.18/wacom_w8001.c`](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_w8001.c) (W8001 serial driver), [`inputattach/inputattach.c`](https://github.com/linuxwacom/input-wacom/blob/master/inputattach/inputattach.c) (Input line attachment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hid["HID tablet driver"]
  node_hid_system["HID system layer<br/>[wacom_sys.c]"]
  node_hid_protocol["Report interpretation<br/>[wacom_wac.c]"]
  node_hid_definitions["Device definitions<br/>[wacom.h]"]
  node_hid_types["Report types<br/>[wacom_wac.h]"]
  node_tablet_features["Tablet features<br/>[wacom_wac.c]"]
  node_battery["Battery management<br/>[wacom_sys.c]"]
  node_wireless["Wireless management<br/>[wacom_sys.c]"]
  node_remote["Remote management<br/>[wacom_sys.c]"]
  node_leds["LED controls<br/>[wacom_sys.c]"]
end

subgraph group_bus["Other bus drivers"]
  node_i2c_tablet["I2C digitizer driver<br/>[wacom_i2c.c]"]
  node_serial_tablet["W8001 serial driver<br/>[wacom_w8001.c]"]
end

subgraph group_serial["Serial attachment"]
  node_inputattach["Input line attachment<br/>[inputattach.c]"]
  node_serio_ids["Serio type IDs<br/>[serio-ids.h]"]
end

node_tablet(("Wacom tablet"))
node_input_events(("Linux input events"))
node_serial_device(("Serial device"))

node_tablet -.->|"sends reports"| node_hid_system
node_hid_system -->|"dispatches reports"| node_hid_protocol
node_hid_protocol -->|"reports events"| node_input_events
node_hid_system -->|"uses definitions"| node_hid_definitions
node_hid_system -->|"uses report types"| node_hid_types
node_hid_protocol -->|"uses report types"| node_hid_types
node_hid_protocol -->|"configures features"| node_tablet_features
node_hid_system -->|"manages battery"| node_battery
node_hid_system -->|"schedules work"| node_wireless
node_hid_system -->|"manages remotes"| node_remote
node_hid_system -->|"configures LEDs"| node_leds
node_i2c_tablet -->|"reports events"| node_input_events
node_serial_device -.->|"sends packets"| node_serial_tablet
node_serial_tablet -->|"reports events"| node_input_events
node_serial_device -->|"opens device"| node_inputattach
node_inputattach -->|"uses type IDs"| node_serio_ids

click node_hid_system "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c"
click node_hid_protocol "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_wac.c"
click node_hid_definitions "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom.h"
click node_hid_types "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_wac.h"
click node_tablet_features "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_wac.c"
click node_battery "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c"
click node_wireless "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c"
click node_remote "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c"
click node_leds "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c"
click node_i2c_tablet "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_i2c.c"
click node_serial_tablet "https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_w8001.c"
click node_inputattach "https://github.com/linuxwacom/input-wacom/blob/master/inputattach/inputattach.c"
click node_serio_ids "https://github.com/linuxwacom/input-wacom/blob/master/inputattach/serio-ids.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_hid_system,node_hid_protocol,node_hid_definitions,node_hid_types,node_tablet_features,node_battery,node_wireless,node_remote,node_leds toneBlue
class node_i2c_tablet,node_serial_tablet toneAmber
class node_inputattach,node_serio_ids toneMint
class node_tablet,node_input_events,node_serial_device toneIndigo
```

## Components

### HID tablet driver

- [HID system layer](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c): `4.18/wacom_sys.c`
- [Report interpretation](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_wac.c): `4.18/wacom_wac.c`
- [Device definitions](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom.h): `4.18/wacom.h`
- [Report types](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_wac.h): `4.18/wacom_wac.h`
- [Tablet features](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_wac.c): `4.18/wacom_wac.c`
- [Battery management](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c): `4.18/wacom_sys.c`
- [Wireless management](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c): `4.18/wacom_sys.c`
- [Remote management](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c): `4.18/wacom_sys.c`
- [LED controls](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_sys.c): `4.18/wacom_sys.c`

### Other bus drivers

- [I2C digitizer driver](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_i2c.c): `4.18/wacom_i2c.c`
- [W8001 serial driver](https://github.com/linuxwacom/input-wacom/blob/master/4.18/wacom_w8001.c): `4.18/wacom_w8001.c`

### Serial attachment

- [Input line attachment](https://github.com/linuxwacom/input-wacom/blob/master/inputattach/inputattach.c): `inputattach/inputattach.c`
- [Serio type IDs](https://github.com/linuxwacom/input-wacom/blob/master/inputattach/serio-ids.h): `inputattach/serio-ids.h`

### Other components

- **Wacom tablet**
- **Linux input events**
- **Serial device**

## Connections

- Wacom tablet → HID system layer: sends reports (evidence: `README.md`)
- HID system layer → Report interpretation: dispatches reports (evidence: `4.18/wacom_sys.c`)
- Report interpretation → Linux input events: reports events (evidence: `4.18/wacom_wac.c`)
- HID system layer → Device definitions: uses definitions (evidence: `4.18/wacom_sys.c`)
- HID system layer → Report types: uses report types (evidence: `4.18/wacom_sys.c`)
- Report interpretation → Report types: uses report types (evidence: `4.18/wacom_wac.c`)
- Report interpretation → Tablet features: configures features (evidence: `4.18/wacom_wac.c`)
- HID system layer → Battery management: manages battery (evidence: `4.18/wacom_sys.c`)
- HID system layer → Wireless management: schedules work (evidence: `4.18/wacom_sys.c`)
- HID system layer → Remote management: manages remotes (evidence: `4.18/wacom_sys.c`)
- HID system layer → LED controls: configures LEDs (evidence: `4.18/wacom_sys.c`)
- I2C digitizer driver → Linux input events: reports events (evidence: `4.18/wacom_i2c.c`)
- Serial device → W8001 serial driver: sends packets
- W8001 serial driver → Linux input events: reports events (evidence: `4.18/wacom_w8001.c`)
- Serial device → Input line attachment: opens device (evidence: `inputattach/inputattach.c`)
- Input line attachment → Serio type IDs: uses type IDs (evidence: `inputattach/inputattach.c`)
