drivers/input/touchscreen/bcm_iproc_tsc.c
Source file repositories/reference/linux-study-clean/drivers/input/touchscreen/bcm_iproc_tsc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/input/touchscreen/bcm_iproc_tsc.c- Extension
.c- Size
- 13470 bytes
- Lines
- 523
- 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/module.hlinux/init.hlinux/input.hlinux/delay.hlinux/interrupt.hlinux/keyboard.hlinux/platform_device.hlinux/slab.hlinux/of.hasm/irq.hlinux/io.hlinux/clk.hlinux/serio.hlinux/mfd/syscon.hlinux/regmap.h
Detected Declarations
struct tsc_paramstruct iproc_ts_privfunction ts_reg_dumpfunction iproc_touchscreen_interruptfunction iproc_ts_startfunction iproc_ts_stopfunction iproc_get_tsc_configfunction iproc_ts_probe
Annotated Snippet
struct tsc_param {
/* Each step is 1024 us. Valid 1-256 */
u32 scanning_period;
/* Each step is 512 us. Valid 0-255 */
u32 debounce_timeout;
/*
* The settling duration (in ms) is the amount of time the tsc
* waits to allow the voltage to settle after turning on the
* drivers in detection mode. Valid values: 0-11
* 0 = 0.008 ms
* 1 = 0.01 ms
* 2 = 0.02 ms
* 3 = 0.04 ms
* 4 = 0.08 ms
* 5 = 0.16 ms
* 6 = 0.32 ms
* 7 = 0.64 ms
* 8 = 1.28 ms
* 9 = 2.56 ms
* 10 = 5.12 ms
* 11 = 10.24 ms
*/
u32 settling_timeout;
/* touch timeout in sample counts */
u32 touch_timeout;
/*
* Number of data samples which are averaged before a final data point
* is placed into the FIFO
*/
u32 average_data;
/* FIFO threshold */
u32 fifo_threshold;
/* Optional standard touchscreen properties. */
u32 max_x;
u32 max_y;
u32 fuzz_x;
u32 fuzz_y;
bool invert_x;
bool invert_y;
};
struct iproc_ts_priv {
struct platform_device *pdev;
struct input_dev *idev;
struct regmap *regmap;
struct clk *tsc_clk;
int pen_status;
struct tsc_param cfg_params;
};
/*
* Set default values the same as hardware reset values
* except for fifo_threshold with is set to 1.
*/
static const struct tsc_param iproc_default_config = {
.scanning_period = 0x5, /* 1 to 256 */
.debounce_timeout = 0x28, /* 0 to 255 */
.settling_timeout = 0x7, /* 0 to 11 */
.touch_timeout = 0xa, /* 0 to 255 */
.average_data = 5, /* entry 5 = 32 pts */
.fifo_threshold = 1, /* 0 to 31 */
.max_x = X_MAX,
.max_y = Y_MAX,
};
static void ts_reg_dump(struct iproc_ts_priv *priv)
{
struct device *dev = &priv->pdev->dev;
dbg_reg(dev, priv, REGCTL1);
dbg_reg(dev, priv, REGCTL2);
dbg_reg(dev, priv, INTERRUPT_THRES);
dbg_reg(dev, priv, INTERRUPT_MASK);
dbg_reg(dev, priv, INTERRUPT_STATUS);
dbg_reg(dev, priv, CONTROLLER_STATUS);
dbg_reg(dev, priv, FIFO_DATA);
dbg_reg(dev, priv, ANALOG_CONTROL);
dbg_reg(dev, priv, AUX_DATA);
dbg_reg(dev, priv, DEBOUNCE_CNTR_STAT);
dbg_reg(dev, priv, SCAN_CNTR_STAT);
dbg_reg(dev, priv, REM_CNTR_STAT);
dbg_reg(dev, priv, SETTLING_TIMER_STAT);
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/input.h`, `linux/delay.h`, `linux/interrupt.h`, `linux/keyboard.h`, `linux/platform_device.h`, `linux/slab.h`.
- Detected declarations: `struct tsc_param`, `struct iproc_ts_priv`, `function ts_reg_dump`, `function iproc_touchscreen_interrupt`, `function iproc_ts_start`, `function iproc_ts_stop`, `function iproc_get_tsc_config`, `function iproc_ts_probe`.
- 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.