drivers/input/mouse/synaptics.c
Source file repositories/reference/linux-study-clean/drivers/input/mouse/synaptics.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/mouse/synaptics.c- Extension
.c- Size
- 51814 bytes
- Lines
- 1945
- Domain
- Driver Families
- Bucket
- drivers/input
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/module.hlinux/delay.hlinux/dmi.hlinux/input/mt.hlinux/serio.hlinux/libps2.hlinux/rmi.hlinux/i2c.hlinux/slab.hpsmouse.hsynaptics.h
Detected Declarations
struct min_max_quirkfunction Copyrightfunction synaptics_detectfunction synaptics_resetfunction synaptics_send_cmdfunction synaptics_query_intfunction synaptics_identifyfunction synaptics_model_idfunction synaptics_firmware_idfunction synaptics_query_modesfunction synaptics_capabilityfunction SYN_CAP_SUBMODEL_IDfunction synaptics_resolutionfunction synaptics_query_hardwarefunction synaptics_invert_yfunction quirkfunction synaptics_has_agmfunction synaptics_set_advanced_gesture_modefunction synaptics_set_modefunction synaptics_set_ratefunction synaptics_pt_writefunction synaptics_pt_startfunction synaptics_pt_stopfunction synaptics_pt_openfunction synaptics_pt_closefunction synaptics_is_pt_packetfunction synaptics_pass_pt_packetfunction synaptics_pt_activatefunction synaptics_pt_createfunction synaptics_parse_agmfunction synaptics_parse_ext_buttonsfunction synaptics_parse_hw_statefunction msecs_to_jiffiesfunction synaptics_report_semi_mt_slotfunction synaptics_report_semi_mt_datafunction synaptics_report_ext_buttonsfunction synaptics_report_buttonsfunction synaptics_report_mt_datafunction synaptics_image_sensor_processfunction synaptics_has_multifingerfunction synaptics_process_packetfunction synaptics_validate_bytefunction synaptics_detect_pkt_typefunction synaptics_process_bytefunction set_abs_position_paramsfunction set_input_paramsfunction synaptics_show_disable_gesturefunction synaptics_set_disable_gesture
Annotated Snippet
struct min_max_quirk {
const char * const *pnp_ids;
struct {
u32 min, max;
} board_id;
u32 x_min, x_max, y_min, y_max;
};
static const struct min_max_quirk min_max_pnpid_table[] = {
{
(const char * const []){"LEN0033", NULL},
{ANY_BOARD_ID, ANY_BOARD_ID},
1024, 5052, 2258, 4832
},
{
(const char * const []){"LEN0042", NULL},
{ANY_BOARD_ID, ANY_BOARD_ID},
1232, 5710, 1156, 4696
},
{
(const char * const []){"LEN0034", "LEN0036", "LEN0037",
"LEN0039", "LEN2002", "LEN2004",
NULL},
{ANY_BOARD_ID, 2961},
1024, 5112, 2024, 4832
},
{
(const char * const []){"LEN2000", NULL},
{ANY_BOARD_ID, ANY_BOARD_ID},
1024, 5113, 2021, 4832
},
{
(const char * const []){"LEN2001", NULL},
{ANY_BOARD_ID, ANY_BOARD_ID},
1024, 5022, 2508, 4832
},
{
(const char * const []){"LEN2006", NULL},
{2691, 2691},
1024, 5045, 2457, 4832
},
{
(const char * const []){"LEN2006", NULL},
{ANY_BOARD_ID, ANY_BOARD_ID},
1264, 5675, 1171, 4688
},
{ }
};
/*****************************************************************************
* Synaptics communications functions
****************************************************************************/
/*
* Synaptics touchpads report the y coordinate from bottom to top, which is
* opposite from what userspace expects.
* This function is used to invert y before reporting.
*/
static int synaptics_invert_y(int y)
{
return YMAX_NOMINAL + YMIN_NOMINAL - y;
}
/*
* Apply quirk(s) if the hardware matches
*/
static void synaptics_apply_quirks(struct psmouse *psmouse,
struct synaptics_device_info *info)
{
int i;
for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
if (!psmouse_matches_pnp_id(psmouse,
min_max_pnpid_table[i].pnp_ids))
continue;
if (min_max_pnpid_table[i].board_id.min != ANY_BOARD_ID &&
info->board_id < min_max_pnpid_table[i].board_id.min)
continue;
if (min_max_pnpid_table[i].board_id.max != ANY_BOARD_ID &&
info->board_id > min_max_pnpid_table[i].board_id.max)
continue;
info->x_min = min_max_pnpid_table[i].x_min;
info->x_max = min_max_pnpid_table[i].x_max;
info->y_min = min_max_pnpid_table[i].y_min;
info->y_max = min_max_pnpid_table[i].y_max;
psmouse_info(psmouse,
"quirked min/max coordinates: x [%d..%d], y [%d..%d]\n",
Annotation
- Immediate include surface: `linux/module.h`, `linux/delay.h`, `linux/dmi.h`, `linux/input/mt.h`, `linux/serio.h`, `linux/libps2.h`, `linux/rmi.h`, `linux/i2c.h`.
- Detected declarations: `struct min_max_quirk`, `function Copyright`, `function synaptics_detect`, `function synaptics_reset`, `function synaptics_send_cmd`, `function synaptics_query_int`, `function synaptics_identify`, `function synaptics_model_id`, `function synaptics_firmware_id`, `function synaptics_query_modes`.
- Atlas domain: Driver Families / drivers/input.
- Implementation status: integration 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.