drivers/media/i2c/saa6752hs.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/saa6752hs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/saa6752hs.c- Extension
.c- Size
- 21140 bytes
- Lines
- 788
- 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/module.hlinux/kernel.hlinux/string.hlinux/timer.hlinux/delay.hlinux/errno.hlinux/slab.hlinux/poll.hlinux/i2c.hlinux/types.hlinux/videodev2.hlinux/init.hlinux/crc32.hmedia/v4l2-device.hmedia/v4l2-ctrls.hmedia/v4l2-common.h
Detected Declarations
struct saa6752hs_mpeg_paramsstruct saa6752hs_stateenum saa6752hs_videoformatenum saa6752hs_commandfunction saa6752hs_chip_commandfunction set_reg8function set_reg16function saa6752hs_set_bitratefunction saa6752hs_try_ctrlfunction saa6752hs_s_ctrlfunction saa6752hs_initfunction saa6752hs_get_fmtfunction saa6752hs_set_fmtfunction saa6752hs_s_stdfunction saa6752hs_probefunction saa6752hs_remove
Annotated Snippet
struct saa6752hs_mpeg_params {
/* transport streams */
__u16 ts_pid_pmt;
__u16 ts_pid_audio;
__u16 ts_pid_video;
__u16 ts_pid_pcr;
/* audio */
enum v4l2_mpeg_audio_encoding au_encoding;
enum v4l2_mpeg_audio_l2_bitrate au_l2_bitrate;
enum v4l2_mpeg_audio_ac3_bitrate au_ac3_bitrate;
/* video */
enum v4l2_mpeg_video_aspect vi_aspect;
enum v4l2_mpeg_video_bitrate_mode vi_bitrate_mode;
__u32 vi_bitrate;
__u32 vi_bitrate_peak;
};
static const struct v4l2_format v4l2_format_table[] =
{
[SAA6752HS_VF_D1] =
{ .fmt = { .pix = { .width = 720, .height = 576 }}},
[SAA6752HS_VF_2_3_D1] =
{ .fmt = { .pix = { .width = 480, .height = 576 }}},
[SAA6752HS_VF_1_2_D1] =
{ .fmt = { .pix = { .width = 352, .height = 576 }}},
[SAA6752HS_VF_SIF] =
{ .fmt = { .pix = { .width = 352, .height = 288 }}},
[SAA6752HS_VF_UNKNOWN] =
{ .fmt = { .pix = { .width = 0, .height = 0}}},
};
struct saa6752hs_state {
struct v4l2_subdev sd;
struct v4l2_ctrl_handler hdl;
struct { /* video bitrate mode control cluster */
struct v4l2_ctrl *video_bitrate_mode;
struct v4l2_ctrl *video_bitrate;
struct v4l2_ctrl *video_bitrate_peak;
};
u32 revision;
int has_ac3;
struct saa6752hs_mpeg_params params;
enum saa6752hs_videoformat video_format;
v4l2_std_id standard;
};
enum saa6752hs_command {
SAA6752HS_COMMAND_RESET = 0,
SAA6752HS_COMMAND_STOP = 1,
SAA6752HS_COMMAND_START = 2,
SAA6752HS_COMMAND_PAUSE = 3,
SAA6752HS_COMMAND_RECONFIGURE = 4,
SAA6752HS_COMMAND_SLEEP = 5,
SAA6752HS_COMMAND_RECONFIGURE_FORCE = 6,
SAA6752HS_COMMAND_MAX
};
static inline struct saa6752hs_state *to_state(struct v4l2_subdev *sd)
{
return container_of(sd, struct saa6752hs_state, sd);
}
/* ---------------------------------------------------------------------- */
static const u8 PAT[] = {
0xc2, /* i2c register */
0x00, /* table number for encoder */
0x47, /* sync */
0x40, 0x00, /* transport_error_indicator(0), payload_unit_start(1), transport_priority(0), pid(0) */
0x10, /* transport_scrambling_control(00), adaptation_field_control(01), continuity_counter(0) */
0x00, /* PSI pointer to start of table */
0x00, /* tid(0) */
0xb0, 0x0d, /* section_syntax_indicator(1), section_length(13) */
0x00, 0x01, /* transport_stream_id(1) */
0xc1, /* version_number(0), current_next_indicator(1) */
0x00, 0x00, /* section_number(0), last_section_number(0) */
0x00, 0x01, /* program_number(1) */
0xe0, 0x00, /* PMT PID */
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/string.h`, `linux/timer.h`, `linux/delay.h`, `linux/errno.h`, `linux/slab.h`, `linux/poll.h`.
- Detected declarations: `struct saa6752hs_mpeg_params`, `struct saa6752hs_state`, `enum saa6752hs_videoformat`, `enum saa6752hs_command`, `function saa6752hs_chip_command`, `function set_reg8`, `function set_reg16`, `function saa6752hs_set_bitrate`, `function saa6752hs_try_ctrl`, `function saa6752hs_s_ctrl`.
- 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.