drivers/input/touchscreen/himax_hx83112b.c
Source file repositories/reference/linux-study-clean/drivers/input/touchscreen/himax_hx83112b.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/touchscreen/himax_hx83112b.c- Extension
.c- Size
- 10291 bytes
- Lines
- 438
- 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/delay.hlinux/err.hlinux/gpio/consumer.hlinux/i2c.hlinux/input.hlinux/input/mt.hlinux/input/touchscreen.hlinux/interrupt.hlinux/kernel.hlinux/regmap.h
Detected Declarations
struct himax_event_pointstruct himax_eventstruct himax_ts_datastruct himax_chipstruct himax_ts_datafunction himax_bus_enable_burstfunction himax_bus_readfunction himax_resetfunction himax_read_product_idfunction himax_check_product_idfunction himax_input_registerfunction himax_event_get_num_pointsfunction himax_process_event_pointfunction himax_process_eventfunction himax_verify_checksumfunction himax_read_eventsfunction hx83100a_read_eventsfunction himax_handle_inputfunction himax_irq_handlerfunction himax_probefunction himax_suspendfunction himax_resume
Annotated Snippet
struct himax_event_point {
__be16 x;
__be16 y;
} __packed;
struct himax_event {
struct himax_event_point points[HIMAX_MAX_POINTS];
u8 majors[HIMAX_MAX_POINTS];
u8 pad0[2];
u8 num_points;
u8 pad1[2];
u8 checksum_fix;
} __packed;
static_assert(sizeof(struct himax_event) == 56);
struct himax_ts_data;
struct himax_chip {
u32 id;
int (*check_id)(struct himax_ts_data *ts);
int (*read_events)(struct himax_ts_data *ts, struct himax_event *event,
size_t length);
};
struct himax_ts_data {
const struct himax_chip *chip;
struct gpio_desc *gpiod_rst;
struct input_dev *input_dev;
struct i2c_client *client;
struct regmap *regmap;
struct touchscreen_properties props;
};
static const struct regmap_config himax_regmap_config = {
.reg_bits = 8,
.val_bits = 32,
.val_format_endian = REGMAP_ENDIAN_LITTLE,
};
static int himax_bus_enable_burst(struct himax_ts_data *ts)
{
int error;
error = regmap_write(ts->regmap, HIMAX_AHB_ADDR_CONTI,
HIMAX_AHB_CMD_CONTI);
if (error)
return error;
error = regmap_write(ts->regmap, HIMAX_AHB_ADDR_INCR4,
HIMAX_AHB_CMD_INCR4);
if (error)
return error;
return 0;
}
static int himax_bus_read(struct himax_ts_data *ts, u32 address, void *dst,
size_t length)
{
int error;
if (length > 4) {
error = himax_bus_enable_burst(ts);
if (error)
return error;
}
error = regmap_write(ts->regmap, HIMAX_AHB_ADDR_BYTE_0, address);
if (error)
return error;
error = regmap_write(ts->regmap, HIMAX_AHB_ADDR_ACCESS_DIRECTION,
HIMAX_AHB_CMD_ACCESS_DIRECTION_READ);
if (error)
return error;
if (length > 4)
error = regmap_noinc_read(ts->regmap, HIMAX_AHB_ADDR_RDATA_BYTE_0,
dst, length);
else
error = regmap_read(ts->regmap, HIMAX_AHB_ADDR_RDATA_BYTE_0,
dst);
if (error)
return error;
return 0;
}
static void himax_reset(struct himax_ts_data *ts)
{
Annotation
- Immediate include surface: `linux/delay.h`, `linux/err.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/input.h`, `linux/input/mt.h`, `linux/input/touchscreen.h`, `linux/interrupt.h`.
- Detected declarations: `struct himax_event_point`, `struct himax_event`, `struct himax_ts_data`, `struct himax_chip`, `struct himax_ts_data`, `function himax_bus_enable_burst`, `function himax_bus_read`, `function himax_reset`, `function himax_read_product_id`, `function himax_check_product_id`.
- 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.