drivers/hid/hid-ft260.c
Source file repositories/reference/linux-study-clean/drivers/hid/hid-ft260.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/hid-ft260.c- Extension
.c- Size
- 28948 bytes
- Lines
- 1120
- 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.
- 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
hid-ids.hlinux/hidraw.hlinux/i2c.hlinux/module.hlinux/usb.h
Detected Declarations
struct ft260_get_chip_version_reportstruct ft260_get_system_status_reportstruct ft260_get_i2c_status_reportstruct ft260_set_system_clock_reportstruct ft260_set_i2c_mode_reportstruct ft260_set_uart_mode_reportstruct ft260_set_i2c_reset_reportstruct ft260_set_i2c_speed_reportstruct ft260_i2c_write_request_reportstruct ft260_i2c_read_request_reportstruct ft260_i2c_input_reportstruct ft260_devicefunction ft260_hid_feature_report_getfunction ft260_hid_feature_report_setfunction ft260_i2c_resetfunction ft260_xfer_statusfunction conditionfunction ft260_hid_output_reportfunction ft260_hid_output_report_check_statusfunction ft260_i2c_writefunction ft260_smbus_writefunction ft260_i2c_readfunction ft260_i2c_write_readfunction ft260_i2c_xferfunction ft260_smbus_xferfunction ft260_functionalityfunction ft260_get_system_configfunction ft260_is_interface_enabledfunction ft260_byte_showfunction ft260_word_showfunction i2c_reset_storefunction ft260_probefunction ft260_removefunction ft260_raw_event
Annotated Snippet
struct ft260_get_chip_version_report {
u8 report; /* FT260_CHIP_VERSION */
u8 chip_code[4]; /* FTDI chip identification code */
u8 reserved[8];
} __packed;
struct ft260_get_system_status_report {
u8 report; /* FT260_SYSTEM_SETTINGS */
u8 chip_mode; /* DCNF0 and DCNF1 status, bits 0-1 */
u8 clock_ctl; /* 0 - 12MHz, 1 - 24MHz, 2 - 48MHz */
u8 suspend_status; /* 0 - not suspended, 1 - suspended */
u8 pwren_status; /* 0 - FT260 is not ready, 1 - ready */
u8 i2c_enable; /* 0 - disabled, 1 - enabled */
u8 uart_mode; /* 0 - OFF; 1 - RTS_CTS, 2 - DTR_DSR, */
/* 3 - XON_XOFF, 4 - No flow control */
u8 hid_over_i2c_en; /* 0 - disabled, 1 - enabled */
u8 gpio2_function; /* 0 - GPIO, 1 - SUSPOUT, */
/* 2 - PWREN, 4 - TX_LED */
u8 gpioA_function; /* 0 - GPIO, 3 - TX_ACTIVE, 4 - TX_LED */
u8 gpioG_function; /* 0 - GPIO, 2 - PWREN, */
/* 5 - RX_LED, 6 - BCD_DET */
u8 suspend_out_pol; /* 0 - active-high, 1 - active-low */
u8 enable_wakeup_int; /* 0 - disabled, 1 - enabled */
u8 intr_cond; /* Interrupt trigger conditions */
u8 power_saving_en; /* 0 - disabled, 1 - enabled */
u8 reserved[10];
} __packed;
struct ft260_get_i2c_status_report {
u8 report; /* FT260_I2C_STATUS */
u8 bus_status; /* I2C bus status */
__le16 clock; /* I2C bus clock in range 60-3400 KHz */
u8 reserved;
} __packed;
/* Feature Out reports */
struct ft260_set_system_clock_report {
u8 report; /* FT260_SYSTEM_SETTINGS */
u8 request; /* FT260_SET_CLOCK */
u8 clock_ctl; /* 0 - 12MHz, 1 - 24MHz, 2 - 48MHz */
} __packed;
struct ft260_set_i2c_mode_report {
u8 report; /* FT260_SYSTEM_SETTINGS */
u8 request; /* FT260_SET_I2C_MODE */
u8 i2c_enable; /* 0 - disabled, 1 - enabled */
} __packed;
struct ft260_set_uart_mode_report {
u8 report; /* FT260_SYSTEM_SETTINGS */
u8 request; /* FT260_SET_UART_MODE */
u8 uart_mode; /* 0 - OFF; 1 - RTS_CTS, 2 - DTR_DSR, */
/* 3 - XON_XOFF, 4 - No flow control */
} __packed;
struct ft260_set_i2c_reset_report {
u8 report; /* FT260_SYSTEM_SETTINGS */
u8 request; /* FT260_SET_I2C_RESET */
} __packed;
struct ft260_set_i2c_speed_report {
u8 report; /* FT260_SYSTEM_SETTINGS */
u8 request; /* FT260_SET_I2C_CLOCK_SPEED */
__le16 clock; /* I2C bus clock in range 60-3400 KHz */
} __packed;
/* Data transfer reports */
struct ft260_i2c_write_request_report {
u8 report; /* FT260_I2C_REPORT */
u8 address; /* 7-bit I2C address */
u8 flag; /* I2C transaction condition */
u8 length; /* data payload length */
u8 data[FT260_WR_DATA_MAX]; /* data payload */
} __packed;
struct ft260_i2c_read_request_report {
u8 report; /* FT260_I2C_READ_REQ */
u8 address; /* 7-bit I2C address */
u8 flag; /* I2C transaction condition */
__le16 length; /* data payload length */
} __packed;
struct ft260_i2c_input_report {
u8 report; /* FT260_I2C_REPORT */
u8 length; /* data payload length */
u8 data[2]; /* data payload */
} __packed;
Annotation
- Immediate include surface: `hid-ids.h`, `linux/hidraw.h`, `linux/i2c.h`, `linux/module.h`, `linux/usb.h`.
- Detected declarations: `struct ft260_get_chip_version_report`, `struct ft260_get_system_status_report`, `struct ft260_get_i2c_status_report`, `struct ft260_set_system_clock_report`, `struct ft260_set_i2c_mode_report`, `struct ft260_set_uart_mode_report`, `struct ft260_set_i2c_reset_report`, `struct ft260_set_i2c_speed_report`, `struct ft260_i2c_write_request_report`, `struct ft260_i2c_read_request_report`.
- Atlas domain: Driver Families / drivers/hid.
- 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.