drivers/input/touchscreen/cyttsp5.c
Source file repositories/reference/linux-study-clean/drivers/input/touchscreen/cyttsp5.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/touchscreen/cyttsp5.c- Extension
.c- Size
- 25116 bytes
- Lines
- 982
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/crc-itu-t.hlinux/delay.hlinux/device.hlinux/gpio/consumer.hlinux/input/mt.hlinux/input/touchscreen.hlinux/interrupt.hlinux/i2c.hlinux/mod_devicetable.hlinux/module.hlinux/regmap.hlinux/unaligned.h
Detected Declarations
struct cyttsp5_sensing_conf_data_devstruct cyttsp5_sensing_conf_datastruct cyttsp5_tch_abs_paramsstruct cyttsp5_touchstruct cyttsp5_sysinfostruct cyttsp5_hid_descstruct cyttsp5enum cyttsp5_tch_absfunction cyttsp5_readfunction cyttsp5_writefunction cyttsp5_get_touch_axisfunction cyttsp5_get_touch_recordfunction cyttsp5_get_mt_touchesfunction cyttsp5_mt_attentionfunction cyttsp5_setup_input_devicefunction cyttsp5_parse_dt_key_codefunction cyttsp5_btn_attentionfunction cyttsp5_validate_cmd_responsefunction cyttsp5_si_get_btn_datafunction cyttsp5_get_sysinfo_regsfunction cyttsp5_hid_output_get_sysinfofunction cyttsp5_power_controlfunction cyttsp5_hid_output_bl_launch_appfunction cyttsp5_get_hid_descriptorfunction le16_to_cpufunction fill_tch_absfunction cyttsp5_handle_irqfunction cyttsp5_deassert_intfunction cyttsp5_fill_all_touchfunction cyttsp5_startupfunction cyttsp5_cleanupfunction cyttsp5_probefunction cyttsp5_i2c_probefunction cyttsp5_suspendfunction cyttsp5_resume
Annotated Snippet
struct cyttsp5_sensing_conf_data_dev {
u8 electrodes_x;
u8 electrodes_y;
__le16 len_x;
__le16 len_y;
__le16 res_x;
__le16 res_y;
__le16 max_z;
u8 origin_x;
u8 origin_y;
u8 panel_id;
u8 btn;
u8 scan_mode;
u8 max_num_of_tch_per_refresh_cycle;
} __packed;
struct cyttsp5_sensing_conf_data {
u16 res_x;
u16 res_y;
u16 max_z;
u16 len_x;
u16 len_y;
u8 origin_x;
u8 origin_y;
u8 max_tch;
};
enum cyttsp5_tch_abs { /* for ordering within the extracted touch data array */
CY_TCH_X, /* X */
CY_TCH_Y, /* Y */
CY_TCH_P, /* P (Z) */
CY_TCH_T, /* TOUCH ID */
CY_TCH_MAJ, /* TOUCH_MAJOR */
CY_TCH_MIN, /* TOUCH_MINOR */
CY_TCH_NUM_ABS
};
struct cyttsp5_tch_abs_params {
size_t ofs; /* abs byte offset */
size_t size; /* size in bits */
size_t min; /* min value */
size_t max; /* max value */
size_t bofs; /* bit offset */
};
struct cyttsp5_touch {
int abs[CY_TCH_NUM_ABS];
};
struct cyttsp5_sysinfo {
struct cyttsp5_sensing_conf_data sensing_conf_data;
int num_btns;
struct cyttsp5_tch_abs_params tch_hdr;
struct cyttsp5_tch_abs_params tch_abs[CY_TCH_NUM_ABS];
u32 key_code[HID_SYSINFO_MAX_BTN];
};
struct cyttsp5_hid_desc {
__le16 hid_desc_len;
u8 packet_id;
u8 reserved_byte;
__le16 bcd_version;
__le16 report_desc_len;
__le16 report_desc_register;
__le16 input_register;
__le16 max_input_len;
__le16 output_register;
__le16 max_output_len;
__le16 command_register;
__le16 data_register;
__le16 vendor_id;
__le16 product_id;
__le16 version_id;
u8 reserved[4];
} __packed;
struct cyttsp5 {
struct device *dev;
struct completion cmd_done;
struct cyttsp5_sysinfo sysinfo;
struct cyttsp5_hid_desc hid_desc;
u8 cmd_buf[CYTTSP5_PREALLOCATED_CMD_BUFFER];
u8 input_buf[CY_MAX_INPUT];
u8 response_buf[CY_MAX_INPUT];
struct gpio_desc *reset_gpio;
struct input_dev *input;
char phys[NAME_MAX];
int num_prv_rec;
struct regmap *regmap;
struct touchscreen_properties prop;
Annotation
- Immediate include surface: `linux/crc-itu-t.h`, `linux/delay.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/input/mt.h`, `linux/input/touchscreen.h`, `linux/interrupt.h`, `linux/i2c.h`.
- Detected declarations: `struct cyttsp5_sensing_conf_data_dev`, `struct cyttsp5_sensing_conf_data`, `struct cyttsp5_tch_abs_params`, `struct cyttsp5_touch`, `struct cyttsp5_sysinfo`, `struct cyttsp5_hid_desc`, `struct cyttsp5`, `enum cyttsp5_tch_abs`, `function cyttsp5_read`, `function cyttsp5_write`.
- Atlas domain: Driver Families / drivers/input.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.