drivers/hid/hid-oxp.c
Source file repositories/reference/linux-study-clean/drivers/hid/hid-oxp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/hid-oxp.c- Extension
.c- Size
- 41437 bytes
- Lines
- 1581
- 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/delay.hlinux/dev_printk.hlinux/device.hlinux/dmi.hlinux/hid.hlinux/jiffies.hlinux/kstrtox.hlinux/led-class-multicolor.hlinux/mutex.hlinux/sysfs.hlinux/types.hlinux/workqueue.hhid-ids.h
Detected Declarations
struct oxp_button_datastruct oxp_button_entrystruct oxp_button_idxstruct oxp_bmap_page_1struct oxp_bmap_page_2struct oxp_gen_1_rgb_reportstruct oxp_gen_2_rgb_reportstruct oxp_attrstruct quirk_entryenum oxp_function_indexenum oxp_joybutton_indexenum oxp_gamepad_mode_indexenum oxp_feature_en_indexenum oxp_rgb_effect_indexenum oxp_rumble_side_indexfunction get_usage_pagefunction oxp_hid_raw_event_gen_1function oxp_mcu_init_fnfunction oxp_hid_raw_event_gen_2function oxp_hid_raw_eventfunction mcu_property_outfunction oxp_gen_1_property_outfunction oxp_gen_2_property_outfunction gamepad_mode_storefunction gamepad_mode_showfunction gamepad_mode_index_showfunction oxp_set_defaults_bmap_1function oxp_set_defaults_bmap_2function oxp_page_fill_datafunction oxp_set_buttonsfunction oxp_reset_buttonsfunction reset_buttons_storefunction oxp_btn_queue_fnfunction oxp_button_idx_from_strfunction map_button_storefunction map_button_showfunction button_mapping_options_showfunction oxp_rumble_intensity_setfunction rumble_intensity_storefunction rumble_intensity_showfunction rumble_intensity_range_showfunction oxp_rgb_status_storefunction oxp_rgb_status_showfunction oxp_rgb_color_setfunction oxp_rgb_effect_setfunction enabled_storefunction enabled_showfunction enabled_index_show
Annotated Snippet
struct oxp_button_data {
u8 mode;
u8 index;
u8 key_id;
u8 padding[2];
} __packed;
struct oxp_button_entry {
struct oxp_button_data data;
const char *name;
};
static const struct oxp_button_entry oxp_button_table[] = {
/* Gamepad Buttons */
{ { OXP_MAPPING_GAMEPAD, 0x01 }, "BTN_A" },
{ { OXP_MAPPING_GAMEPAD, 0x02 }, "BTN_B" },
{ { OXP_MAPPING_GAMEPAD, 0x03 }, "BTN_X" },
{ { OXP_MAPPING_GAMEPAD, 0x04 }, "BTN_Y" },
{ { OXP_MAPPING_GAMEPAD, 0x05 }, "BTN_LB" },
{ { OXP_MAPPING_GAMEPAD, 0x06 }, "BTN_RB" },
{ { OXP_MAPPING_GAMEPAD, 0x07 }, "BTN_LT" },
{ { OXP_MAPPING_GAMEPAD, 0x08 }, "BTN_RT" },
{ { OXP_MAPPING_GAMEPAD, 0x09 }, "BTN_START" },
{ { OXP_MAPPING_GAMEPAD, 0x0a }, "BTN_SELECT" },
{ { OXP_MAPPING_GAMEPAD, 0x0b }, "BTN_L3" },
{ { OXP_MAPPING_GAMEPAD, 0x0c }, "BTN_R3" },
{ { OXP_MAPPING_GAMEPAD, 0x0d }, "DPAD_UP" },
{ { OXP_MAPPING_GAMEPAD, 0x0e }, "DPAD_DOWN" },
{ { OXP_MAPPING_GAMEPAD, 0x0f }, "DPAD_LEFT" },
{ { OXP_MAPPING_GAMEPAD, 0x10 }, "DPAD_RIGHT" },
{ { OXP_MAPPING_GAMEPAD, 0x11 }, "JOY_L_UP" },
{ { OXP_MAPPING_GAMEPAD, 0x12 }, "JOY_L_UP_RIGHT" },
{ { OXP_MAPPING_GAMEPAD, 0x13 }, "JOY_L_RIGHT" },
{ { OXP_MAPPING_GAMEPAD, 0x14 }, "JOY_L_DOWN_RIGHT" },
{ { OXP_MAPPING_GAMEPAD, 0x15 }, "JOY_L_DOWN" },
{ { OXP_MAPPING_GAMEPAD, 0x16 }, "JOY_L_DOWN_LEFT" },
{ { OXP_MAPPING_GAMEPAD, 0x17 }, "JOY_L_LEFT" },
{ { OXP_MAPPING_GAMEPAD, 0x18 }, "JOY_L_UP_LEFT" },
{ { OXP_MAPPING_GAMEPAD, 0x19 }, "JOY_R_UP" },
{ { OXP_MAPPING_GAMEPAD, 0x1a }, "JOY_R_UP_RIGHT" },
{ { OXP_MAPPING_GAMEPAD, 0x1b }, "JOY_R_RIGHT" },
{ { OXP_MAPPING_GAMEPAD, 0x1c }, "JOY_R_DOWN_RIGHT" },
{ { OXP_MAPPING_GAMEPAD, 0x1d }, "JOY_R_DOWN" },
{ { OXP_MAPPING_GAMEPAD, 0x1e }, "JOY_R_DOWN_LEFT" },
{ { OXP_MAPPING_GAMEPAD, 0x1f }, "JOY_R_LEFT" },
{ { OXP_MAPPING_GAMEPAD, 0x20 }, "JOY_R_UP_LEFT" },
{ { OXP_MAPPING_GAMEPAD, 0x22 }, "BTN_GUIDE" },
/* Keyboard Keys */
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x5a }, "KEY_F1" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x5b }, "KEY_F2" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x5c }, "KEY_F3" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x5d }, "KEY_F4" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x5e }, "KEY_F5" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x5f }, "KEY_F6" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x60 }, "KEY_F7" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x61 }, "KEY_F8" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x62 }, "KEY_F9" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x63 }, "KEY_F10" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x64 }, "KEY_F11" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x65 }, "KEY_F12" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x66 }, "KEY_F13" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x67 }, "KEY_F14" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x68 }, "KEY_F15" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x69 }, "KEY_F16" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x6a }, "KEY_F17" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x6b }, "KEY_F18" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x6c }, "KEY_F19" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x6d }, "KEY_F20" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x6e }, "KEY_F21" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x6f }, "KEY_F22" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x70 }, "KEY_F23" },
{ { OXP_MAPPING_KEYBOARD, 0x01, 0x71 }, "KEY_F24" },
};
enum oxp_joybutton_index {
BUTTON_A = 0x01,
BUTTON_B,
BUTTON_X,
BUTTON_Y,
BUTTON_LB,
BUTTON_RB,
BUTTON_LT,
BUTTON_RT,
BUTTON_START,
BUTTON_SELECT,
BUTTON_L3,
BUTTON_R3,
BUTTON_DUP,
BUTTON_DDOWN,
BUTTON_DLEFT,
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/cleanup.h`, `linux/delay.h`, `linux/dev_printk.h`, `linux/device.h`, `linux/dmi.h`, `linux/hid.h`, `linux/jiffies.h`.
- Detected declarations: `struct oxp_button_data`, `struct oxp_button_entry`, `struct oxp_button_idx`, `struct oxp_bmap_page_1`, `struct oxp_bmap_page_2`, `struct oxp_gen_1_rgb_report`, `struct oxp_gen_2_rgb_report`, `struct oxp_attr`, `struct quirk_entry`, `enum oxp_function_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.