drivers/input/misc/ims-pcu.c
Source file repositories/reference/linux-study-clean/drivers/input/misc/ims-pcu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/misc/ims-pcu.c- Extension
.c- Size
- 53845 bytes
- Lines
- 2167
- 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.
- 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/completion.hlinux/device.hlinux/firmware.hlinux/ihex.hlinux/input.hlinux/kernel.hlinux/leds.hlinux/module.hlinux/slab.hlinux/types.hlinux/usb/input.hlinux/usb/cdc.hlinux/unaligned.h
Detected Declarations
struct ims_pcu_buttonsstruct ims_pcu_gamepadstruct ims_pcu_backlightstruct ims_pcustruct ims_pcu_device_infostruct ims_pcu_flash_fmtstruct ims_pcu_attributestruct ims_pcu_ofn_bit_attributefunction ims_pcu_buttons_reportfunction ims_pcu_setup_buttonsfunction ims_pcu_destroy_buttonsfunction ims_pcu_gamepad_reportfunction ims_pcu_setup_gamepadfunction ims_pcu_destroy_gamepadfunction ims_pcu_report_eventsfunction ims_pcu_handle_responsefunction ims_pcu_reset_packetfunction ims_pcu_process_datafunction ims_pcu_byte_needs_escapefunction ims_pcu_send_cmd_chunkfunction ims_pcu_send_commandfunction __ims_pcu_execute_commandfunction __ims_pcu_execute_bl_commandfunction ims_pcu_get_infofunction ims_pcu_set_infofunction ims_pcu_switch_to_bootloaderfunction ims_pcu_count_fw_recordsfunction ims_pcu_verify_blockfunction ims_pcu_flash_firmwarefunction ims_pcu_handle_firmware_updatefunction ims_pcu_process_async_firmwarefunction ims_pcu_backlight_set_brightnessfunction ims_pcu_backlight_get_brightnessfunction ims_pcu_setup_backlightfunction ims_pcu_destroy_backlightfunction ims_pcu_attribute_showfunction ims_pcu_attribute_storefunction scoped_cond_guardfunction ims_pcu_reset_devicefunction ims_pcu_update_firmware_storefunction scoped_cond_guardfunction ims_pcu_update_firmware_status_showfunction ims_pcu_is_attr_visiblefunction ims_pcu_read_ofn_configfunction ims_pcu_write_ofn_configfunction ims_pcu_ofn_reg_data_showfunction scoped_guardfunction ims_pcu_ofn_reg_data_store
Annotated Snippet
struct ims_pcu_buttons {
struct input_dev *input;
char name[32];
char phys[32];
unsigned short keymap[IMS_PCU_KEYMAP_LEN];
};
struct ims_pcu_gamepad {
struct input_dev *input;
char name[32];
char phys[32];
};
struct ims_pcu_backlight {
struct led_classdev cdev;
char name[32];
};
#define IMS_PCU_PART_NUMBER_LEN 15
#define IMS_PCU_SERIAL_NUMBER_LEN 8
#define IMS_PCU_DOM_LEN 8
#define IMS_PCU_FW_VERSION_LEN 16
#define IMS_PCU_BL_VERSION_LEN 16
#define IMS_PCU_BL_RESET_REASON_LEN (2 + 1)
#define IMS_PCU_PCU_B_DEVICE_ID 5
#define IMS_PCU_BUF_SIZE 128
struct ims_pcu {
struct usb_device *udev;
struct device *dev; /* control interface's device, used for logging */
unsigned int device_no;
bool bootloader_mode;
char part_number[IMS_PCU_PART_NUMBER_LEN];
char serial_number[IMS_PCU_SERIAL_NUMBER_LEN];
char date_of_manufacturing[IMS_PCU_DOM_LEN];
char fw_version[IMS_PCU_FW_VERSION_LEN];
char bl_version[IMS_PCU_BL_VERSION_LEN];
char reset_reason[IMS_PCU_BL_RESET_REASON_LEN];
int update_firmware_status;
u8 device_id;
u8 ofn_reg_addr;
struct usb_interface *ctrl_intf;
struct usb_endpoint_descriptor *ep_ctrl;
struct urb *urb_ctrl;
u8 *urb_ctrl_buf;
dma_addr_t ctrl_dma;
size_t max_ctrl_size;
struct usb_interface *data_intf;
struct usb_endpoint_descriptor *ep_in;
struct urb *urb_in;
u8 *urb_in_buf;
dma_addr_t read_dma;
size_t max_in_size;
struct usb_endpoint_descriptor *ep_out;
u8 *urb_out_buf;
size_t max_out_size;
u8 read_buf[IMS_PCU_BUF_SIZE];
u8 read_pos;
u8 check_sum;
bool have_stx;
bool have_dle;
u8 cmd_buf[IMS_PCU_BUF_SIZE];
u8 ack_id;
u8 expected_response;
u8 cmd_buf_len;
struct completion cmd_done;
struct mutex cmd_mutex;
u32 fw_start_addr;
u32 fw_end_addr;
struct completion async_firmware_done;
struct ims_pcu_buttons buttons;
struct ims_pcu_gamepad *gamepad;
struct ims_pcu_backlight backlight;
bool setup_complete; /* Input and LED devices have been created */
Annotation
- Immediate include surface: `linux/completion.h`, `linux/device.h`, `linux/firmware.h`, `linux/ihex.h`, `linux/input.h`, `linux/kernel.h`, `linux/leds.h`, `linux/module.h`.
- Detected declarations: `struct ims_pcu_buttons`, `struct ims_pcu_gamepad`, `struct ims_pcu_backlight`, `struct ims_pcu`, `struct ims_pcu_device_info`, `struct ims_pcu_flash_fmt`, `struct ims_pcu_attribute`, `struct ims_pcu_ofn_bit_attribute`, `function ims_pcu_buttons_report`, `function ims_pcu_setup_buttons`.
- Atlas domain: Driver Families / drivers/input.
- 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.