drivers/input/misc/ad714x.c
Source file repositories/reference/linux-study-clean/drivers/input/misc/ad714x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/misc/ad714x.c- Extension
.c- Size
- 34919 bytes
- Lines
- 1205
- Domain
- Driver Families
- Bucket
- drivers/input
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/device.hlinux/export.hlinux/input.hlinux/interrupt.hlinux/slab.hlinux/input/ad714x.hlinux/module.had714x.h
Detected Declarations
struct ad714x_slider_drvstruct ad714x_wheel_drvstruct ad714x_touchpad_drvstruct ad714x_button_drvstruct ad714x_driver_dataenum ad714x_device_statefunction ad714x_use_com_intfunction ad714x_use_thr_intfunction ad714x_cal_highest_stagefunction ad714x_cal_abs_posfunction ad714x_button_state_machinefunction ad714x_slider_cal_sensor_valfunction ad714x_slider_cal_highest_stagefunction ad714x_slider_cal_abs_posfunction Responsefunction ad714x_slider_use_com_intfunction ad714x_slider_use_thr_intfunction ad714x_slider_state_machinefunction ad714x_wheel_cal_highest_stagefunction ad714x_wheel_cal_sensor_valfunction ad714x_wheel_cal_abs_posfunction ad714x_wheel_cal_flt_posfunction ad714x_wheel_use_com_intfunction ad714x_wheel_use_thr_intfunction ad714x_wheel_state_machinefunction touchpad_cal_sensor_valfunction touchpad_cal_highest_stagefunction touchpad_check_second_peakfunction touchpad_cal_abs_posfunction touchpad_cal_flt_posfunction touchpad_check_endpointfunction touchpad_use_com_intfunction touchpad_use_thr_intfunction ad714x_touchpad_state_machinefunction ad714x_hw_detectfunction ad714x_hw_initfunction ad714x_interrupt_threadfunction ad714x_suspendfunction ad714x_resumeexport ad714x_probe
Annotated Snippet
struct ad714x_slider_drv {
int highest_stage;
int abs_pos;
int flt_pos;
enum ad714x_device_state state;
struct input_dev *input;
};
struct ad714x_wheel_drv {
int abs_pos;
int flt_pos;
int pre_highest_stage;
int highest_stage;
enum ad714x_device_state state;
struct input_dev *input;
};
struct ad714x_touchpad_drv {
int x_highest_stage;
int x_flt_pos;
int x_abs_pos;
int y_highest_stage;
int y_flt_pos;
int y_abs_pos;
int left_ep;
int left_ep_val;
int right_ep;
int right_ep_val;
int top_ep;
int top_ep_val;
int bottom_ep;
int bottom_ep_val;
enum ad714x_device_state state;
struct input_dev *input;
};
struct ad714x_button_drv {
enum ad714x_device_state state;
/*
* Unlike slider/wheel/touchpad, all buttons point to
* same input_dev instance
*/
struct input_dev *input;
};
struct ad714x_driver_data {
struct ad714x_slider_drv *slider;
struct ad714x_wheel_drv *wheel;
struct ad714x_touchpad_drv *touchpad;
struct ad714x_button_drv *button;
};
/*
* information to integrate all things which will be private data
* of spi/i2c device
*/
static void ad714x_use_com_int(struct ad714x_chip *ad714x,
int start_stage, int end_stage)
{
unsigned short data;
unsigned short mask;
mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1);
ad714x->read(ad714x, STG_COM_INT_EN_REG, &data, 1);
data |= 1 << end_stage;
ad714x->write(ad714x, STG_COM_INT_EN_REG, data);
ad714x->read(ad714x, STG_HIGH_INT_EN_REG, &data, 1);
data &= ~mask;
ad714x->write(ad714x, STG_HIGH_INT_EN_REG, data);
}
static void ad714x_use_thr_int(struct ad714x_chip *ad714x,
int start_stage, int end_stage)
{
unsigned short data;
unsigned short mask;
mask = ((1 << (end_stage + 1)) - 1) - ((1 << start_stage) - 1);
ad714x->read(ad714x, STG_COM_INT_EN_REG, &data, 1);
data &= ~(1 << end_stage);
ad714x->write(ad714x, STG_COM_INT_EN_REG, data);
ad714x->read(ad714x, STG_HIGH_INT_EN_REG, &data, 1);
data |= mask;
ad714x->write(ad714x, STG_HIGH_INT_EN_REG, data);
}
Annotation
- Immediate include surface: `linux/device.h`, `linux/export.h`, `linux/input.h`, `linux/interrupt.h`, `linux/slab.h`, `linux/input/ad714x.h`, `linux/module.h`, `ad714x.h`.
- Detected declarations: `struct ad714x_slider_drv`, `struct ad714x_wheel_drv`, `struct ad714x_touchpad_drv`, `struct ad714x_button_drv`, `struct ad714x_driver_data`, `enum ad714x_device_state`, `function ad714x_use_com_int`, `function ad714x_use_thr_int`, `function ad714x_cal_highest_stage`, `function ad714x_cal_abs_pos`.
- Atlas domain: Driver Families / drivers/input.
- Implementation status: integration 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.