drivers/input/touchscreen/fsl-imx25-tcq.c
Source file repositories/reference/linux-study-clean/drivers/input/touchscreen/fsl-imx25-tcq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/touchscreen/fsl-imx25-tcq.c- Extension
.c- Size
- 15418 bytes
- Lines
- 588
- 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/clk.hlinux/device.hlinux/input.hlinux/interrupt.hlinux/mfd/imx25-tsadc.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/regmap.h
Detected Declarations
struct mx25_tcq_privenum mx25_tcq_modeenum mx25_adc_configurationsfunction imx25_setup_queue_cfgsfunction imx25_setup_queue_4wirefunction mx25_tcq_disable_touch_irqfunction mx25_tcq_enable_touch_irqfunction mx25_tcq_disable_fifo_irqfunction mx25_tcq_enable_fifo_irqfunction mx25_tcq_force_queue_startfunction mx25_tcq_force_queue_stopfunction mx25_tcq_fifo_resetfunction mx25_tcq_re_enable_touch_detectionfunction mx25_tcq_create_event_for_4wirefunction mx25_tcq_irq_threadfunction mx25_tcq_irqfunction mx25_tcq_initfunction mx25_tcq_parse_dtfunction mx25_tcq_openfunction mx25_tcq_closefunction mx25_tcq_probe
Annotated Snippet
struct mx25_tcq_priv {
struct regmap *regs;
struct regmap *core_regs;
struct input_dev *idev;
enum mx25_tcq_mode mode;
unsigned int pen_threshold;
unsigned int sample_count;
unsigned int expected_samples;
unsigned int pen_debounce;
unsigned int settling_time;
struct clk *clk;
int irq;
struct device *dev;
};
static const struct regmap_config mx25_tcq_regconfig = {
.max_register = 0x5c,
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
};
static const struct of_device_id mx25_tcq_ids[] = {
{ .compatible = "fsl,imx25-tcq", },
{ /* Sentinel */ }
};
MODULE_DEVICE_TABLE(of, mx25_tcq_ids);
#define TSC_4WIRE_PRE_INDEX 0
#define TSC_4WIRE_X_INDEX 1
#define TSC_4WIRE_Y_INDEX 2
#define TSC_4WIRE_POST_INDEX 3
#define TSC_4WIRE_LEAVE 4
#define MX25_TSC_DEF_THRESHOLD 80
#define TSC_MAX_SAMPLES 16
#define MX25_TSC_REPEAT_WAIT 14
enum mx25_adc_configurations {
MX25_CFG_PRECHARGE = 0,
MX25_CFG_TOUCH_DETECT,
MX25_CFG_X_MEASUREMENT,
MX25_CFG_Y_MEASUREMENT,
};
#define MX25_PRECHARGE_VALUE (\
MX25_ADCQ_CFG_YPLL_OFF | \
MX25_ADCQ_CFG_XNUR_OFF | \
MX25_ADCQ_CFG_XPUL_HIGH | \
MX25_ADCQ_CFG_REFP_INT | \
MX25_ADCQ_CFG_IN_XP | \
MX25_ADCQ_CFG_REFN_NGND2 | \
MX25_ADCQ_CFG_IGS)
#define MX25_TOUCH_DETECT_VALUE (\
MX25_ADCQ_CFG_YNLR | \
MX25_ADCQ_CFG_YPLL_OFF | \
MX25_ADCQ_CFG_XNUR_OFF | \
MX25_ADCQ_CFG_XPUL_OFF | \
MX25_ADCQ_CFG_REFP_INT | \
MX25_ADCQ_CFG_IN_XP | \
MX25_ADCQ_CFG_REFN_NGND2 | \
MX25_ADCQ_CFG_PENIACK)
static void imx25_setup_queue_cfgs(struct mx25_tcq_priv *priv,
unsigned int settling_cnt)
{
u32 precharge_cfg =
MX25_PRECHARGE_VALUE |
MX25_ADCQ_CFG_SETTLING_TIME(settling_cnt);
u32 touch_detect_cfg =
MX25_TOUCH_DETECT_VALUE |
MX25_ADCQ_CFG_NOS(1) |
MX25_ADCQ_CFG_SETTLING_TIME(settling_cnt);
regmap_write(priv->core_regs, MX25_TSC_TICR, precharge_cfg);
/* PRECHARGE */
regmap_write(priv->regs, MX25_ADCQ_CFG(MX25_CFG_PRECHARGE),
precharge_cfg);
/* TOUCH_DETECT */
regmap_write(priv->regs, MX25_ADCQ_CFG(MX25_CFG_TOUCH_DETECT),
touch_detect_cfg);
/* X Measurement */
regmap_write(priv->regs, MX25_ADCQ_CFG(MX25_CFG_X_MEASUREMENT),
MX25_ADCQ_CFG_YPLL_OFF |
MX25_ADCQ_CFG_XNUR_LOW |
Annotation
- Immediate include surface: `linux/clk.h`, `linux/device.h`, `linux/input.h`, `linux/interrupt.h`, `linux/mfd/imx25-tsadc.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`.
- Detected declarations: `struct mx25_tcq_priv`, `enum mx25_tcq_mode`, `enum mx25_adc_configurations`, `function imx25_setup_queue_cfgs`, `function imx25_setup_queue_4wire`, `function mx25_tcq_disable_touch_irq`, `function mx25_tcq_enable_touch_irq`, `function mx25_tcq_disable_fifo_irq`, `function mx25_tcq_enable_fifo_irq`, `function mx25_tcq_force_queue_start`.
- 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.