drivers/media/i2c/tda1997x.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/tda1997x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/tda1997x.c- Extension
.c- Size
- 76799 bytes
- Lines
- 2849
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/hdmi.hlinux/i2c.hlinux/init.hlinux/interrupt.hlinux/kernel.hlinux/module.hlinux/of_graph.hlinux/platform_device.hlinux/regulator/consumer.hlinux/types.hlinux/v4l2-dv-timings.hlinux/videodev2.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-dv-timings.hmedia/v4l2-event.hmedia/v4l2-fwnode.hmedia/i2c/tda1997x.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hdt-bindings/media/tda1997x.htda1997x_regs.h
Detected Declarations
struct color_matrix_coefsstruct tda1997x_chip_infostruct tda1997x_statestruct blanking_codesenum audfmt_typesenum tda1997x_typeenum tda1997x_hdmi_padsenum hpd_modefunction tda1997x_cec_readfunction tda1997x_cec_writefunction tda1997x_setpagefunction io_readfunction io_read16function io_read24function io_readnfunction io_writefunction io_write16function io_write24function tda1997x_manual_hpdfunction tda1997x_delayed_work_enable_hpdfunction tda1997x_disable_edidfunction tda1997x_enable_edidfunction tda1997x_setup_formatfunction tda1997x_configure_cscfunction tda1997x_configure_vhreffunction tda1997x_configure_vidoutfunction tda1997x_configure_audoutfunction tda1997x_hdmi_info_resetfunction tda1997x_power_modefunction tda1997x_detect_tx_5vfunction tda1997x_detect_tx_hpdfunction tda1997x_detect_stdfunction tda1997x_reset_n1function tda1997x_read_activity_status_regsfunction set_rgb_quantization_rangefunction tda1997x_parse_infoframefunction tda1997x_irq_susfunction tda1997x_irq_ddcfunction tda1997x_irq_ratefunction tda1997x_irq_infofunction tda1997x_irq_audiofunction tda1997x_irq_hdcpfunction tda1997x_isr_threadfunction tda1997x_g_input_statusfunction tda1997x_s_dv_timingsfunction tda1997x_g_dv_timingsfunction tda1997x_query_dv_timingsfunction tda1997x_init_state
Annotated Snippet
struct color_matrix_coefs {
const char *name;
/* Input offsets */
s16 offint1;
s16 offint2;
s16 offint3;
/* Coeficients */
s16 p11coef;
s16 p12coef;
s16 p13coef;
s16 p21coef;
s16 p22coef;
s16 p23coef;
s16 p31coef;
s16 p32coef;
s16 p33coef;
/* Output offsets */
s16 offout1;
s16 offout2;
s16 offout3;
};
enum {
ITU709_RGBFULL,
ITU601_RGBFULL,
RGBLIMITED_RGBFULL,
RGBLIMITED_ITU601,
RGBLIMITED_ITU709,
RGBFULL_ITU601,
RGBFULL_ITU709,
};
/* NB: 4096 is 1.0 using fixed point numbers */
static const struct color_matrix_coefs conv_matrix[] = {
{
"YUV709 -> RGB full",
-256, -2048, -2048,
4769, -2183, -873,
4769, 7343, 0,
4769, 0, 8652,
0, 0, 0,
},
{
"YUV601 -> RGB full",
-256, -2048, -2048,
4769, -3330, -1602,
4769, 6538, 0,
4769, 0, 8264,
256, 256, 256,
},
{
"RGB limited -> RGB full",
-256, -256, -256,
0, 4769, 0,
0, 0, 4769,
4769, 0, 0,
0, 0, 0,
},
{
"RGB limited -> ITU601",
-256, -256, -256,
2404, 1225, 467,
-1754, 2095, -341,
-1388, -707, 2095,
256, 2048, 2048,
},
{
"RGB limited -> ITU709",
-256, -256, -256,
2918, 867, 295,
-1894, 2087, -190,
-1607, -477, 2087,
256, 2048, 2048,
},
{
"RGB full -> ITU601",
0, 0, 0,
2065, 1052, 401,
-1506, 1799, -293,
-1192, -607, 1799,
256, 2048, 2048,
},
{
"RGB full -> ITU709",
0, 0, 0,
2506, 745, 253,
-1627, 1792, -163,
-1380, -410, 1792,
256, 2048, 2048,
},
Annotation
- Immediate include surface: `linux/delay.h`, `linux/hdmi.h`, `linux/i2c.h`, `linux/init.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/module.h`, `linux/of_graph.h`.
- Detected declarations: `struct color_matrix_coefs`, `struct tda1997x_chip_info`, `struct tda1997x_state`, `struct blanking_codes`, `enum audfmt_types`, `enum tda1997x_type`, `enum tda1997x_hdmi_pads`, `enum hpd_mode`, `function tda1997x_cec_read`, `function tda1997x_cec_write`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.