drivers/platform/x86/intel/hid.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/intel/hid.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/intel/hid.c- Extension
.c- Size
- 21445 bytes
- Lines
- 814
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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/acpi.hlinux/dmi.hlinux/input.hlinux/input/sparse-keymap.hlinux/kernel.hlinux/module.hlinux/platform_device.hlinux/string_choices.hlinux/suspend.h../dual_accel_detect.h
Detected Declarations
struct intel_hid_privenum intel_hid_tablet_sw_modeenum intel_hid_dsm_fn_codesfunction intel_hid_execute_methodfunction intel_hid_evaluate_methodfunction intel_hid_init_dsmfunction intel_hid_set_enablefunction intel_button_array_enablefunction intel_hid_pm_preparefunction intel_hid_pm_completefunction intel_hid_pl_suspend_handlerfunction intel_hid_pl_freeze_handlerfunction intel_hid_pl_resume_handlerfunction intel_hid_input_setupfunction intel_button_array_input_setupfunction intel_hid_switches_setupfunction report_tablet_mode_statefunction report_tablet_mode_eventfunction notify_handlerfunction button_array_presentfunction intel_hid_probefunction intel_hid_remove
Annotated Snippet
struct intel_hid_priv {
struct input_dev *input_dev;
struct input_dev *array;
struct input_dev *switches;
bool wakeup_mode;
};
#define HID_EVENT_FILTER_UUID "eeec56b3-4442-408f-a792-4edd4d758054"
enum intel_hid_dsm_fn_codes {
INTEL_HID_DSM_FN_INVALID,
INTEL_HID_DSM_BTNL_FN,
INTEL_HID_DSM_HDMM_FN,
INTEL_HID_DSM_HDSM_FN,
INTEL_HID_DSM_HDEM_FN,
INTEL_HID_DSM_BTNS_FN,
INTEL_HID_DSM_BTNE_FN,
INTEL_HID_DSM_HEBC_V1_FN,
INTEL_HID_DSM_VGBS_FN,
INTEL_HID_DSM_HEBC_V2_FN,
INTEL_HID_DSM_FN_MAX
};
static const char *intel_hid_dsm_fn_to_method[INTEL_HID_DSM_FN_MAX] = {
NULL,
"BTNL",
"HDMM",
"HDSM",
"HDEM",
"BTNS",
"BTNE",
"HEBC",
"VGBS",
"HEBC"
};
static unsigned long long intel_hid_dsm_fn_mask;
static guid_t intel_dsm_guid;
static bool intel_hid_execute_method(acpi_handle handle,
enum intel_hid_dsm_fn_codes fn_index,
unsigned long long arg)
{
union acpi_object *obj, argv4, req;
acpi_status status;
char *method_name;
if (fn_index <= INTEL_HID_DSM_FN_INVALID ||
fn_index >= INTEL_HID_DSM_FN_MAX)
return false;
method_name = (char *)intel_hid_dsm_fn_to_method[fn_index];
if (!(intel_hid_dsm_fn_mask & BIT(fn_index)))
goto skip_dsm_exec;
/* All methods expects a package with one integer element */
req.type = ACPI_TYPE_INTEGER;
req.integer.value = arg;
argv4.type = ACPI_TYPE_PACKAGE;
argv4.package.count = 1;
argv4.package.elements = &req;
obj = acpi_evaluate_dsm(handle, &intel_dsm_guid, 1, fn_index, &argv4);
if (obj) {
acpi_handle_debug(handle, "Exec DSM Fn code: %d[%s] success\n",
fn_index, method_name);
ACPI_FREE(obj);
return true;
}
skip_dsm_exec:
status = acpi_execute_simple_method(handle, method_name, arg);
if (ACPI_SUCCESS(status))
return true;
return false;
}
static bool intel_hid_evaluate_method(acpi_handle handle,
enum intel_hid_dsm_fn_codes fn_index,
unsigned long long *result)
{
union acpi_object *obj;
acpi_status status;
char *method_name;
if (fn_index <= INTEL_HID_DSM_FN_INVALID ||
fn_index >= INTEL_HID_DSM_FN_MAX)
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/dmi.h`, `linux/input.h`, `linux/input/sparse-keymap.h`, `linux/kernel.h`, `linux/module.h`, `linux/platform_device.h`, `linux/string_choices.h`.
- Detected declarations: `struct intel_hid_priv`, `enum intel_hid_tablet_sw_mode`, `enum intel_hid_dsm_fn_codes`, `function intel_hid_execute_method`, `function intel_hid_evaluate_method`, `function intel_hid_init_dsm`, `function intel_hid_set_enable`, `function intel_button_array_enable`, `function intel_hid_pm_prepare`, `function intel_hid_pm_complete`.
- Atlas domain: Driver Families / drivers/platform.
- 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.