drivers/input/mouse/elan_i2c_core.c
Source file repositories/reference/linux-study-clean/drivers/input/mouse/elan_i2c_core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/mouse/elan_i2c_core.c- Extension
.c- Size
- 36135 bytes
- Lines
- 1446
- 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/acpi.hlinux/delay.hlinux/device.hlinux/firmware.hlinux/i2c.hlinux/init.hlinux/input/mt.hlinux/interrupt.hlinux/irq.hlinux/module.hlinux/slab.hlinux/kernel.hlinux/sched.hlinux/string_choices.hlinux/input.hlinux/uaccess.hlinux/jiffies.hlinux/completion.hlinux/of.hlinux/pm_wakeirq.hlinux/property.hlinux/regulator/consumer.hlinux/unaligned.helan_i2c.hlinux/input/elan-i2c-ids.h
Detected Declarations
struct elan_tp_datafunction elan_i2c_lookup_quirksfunction elan_get_fwinfofunction elan_set_powerfunction elan_sleepfunction elan_query_productfunction elan_check_ASUS_special_fwfunction __elan_initializefunction elan_initializefunction elan_query_device_infofunction elan_convert_resolutionfunction elan_query_device_parametersfunction elan_write_fw_blockfunction __elan_update_firmwarefunction elan_update_firmwarefunction elan_sysfs_read_fw_checksumfunction elan_sysfs_read_product_idfunction elan_sysfs_read_fw_verfunction elan_sysfs_read_sm_verfunction elan_sysfs_read_iap_verfunction elan_sysfs_update_fwfunction scoped_cond_guardfunction elan_calibratefunction calibrate_storefunction scoped_cond_guardfunction elan_sysfs_read_modefunction scoped_cond_guardfunction elan_acquire_baselinefunction acquire_storefunction scoped_cond_guardfunction min_showfunction scoped_guardfunction max_showfunction scoped_guardfunction elan_report_contactfunction elan_report_absolutefunction elan_report_trackpointfunction elan_isrfunction elan_setup_trackpoint_input_devicefunction elan_setup_input_devicefunction elan_disable_regulatorfunction elan_probefunction i2c_check_functionalityfunction __elan_suspendfunction elan_suspendfunction elan_resume
Annotated Snippet
struct elan_tp_data {
struct i2c_client *client;
struct input_dev *input;
struct input_dev *tp_input; /* trackpoint input node */
struct regulator *vcc;
const struct elan_transport_ops *ops;
/* for fw update */
struct completion fw_completion;
bool in_fw_update;
struct mutex sysfs_mutex;
unsigned int max_x;
unsigned int max_y;
unsigned int width_x;
unsigned int width_y;
unsigned int x_res;
unsigned int y_res;
u8 pattern;
u16 product_id;
u8 fw_version;
u8 sm_version;
u8 iap_version;
u16 fw_checksum;
unsigned int report_features;
unsigned int report_len;
int pressure_adjustment;
u8 mode;
u16 ic_type;
u16 fw_validpage_count;
u16 fw_page_size;
u32 fw_signature_address;
u8 min_baseline;
u8 max_baseline;
bool baseline_ready;
u8 clickpad;
bool middle_button;
u32 quirks; /* Various quirks */
};
static u32 elan_i2c_lookup_quirks(u16 ic_type, u16 product_id)
{
static const struct {
u16 ic_type;
u16 product_id;
u32 quirks;
} elan_i2c_quirks[] = {
{ 0x0D, ETP_PRODUCT_ID_DELBIN, ETP_QUIRK_QUICK_WAKEUP },
{ 0x0D, ETP_PRODUCT_ID_WHITEBOX, ETP_QUIRK_QUICK_WAKEUP },
{ 0x10, ETP_PRODUCT_ID_VOXEL, ETP_QUIRK_QUICK_WAKEUP },
{ 0x14, ETP_PRODUCT_ID_MAGPIE, ETP_QUIRK_QUICK_WAKEUP },
{ 0x14, ETP_PRODUCT_ID_BOBBA, ETP_QUIRK_QUICK_WAKEUP },
};
u32 quirks = 0;
int i;
for (i = 0; i < ARRAY_SIZE(elan_i2c_quirks); i++) {
if (elan_i2c_quirks[i].ic_type == ic_type &&
elan_i2c_quirks[i].product_id == product_id) {
quirks = elan_i2c_quirks[i].quirks;
}
}
if (ic_type >= 0x0D && product_id >= 0x123)
quirks |= ETP_QUIRK_QUICK_WAKEUP;
return quirks;
}
static int elan_get_fwinfo(u16 ic_type, u8 iap_version, u16 *validpage_count,
u32 *signature_address, u16 *page_size)
{
switch (ic_type) {
case 0x00:
case 0x06:
case 0x08:
*validpage_count = 512;
break;
case 0x03:
case 0x07:
case 0x09:
case 0x0A:
case 0x0B:
case 0x0C:
*validpage_count = 768;
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/delay.h`, `linux/device.h`, `linux/firmware.h`, `linux/i2c.h`, `linux/init.h`, `linux/input/mt.h`, `linux/interrupt.h`.
- Detected declarations: `struct elan_tp_data`, `function elan_i2c_lookup_quirks`, `function elan_get_fwinfo`, `function elan_set_power`, `function elan_sleep`, `function elan_query_product`, `function elan_check_ASUS_special_fw`, `function __elan_initialize`, `function elan_initialize`, `function elan_query_device_info`.
- 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.