drivers/media/i2c/tvp514x.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/tvp514x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/tvp514x.c- Extension
.c- Size
- 32125 bytes
- Lines
- 1160
- 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.
- 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/i2c.hlinux/mod_devicetable.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/slab.hlinux/v4l2-mediabus.hlinux/videodev2.hmedia/i2c/tvp514x.hmedia/media-entity.hmedia/v4l2-async.hmedia/v4l2-common.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fwnode.hmedia/v4l2-mediabus.htvp514x_regs.h
Detected Declarations
struct tvp514x_std_infostruct tvp514x_decoderenum tvp514x_stdfunction tvp514x_read_regfunction dump_regfunction tvp514x_write_regfunction tvp514x_write_regsfunction tvp514x_query_current_stdfunction tvp514x_reg_dumpfunction tvp514x_configurefunction tvp514x_detectfunction tvp514x_querystdfunction tvp514x_s_stdfunction tvp514x_s_routingfunction tvp514x_s_ctrlfunction tvp514x_get_frame_intervalfunction tvp514x_set_frame_intervalfunction tvp514x_s_streamfunction tvp514x_enum_mbus_codefunction tvp514x_get_pad_formatfunction tvp514x_set_pad_formatfunction tvp514x_get_pdatafunction tvp514x_probefunction tvp514x_remove
Annotated Snippet
struct tvp514x_std_info {
unsigned long width;
unsigned long height;
u8 video_std;
struct v4l2_standard standard;
};
static struct tvp514x_reg tvp514x_reg_list_default[0x40];
static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable);
/**
* struct tvp514x_decoder - TVP5146/47 decoder object
* @sd: Subdevice Slave handle
* @hdl: embedded &struct v4l2_ctrl_handler
* @tvp514x_regs: copy of hw's regs with preset values.
* @pdata: Board specific
* @ver: Chip version
* @streaming: TVP5146/47 decoder streaming - enabled or disabled.
* @pix: Current pixel format
* @num_fmts: Number of formats
* @fmt_list: Format list
* @current_std: Current standard
* @num_stds: Number of standards
* @std_list: Standards list
* @input: Input routing at chip level
* @output: Output routing at chip level
* @pad: subdev media pad associated with the decoder
* @format: media bus frame format
* @int_seq: driver's register init sequence
*/
struct tvp514x_decoder {
struct v4l2_subdev sd;
struct v4l2_ctrl_handler hdl;
struct tvp514x_reg tvp514x_regs[ARRAY_SIZE(tvp514x_reg_list_default)];
const struct tvp514x_platform_data *pdata;
int ver;
int streaming;
struct v4l2_pix_format pix;
int num_fmts;
const struct v4l2_fmtdesc *fmt_list;
enum tvp514x_std current_std;
int num_stds;
const struct tvp514x_std_info *std_list;
/* Input and Output Routing parameters */
u32 input;
u32 output;
/* mc related members */
struct media_pad pad;
struct v4l2_mbus_framefmt format;
const struct tvp514x_reg *int_seq;
};
/* TVP514x default register values */
static struct tvp514x_reg tvp514x_reg_list_default[] = {
/* Composite selected */
{TOK_WRITE, REG_INPUT_SEL, 0x05},
{TOK_WRITE, REG_AFE_GAIN_CTRL, 0x0F},
/* Auto mode */
{TOK_WRITE, REG_VIDEO_STD, 0x00},
{TOK_WRITE, REG_OPERATION_MODE, 0x00},
{TOK_SKIP, REG_AUTOSWITCH_MASK, 0x3F},
{TOK_WRITE, REG_COLOR_KILLER, 0x10},
{TOK_WRITE, REG_LUMA_CONTROL1, 0x00},
{TOK_WRITE, REG_LUMA_CONTROL2, 0x00},
{TOK_WRITE, REG_LUMA_CONTROL3, 0x02},
{TOK_WRITE, REG_BRIGHTNESS, 0x80},
{TOK_WRITE, REG_CONTRAST, 0x80},
{TOK_WRITE, REG_SATURATION, 0x80},
{TOK_WRITE, REG_HUE, 0x00},
{TOK_WRITE, REG_CHROMA_CONTROL1, 0x00},
{TOK_WRITE, REG_CHROMA_CONTROL2, 0x0E},
/* Reserved */
{TOK_SKIP, 0x0F, 0x00},
{TOK_WRITE, REG_COMP_PR_SATURATION, 0x80},
{TOK_WRITE, REG_COMP_Y_CONTRAST, 0x80},
{TOK_WRITE, REG_COMP_PB_SATURATION, 0x80},
/* Reserved */
{TOK_SKIP, 0x13, 0x00},
{TOK_WRITE, REG_COMP_Y_BRIGHTNESS, 0x80},
/* Reserved */
{TOK_SKIP, 0x15, 0x00},
/* NTSC timing */
{TOK_SKIP, REG_AVID_START_PIXEL_LSB, 0x55},
{TOK_SKIP, REG_AVID_START_PIXEL_MSB, 0x00},
{TOK_SKIP, REG_AVID_STOP_PIXEL_LSB, 0x25},
Annotation
- Immediate include surface: `linux/delay.h`, `linux/i2c.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/of.h`, `linux/of_graph.h`, `linux/slab.h`, `linux/v4l2-mediabus.h`.
- Detected declarations: `struct tvp514x_std_info`, `struct tvp514x_decoder`, `enum tvp514x_std`, `function tvp514x_read_reg`, `function dump_reg`, `function tvp514x_write_reg`, `function tvp514x_write_regs`, `function tvp514x_query_current_std`, `function tvp514x_reg_dump`, `function tvp514x_configure`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.