drivers/hid/hid-asus.c
Source file repositories/reference/linux-study-clean/drivers/hid/hid-asus.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/hid-asus.c- Extension
.c- Size
- 44910 bytes
- Lines
- 1558
- Domain
- Driver Families
- Bucket
- drivers/hid
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/cleanup.hlinux/dmi.hlinux/hid.hlinux/module.hlinux/platform_data/x86/asus-wmi.hlinux/input/mt.hlinux/usb.hlinux/power_supply.hlinux/leds.hhid-ids.h
Detected Declarations
struct asus_kbd_ledsstruct asus_touchpad_infostruct asus_drvdatafunction asus_report_contact_downfunction asus_report_tool_widthfunction asus_report_inputfunction asus_e1239t_eventfunction asus_wmi_send_eventfunction asus_eventfunction asus_raw_eventfunction asus_kbd_set_reportfunction asus_kbd_initfunction asus_kbd_get_functionsfunction asus_kbd_disable_oobefunction asus_kbd_set_fn_lockfunction asus_sync_fn_lockfunction asus_schedule_workfunction asus_kbd_backlight_setfunction asus_kbd_backlight_workfunction mcu_parse_version_stringfunction mcu_request_versionfunction validate_mcu_fw_versionfunction asus_has_report_idfunction list_for_each_entryfunction asus_kbd_register_ledsfunction asus_parse_batteryfunction asus_report_batteryfunction asus_battery_queryfunction asus_battery_get_propertyfunction asus_battery_probefunction asus_input_configuredfunction asus_input_mappingfunction asus_start_multitouchfunction asus_resumefunction asus_reset_resumefunction asus_probefunction asus_removefunction Usage
Annotated Snippet
struct asus_kbd_leds {
struct asus_hid_listener listener;
struct hid_device *hdev;
struct work_struct work;
unsigned int brightness;
spinlock_t lock;
bool removed;
};
struct asus_touchpad_info {
int max_x;
int max_y;
int res_x;
int res_y;
int contact_size;
int max_contacts;
int report_size;
};
struct asus_drvdata {
unsigned long quirks;
struct hid_device *hdev;
struct input_dev *input;
struct input_dev *tp_kbd_input;
struct asus_kbd_leds *kbd_backlight;
const struct asus_touchpad_info *tp;
struct power_supply *battery;
struct power_supply_desc battery_desc;
int battery_capacity;
int battery_stat;
bool battery_in_query;
unsigned long battery_next_query;
struct work_struct fn_lock_sync_work;
bool fn_lock;
};
static int asus_report_battery(struct asus_drvdata *, u8 *, int);
static const struct asus_touchpad_info asus_i2c_tp = {
.max_x = 2794,
.max_y = 1758,
.contact_size = 5,
.max_contacts = 5,
.report_size = 28 /* 2 byte header + 5 * 5 + 1 byte footer */,
};
static const struct asus_touchpad_info asus_t100ta_tp = {
.max_x = 2240,
.max_y = 1120,
.res_x = 30, /* units/mm */
.res_y = 27, /* units/mm */
.contact_size = 5,
.max_contacts = 5,
.report_size = 28 /* 2 byte header + 5 * 5 + 1 byte footer */,
};
static const struct asus_touchpad_info asus_t100ha_tp = {
.max_x = 2640,
.max_y = 1320,
.res_x = 30, /* units/mm */
.res_y = 29, /* units/mm */
.contact_size = 5,
.max_contacts = 5,
.report_size = 28 /* 2 byte header + 5 * 5 + 1 byte footer */,
};
static const struct asus_touchpad_info asus_t200ta_tp = {
.max_x = 3120,
.max_y = 1716,
.res_x = 30, /* units/mm */
.res_y = 28, /* units/mm */
.contact_size = 5,
.max_contacts = 5,
.report_size = 28 /* 2 byte header + 5 * 5 + 1 byte footer */,
};
static const struct asus_touchpad_info asus_t100chi_tp = {
.max_x = 2640,
.max_y = 1320,
.res_x = 31, /* units/mm */
.res_y = 29, /* units/mm */
.contact_size = 3,
.max_contacts = 4,
.report_size = 15 /* 2 byte header + 3 * 4 + 1 byte footer */,
};
static const struct asus_touchpad_info medion_e1239t_tp = {
.max_x = 2640,
.max_y = 1380,
.res_x = 29, /* units/mm */
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/cleanup.h`, `linux/dmi.h`, `linux/hid.h`, `linux/module.h`, `linux/platform_data/x86/asus-wmi.h`, `linux/input/mt.h`, `linux/usb.h`.
- Detected declarations: `struct asus_kbd_leds`, `struct asus_touchpad_info`, `struct asus_drvdata`, `function asus_report_contact_down`, `function asus_report_tool_width`, `function asus_report_input`, `function asus_e1239t_event`, `function asus_wmi_send_event`, `function asus_event`, `function asus_raw_event`.
- Atlas domain: Driver Families / drivers/hid.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.