drivers/hid/hid-lenovo-go-s.c
Source file repositories/reference/linux-study-clean/drivers/hid/hid-lenovo-go-s.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/hid-lenovo-go-s.c- Extension
.c- Size
- 36939 bytes
- Lines
- 1550
- 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.
- 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/array_size.hlinux/cleanup.hlinux/completion.hlinux/delay.hlinux/dev_printk.hlinux/device.hlinux/hid.hlinux/jiffies.hlinux/kstrtox.hlinux/led-class-multicolor.hlinux/mutex.hlinux/printk.hlinux/string.hlinux/sysfs.hlinux/types.hlinux/unaligned.hlinux/usb.hlinux/workqueue.hlinux/workqueue_types.hhid-ids.h
Detected Declarations
struct gos_cfg_attrstruct command_reportstruct version_reportenum mcu_command_indexenum feature_enabled_indexenum feature_status_indexenum gamepad_mode_indexenum os_type_indexenum poll_rate_indexenum dpad_mode_indexenum touchpad_mode_indexenum touchpad_config_indexenum rgb_mode_indexenum rgb_effect_indexenum rgb_config_indexenum test_command_indexenum tp_mfr_indexenum imu_mfr_indexfunction hid_gos_version_eventfunction hid_gos_mcu_id_eventfunction hid_gos_gamepad_cfg_eventfunction hid_gos_touchpad_eventfunction hid_gos_pl_test_eventfunction hid_gos_light_eventfunction hid_gos_set_event_returnfunction get_endpoint_addressfunction hid_gos_raw_eventfunction mcu_property_outfunction gamepad_property_storefunction gamepad_property_showfunction gamepad_property_optionsfunction touchpad_property_storefunction touchpad_property_showfunction touchpad_property_optionsfunction test_property_showfunction mcu_id_showfunction rgb_cfg_callfunction rgb_attr_showfunction rgb_effect_storefunction rgb_effect_showfunction rgb_effect_index_showfunction rgb_speed_storefunction rgb_speed_showfunction rgb_speed_range_showfunction rgb_mode_storefunction rgb_mode_showfunction rgb_mode_index_showfunction rgb_profile_store
Annotated Snippet
struct gos_cfg_attr {
u8 index;
};
struct command_report {
u8 cmd;
u8 sub_cmd;
u8 data[63];
} __packed;
struct version_report {
u8 cmd;
u32 version;
u8 reserved[59];
} __packed;
enum mcu_command_index {
GET_VERSION = 0x01,
GET_MCU_ID,
GET_GAMEPAD_CFG,
SET_GAMEPAD_CFG,
GET_TP_PARAM,
SET_TP_PARAM,
GET_RGB_CFG = 0x0f,
SET_RGB_CFG,
GET_PL_TEST = 0xdf,
};
enum feature_enabled_index {
FEATURE_DISABLED,
FEATURE_ENABLED,
};
static const char *const feature_enabled_text[] = {
[FEATURE_DISABLED] = "false",
[FEATURE_ENABLED] = "true",
};
enum feature_status_index {
FEATURE_NONE = 0x00,
FEATURE_GAMEPAD_MODE = 0x01,
FEATURE_AUTO_SLEEP_TIME = 0x04,
FEATURE_IMU_BYPASS,
FEATURE_RGB_ENABLE,
FEATURE_IMU_ENABLE,
FEATURE_TOUCHPAD_ENABLE,
FEATURE_OS_MODE = 0x0A,
FEATURE_POLL_RATE = 0x10,
FEATURE_DPAD_MODE,
FEATURE_MOUSE_WHEEL_STEP,
};
enum gamepad_mode_index {
XINPUT,
DINPUT,
};
static const char *const gamepad_mode_text[] = {
[XINPUT] = "xinput",
[DINPUT] = "dinput",
};
enum os_type_index {
WINDOWS,
LINUX,
};
static const char *const os_type_text[] = {
[WINDOWS] = "windows",
[LINUX] = "linux",
};
enum poll_rate_index {
HZ125,
HZ250,
HZ500,
HZ1000,
};
static const char *const poll_rate_text[] = {
[HZ125] = "125",
[HZ250] = "250",
[HZ500] = "500",
[HZ1000] = "1000",
};
enum dpad_mode_index {
DIR8,
DIR4,
};
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/cleanup.h`, `linux/completion.h`, `linux/delay.h`, `linux/dev_printk.h`, `linux/device.h`, `linux/hid.h`, `linux/jiffies.h`.
- Detected declarations: `struct gos_cfg_attr`, `struct command_report`, `struct version_report`, `enum mcu_command_index`, `enum feature_enabled_index`, `enum feature_status_index`, `enum gamepad_mode_index`, `enum os_type_index`, `enum poll_rate_index`, `enum dpad_mode_index`.
- Atlas domain: Driver Families / drivers/hid.
- 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.