drivers/input/touchscreen/goodix.c
Source file repositories/reference/linux-study-clean/drivers/input/touchscreen/goodix.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/touchscreen/goodix.c- Extension
.c- Size
- 41978 bytes
- Lines
- 1580
- 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/kernel.hlinux/dmi.hlinux/firmware.hlinux/module.hlinux/delay.hlinux/irq.hlinux/interrupt.hlinux/platform_data/x86/soc.hlinux/slab.hlinux/acpi.hlinux/of.hlinux/unaligned.hgoodix.h
Detected Declarations
struct goodix_chip_idfunction goodix_i2c_readfunction goodix_i2c_writefunction goodix_i2c_write_u8function goodix_ts_read_input_reportfunction goodix_create_pen_inputfunction goodix_ts_report_pen_downfunction goodix_ts_report_pen_upfunction goodix_ts_report_touch_8bfunction goodix_ts_report_touch_9bfunction goodix_ts_release_keysfunction goodix_ts_report_keyfunction goodix_process_eventsfunction goodix_ts_work_i2c_pollfunction goodix_ts_irq_handlerfunction goodix_enable_irqfunction goodix_disable_irqfunction goodix_free_irqfunction goodix_request_irqfunction goodix_check_cfg_8function goodix_calc_cfg_checksum_8function goodix_check_cfg_16function goodix_calc_cfg_checksum_16function goodix_check_cfgfunction goodix_send_cfgfunction goodix_pin_acpi_direction_inputfunction goodix_pin_acpi_output_methodfunction goodix_pin_acpi_direction_inputfunction goodix_pin_acpi_output_methodfunction goodix_irq_direction_outputfunction goodix_irq_direction_inputfunction goodix_int_syncfunction goodix_reset_no_int_syncfunction goodix_resetfunction goodix_resourcefunction goodix_get_gpio_configfunction bugfunction acpi_has_methodfunction goodix_add_acpi_gpio_mappingsfunction goodix_get_gpio_configfunction goodix_read_configfunction goodix_read_versionfunction goodix_i2c_testfunction goodix_configure_devfunction goodix_config_cbfunction goodix_disable_regulatorsfunction goodix_ts_probefunction goodix_ts_remove
Annotated Snippet
struct goodix_chip_id {
const char *id;
const struct goodix_chip_data *data;
};
static int goodix_check_cfg_8(struct goodix_ts_data *ts,
const u8 *cfg, int len);
static int goodix_check_cfg_16(struct goodix_ts_data *ts,
const u8 *cfg, int len);
static void goodix_calc_cfg_checksum_8(struct goodix_ts_data *ts);
static void goodix_calc_cfg_checksum_16(struct goodix_ts_data *ts);
static const struct goodix_chip_data gt1x_chip_data = {
.config_addr = GOODIX_GT1X_REG_CONFIG_DATA,
.config_len = GOODIX_CONFIG_GT9X_LENGTH,
.check_config = goodix_check_cfg_16,
.calc_config_checksum = goodix_calc_cfg_checksum_16,
};
static const struct goodix_chip_data gt911_chip_data = {
.config_addr = GOODIX_GT9X_REG_CONFIG_DATA,
.config_len = GOODIX_CONFIG_911_LENGTH,
.check_config = goodix_check_cfg_8,
.calc_config_checksum = goodix_calc_cfg_checksum_8,
};
static const struct goodix_chip_data gt967_chip_data = {
.config_addr = GOODIX_GT9X_REG_CONFIG_DATA,
.config_len = GOODIX_CONFIG_967_LENGTH,
.check_config = goodix_check_cfg_8,
.calc_config_checksum = goodix_calc_cfg_checksum_8,
};
static const struct goodix_chip_data gt9x_chip_data = {
.config_addr = GOODIX_GT9X_REG_CONFIG_DATA,
.config_len = GOODIX_CONFIG_GT9X_LENGTH,
.check_config = goodix_check_cfg_8,
.calc_config_checksum = goodix_calc_cfg_checksum_8,
};
static const struct goodix_chip_id goodix_chip_ids[] = {
{ .id = "1151", .data = >1x_chip_data },
{ .id = "1158", .data = >1x_chip_data },
{ .id = "5663", .data = >1x_chip_data },
{ .id = "5688", .data = >1x_chip_data },
{ .id = "917S", .data = >1x_chip_data },
{ .id = "9286", .data = >1x_chip_data },
{ .id = "911", .data = >911_chip_data },
{ .id = "9271", .data = >911_chip_data },
{ .id = "9110", .data = >911_chip_data },
{ .id = "9111", .data = >911_chip_data },
{ .id = "927", .data = >911_chip_data },
{ .id = "928", .data = >911_chip_data },
{ .id = "912", .data = >967_chip_data },
{ .id = "9147", .data = >967_chip_data },
{ .id = "967", .data = >967_chip_data },
{ }
};
static const unsigned long goodix_irq_flags[] = {
IRQ_TYPE_EDGE_RISING,
IRQ_TYPE_EDGE_FALLING,
IRQ_TYPE_LEVEL_LOW,
IRQ_TYPE_LEVEL_HIGH,
};
static const struct dmi_system_id nine_bytes_report[] = {
#if defined(CONFIG_DMI) && defined(CONFIG_X86)
{
/* Lenovo Yoga Book X90F / X90L */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"),
}
},
{
/* Lenovo Yoga Book X91F / X91L */
.matches = {
/* Non exact match to match F + L versions */
DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"),
}
},
#endif
{}
};
/*
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/dmi.h`, `linux/firmware.h`, `linux/module.h`, `linux/delay.h`, `linux/irq.h`, `linux/interrupt.h`, `linux/platform_data/x86/soc.h`.
- Detected declarations: `struct goodix_chip_id`, `function goodix_i2c_read`, `function goodix_i2c_write`, `function goodix_i2c_write_u8`, `function goodix_ts_read_input_report`, `function goodix_create_pen_input`, `function goodix_ts_report_pen_down`, `function goodix_ts_report_pen_up`, `function goodix_ts_report_touch_8b`, `function goodix_ts_report_touch_9b`.
- 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.