drivers/input/tablet/aiptek.c
Source file repositories/reference/linux-study-clean/drivers/input/tablet/aiptek.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/tablet/aiptek.c- Extension
.c- Size
- 62458 bytes
- Lines
- 1907
- 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.
- 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/hid.hlinux/jiffies.hlinux/kernel.hlinux/slab.hlinux/module.hlinux/usb/input.hlinux/uaccess.hlinux/unaligned.h
Detected Declarations
struct aiptek_featuresstruct aiptek_settingsstruct aiptekstruct aiptek_mapfunction map_str_to_valfunction input_report_xxxfunction switchesfunction aiptek_openfunction aiptek_closefunction aiptek_get_reportfunction aiptek_get_reportfunction aiptek_commandfunction aiptek_queryfunction aiptek_program_tabletfunction switchToTabletfunction show_tabletSizefunction show_tabletPointerModefunction store_tabletPointerModefunction show_tabletCoordinateModefunction store_tabletCoordinateModefunction show_tabletToolModefunction store_tabletToolModefunction show_tabletXtiltfunction store_tabletXtiltfunction show_tabletYtiltfunction store_tabletYtiltfunction show_tabletJitterDelayfunction store_tabletJitterDelayfunction show_tabletProgrammableDelayfunction store_tabletProgrammableDelayfunction show_tabletEventsReceivedfunction show_tabletDiagnosticMessagefunction show_tabletStylusUpperfunction store_tabletStylusUpperfunction show_tabletStylusLowerfunction store_tabletStylusLowerfunction show_tabletMouseLeftfunction store_tabletMouseLeftfunction show_tabletMouseMiddlefunction store_tabletMouseMiddlefunction show_tabletMouseRightfunction store_tabletMouseRightfunction show_tabletWheelfunction store_tabletWheelfunction show_tabletExecutefunction store_tabletExecutefunction show_tabletODMCodefunction show_tabletModelCode
Annotated Snippet
struct aiptek_features {
int odmCode; /* Tablet manufacturer code */
int modelCode; /* Tablet model code (not unique) */
int firmwareCode; /* prom/eeprom version */
char usbPath[64 + 1]; /* device's physical usb path */
};
struct aiptek_settings {
int pointerMode; /* stylus-, mouse-only or either */
int coordinateMode; /* absolute/relative coords */
int toolMode; /* pen, pencil, brush, etc. tool */
int xTilt; /* synthetic xTilt amount */
int yTilt; /* synthetic yTilt amount */
int wheel; /* synthetic wheel amount */
int stylusButtonUpper; /* stylus upper btn delivers... */
int stylusButtonLower; /* stylus lower btn delivers... */
int mouseButtonLeft; /* mouse left btn delivers... */
int mouseButtonMiddle; /* mouse middle btn delivers... */
int mouseButtonRight; /* mouse right btn delivers... */
int programmableDelay; /* delay for tablet programming */
int jitterDelay; /* delay for hand jittering */
};
struct aiptek {
struct input_dev *inputdev; /* input device struct */
struct usb_interface *intf; /* usb interface struct */
struct urb *urb; /* urb for incoming reports */
dma_addr_t data_dma; /* our dma stuffage */
struct aiptek_features features; /* tablet's array of features */
struct aiptek_settings curSetting; /* tablet's current programmable */
struct aiptek_settings newSetting; /* ... and new param settings */
unsigned int ifnum; /* interface number for IO */
int diagnostic; /* tablet diagnostic codes */
unsigned long eventCount; /* event count */
int inDelay; /* jitter: in jitter delay? */
unsigned long endDelay; /* jitter: time when delay ends */
int previousJitterable; /* jitterable prev value */
int lastMacro; /* macro key to reset */
int previousToolMode; /* pen, pencil, brush, etc. tool */
unsigned char *data; /* incoming packet data */
};
static const int eventTypes[] = {
EV_KEY, EV_ABS, EV_REL, EV_MSC,
};
static const int absEvents[] = {
ABS_X, ABS_Y, ABS_PRESSURE, ABS_TILT_X, ABS_TILT_Y,
ABS_WHEEL, ABS_MISC,
};
static const int relEvents[] = {
REL_X, REL_Y, REL_WHEEL,
};
static const int buttonEvents[] = {
BTN_LEFT, BTN_RIGHT, BTN_MIDDLE,
BTN_TOOL_PEN, BTN_TOOL_RUBBER, BTN_TOOL_PENCIL, BTN_TOOL_AIRBRUSH,
BTN_TOOL_BRUSH, BTN_TOOL_MOUSE, BTN_TOOL_LENS, BTN_TOUCH,
BTN_STYLUS, BTN_STYLUS2,
};
/*
* Permit easy lookup of keyboard events to send, versus
* the bitmap which comes from the tablet. This hides the
* issue that the F_keys are not sequentially numbered.
*/
static const int macroKeyEvents[] = {
KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5,
KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11,
KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17,
KEY_F18, KEY_F19, KEY_F20, KEY_F21, KEY_F22, KEY_F23,
KEY_F24, KEY_STOP, KEY_AGAIN, KEY_PROPS, KEY_UNDO,
KEY_FRONT, KEY_COPY, KEY_OPEN, KEY_PASTE, 0
};
/***********************************************************************
* Map values to strings and back. Every map should have the following
* as its last element: { NULL, AIPTEK_INVALID_VALUE }.
*/
#define AIPTEK_INVALID_VALUE -1
struct aiptek_map {
const char *string;
int value;
};
static int map_str_to_val(const struct aiptek_map *map, const char *str, size_t count)
{
Annotation
- Immediate include surface: `linux/hid.h`, `linux/jiffies.h`, `linux/kernel.h`, `linux/slab.h`, `linux/module.h`, `linux/usb/input.h`, `linux/uaccess.h`, `linux/unaligned.h`.
- Detected declarations: `struct aiptek_features`, `struct aiptek_settings`, `struct aiptek`, `struct aiptek_map`, `function map_str_to_val`, `function input_report_xxx`, `function switches`, `function aiptek_open`, `function aiptek_close`, `function aiptek_get_report`.
- Atlas domain: Driver Families / drivers/input.
- Implementation status: source implementation candidate.
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.