drivers/platform/x86/asus-tf103c-dock.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/asus-tf103c-dock.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/asus-tf103c-dock.c- Extension
.c- Size
- 27626 bytes
- Lines
- 944
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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/acpi.hlinux/delay.hlinux/dmi.hlinux/gpio/consumer.hlinux/gpio/machine.hlinux/hid.hlinux/i2c.hlinux/input.hlinux/irq.hlinux/irqdomain.hlinux/mod_devicetable.hlinux/moduleparam.hlinux/module.hlinux/pm.hlinux/workqueue.hlinux/unaligned.h
Detected Declarations
struct tf103c_dock_datafunction tf103c_dock_kbd_readfunction tf103c_dock_kbd_writefunction tf103c_dock_hid_parsefunction tf103c_dock_hid_startfunction tf103c_dock_hid_stopfunction tf103c_dock_hid_openfunction tf103c_dock_hid_closefunction tf103c_dock_hid_raw_requestfunction tf103c_dock_report_toprow_kbd_hookfunction tf103c_dock_toprow_pressfunction tf103c_dock_toprow_releasefunction tf103c_dock_toprow_eventfunction tf103c_dock_kbd_interruptfunction tf103c_enable_touchpadfunction tf103c_dock_disable_touchpadfunction tf103c_dock_ec_cmdfunction tf103c_dock_scifunction tf103c_dock_smifunction tf103c_dock_irqfunction runfunction tf103c_dock_disablefunction tf103c_dock_hpd_workfunction tf103c_dock_hpd_irqfunction tf103c_dock_start_hpdfunction tf103c_dock_stop_hpdfunction tf103c_dock_non_devm_cleanupfunction tf103c_dock_probefunction tf103c_dock_removefunction tf103c_dock_suspendfunction tf103c_dock_resume
Annotated Snippet
struct tf103c_dock_data {
struct delayed_work hpd_work;
struct irq_chip tp_irqchip;
struct irq_domain *tp_irq_domain;
struct i2c_client *ec_client;
struct i2c_client *intr_client;
struct i2c_client *kbd_client;
struct i2c_client *tp_client;
struct gpio_desc *pwr_en;
struct gpio_desc *irq_gpio;
struct gpio_desc *hpd_gpio;
struct input_dev *input;
struct hid_device *hid;
unsigned long flags;
int board_rev;
int irq;
int hpd_irq;
int tp_irq;
int last_press_0x13;
int last_press_0x14;
bool enabled;
bool tp_enabled;
bool altgr_pressed;
bool esc_pressed;
bool filter_esc;
u8 kbd_buf[TF103C_DOCK_KBD_DATA_MAX_LENGTH];
};
static struct gpiod_lookup_table tf103c_dock_gpios = {
.dev_id = "i2c-" TF103C_DOCK_DEV_NAME,
.table = {
GPIO_LOOKUP("INT33FC:00", 55, "dock_pwr_en", GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("INT33FC:02", 1, "dock_irq", GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("INT33FC:02", 29, "dock_hpd", GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("gpio_crystalcove", 2, "board_rev", GPIO_ACTIVE_HIGH),
{}
},
};
/* Byte 0 is the length of the rest of the packet */
static const u8 tf103c_dock_enable_cmd[9] = { 8, 0x20, 0, 0, 0, 0, 0x20, 0, 0 };
static const u8 tf103c_dock_usb_enable_cmd[9] = { 8, 0, 0, 0, 0, 0, 0, 0x40, 0 };
static const u8 tf103c_dock_suspend_cmd[9] = { 8, 0, 0x20, 0, 0, 0x22, 0, 0, 0 };
/*** keyboard related code ***/
static u8 tf103c_dock_kbd_hid_desc[] = {
0x05, 0x01, /* Usage Page (Desktop), */
0x09, 0x06, /* Usage (Keyboard), */
0xA1, 0x01, /* Collection (Application), */
0x85, 0x11, /* Report ID (17), */
0x95, 0x08, /* Report Count (8), */
0x75, 0x01, /* Report Size (1), */
0x15, 0x00, /* Logical Minimum (0), */
0x25, 0x01, /* Logical Maximum (1), */
0x05, 0x07, /* Usage Page (Keyboard), */
0x19, 0xE0, /* Usage Minimum (KB Leftcontrol), */
0x29, 0xE7, /* Usage Maximum (KB Right GUI), */
0x81, 0x02, /* Input (Variable), */
0x95, 0x01, /* Report Count (1), */
0x75, 0x08, /* Report Size (8), */
0x81, 0x01, /* Input (Constant), */
0x95, 0x06, /* Report Count (6), */
0x75, 0x08, /* Report Size (8), */
0x15, 0x00, /* Logical Minimum (0), */
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
0x05, 0x07, /* Usage Page (Keyboard), */
0x19, 0x00, /* Usage Minimum (None), */
0x2A, 0xFF, 0x00, /* Usage Maximum (FFh), */
0x81, 0x00, /* Input, */
0xC0 /* End Collection */
};
static int tf103c_dock_kbd_read(struct tf103c_dock_data *dock)
{
struct i2c_client *client = dock->kbd_client;
struct device *dev = &dock->ec_client->dev;
struct i2c_msg msgs[2];
u8 reg[2];
int ret;
reg[0] = TF103C_DOCK_KBD_DATA_REG & 0xff;
reg[1] = TF103C_DOCK_KBD_DATA_REG >> 8;
msgs[0].addr = client->addr;
msgs[0].flags = 0;
msgs[0].len = sizeof(reg);
msgs[0].buf = reg;
msgs[1].addr = client->addr;
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/delay.h`, `linux/dmi.h`, `linux/gpio/consumer.h`, `linux/gpio/machine.h`, `linux/hid.h`, `linux/i2c.h`, `linux/input.h`.
- Detected declarations: `struct tf103c_dock_data`, `function tf103c_dock_kbd_read`, `function tf103c_dock_kbd_write`, `function tf103c_dock_hid_parse`, `function tf103c_dock_hid_start`, `function tf103c_dock_hid_stop`, `function tf103c_dock_hid_open`, `function tf103c_dock_hid_close`, `function tf103c_dock_hid_raw_request`, `function tf103c_dock_report_toprow_kbd_hook`.
- Atlas domain: Driver Families / drivers/platform.
- 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.