drivers/media/common/cx2341x.c
Source file repositories/reference/linux-study-clean/drivers/media/common/cx2341x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/common/cx2341x.c- Extension
.c- Size
- 57220 bytes
- Lines
- 1779
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/errno.hlinux/kernel.hlinux/init.hlinux/types.hlinux/videodev2.hmedia/tuner.hmedia/drv-intf/cx2341x.hmedia/v4l2-common.h
Detected Declarations
function cx2341x_ctrl_fillfunction cx2341x_get_ctrlfunction cx2341x_set_ctrlfunction cx2341x_ctrl_query_fillfunction cx2341x_ctrl_queryfunction cx2341x_calc_audio_propertiesfunction v4l2_ctrl_checkfunction cx2341x_ext_ctrlsfunction cx2341x_fill_defaultsfunction cx2341x_apifunction cx2341x_updatefunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction CMP_FIELDfunction cx2341x_log_statusfunction cx2341x_hdl_apifunction cx2341x_neqfunction cx2341x_try_ctrlfunction cx2341x_s_ctrlfunction cx2341x_handler_initfunction cx2341x_handler_set_50hzfunction cx2341x_handler_setupfunction cx2341x_handler_set_busyexport cx2341x_mpeg_ctrlsexport cx2341x_ctrl_queryexport cx2341x_ctrl_get_menuexport cx2341x_ext_ctrlsexport cx2341x_fill_defaultsexport cx2341x_updateexport cx2341x_log_statusexport cx2341x_handler_initexport cx2341x_handler_set_50hzexport cx2341x_handler_setupexport cx2341x_handler_set_busy
Annotated Snippet
if (params->capabilities & CX2341X_CAP_HAS_AC3) {
/*
* The state of L2 & AC3 bitrate controls can change
* when this control changes, but v4l2_ctrl_query_fill()
* already sets V4L2_CTRL_FLAG_UPDATE for
* V4L2_CID_MPEG_AUDIO_ENCODING, so we don't here.
*/
return v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_ENCODING_LAYER_2,
V4L2_MPEG_AUDIO_ENCODING_AC3, 1,
default_params.audio_encoding);
}
return v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_ENCODING_LAYER_2,
V4L2_MPEG_AUDIO_ENCODING_LAYER_2, 1,
default_params.audio_encoding);
case V4L2_CID_MPEG_AUDIO_L2_BITRATE:
err = v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_L2_BITRATE_192K,
V4L2_MPEG_AUDIO_L2_BITRATE_384K, 1,
default_params.audio_l2_bitrate);
if (err)
return err;
if (params->capabilities & CX2341X_CAP_HAS_AC3 &&
params->audio_encoding != V4L2_MPEG_AUDIO_ENCODING_LAYER_2)
qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
return 0;
case V4L2_CID_MPEG_AUDIO_MODE:
return v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_MODE_STEREO,
V4L2_MPEG_AUDIO_MODE_MONO, 1,
V4L2_MPEG_AUDIO_MODE_STEREO);
case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION:
err = v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4,
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16, 1,
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4);
if (err == 0 &&
params->audio_mode != V4L2_MPEG_AUDIO_MODE_JOINT_STEREO)
qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
return err;
case V4L2_CID_MPEG_AUDIO_EMPHASIS:
return v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_EMPHASIS_NONE,
V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17, 1,
V4L2_MPEG_AUDIO_EMPHASIS_NONE);
case V4L2_CID_MPEG_AUDIO_CRC:
return v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_CRC_NONE,
V4L2_MPEG_AUDIO_CRC_CRC16, 1,
V4L2_MPEG_AUDIO_CRC_NONE);
case V4L2_CID_MPEG_AUDIO_MUTE:
return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0);
case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:
err = v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_AC3_BITRATE_48K,
V4L2_MPEG_AUDIO_AC3_BITRATE_448K, 1,
default_params.audio_ac3_bitrate);
if (err)
return err;
if (params->capabilities & CX2341X_CAP_HAS_AC3) {
if (params->audio_encoding !=
V4L2_MPEG_AUDIO_ENCODING_AC3)
qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
} else
qctrl->flags |= V4L2_CTRL_FLAG_DISABLED;
return 0;
case V4L2_CID_MPEG_VIDEO_ENCODING:
/* this setting is read-only for the cx2341x since the
V4L2_CID_MPEG_STREAM_TYPE really determines the
MPEG-1/2 setting */
err = v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_VIDEO_ENCODING_MPEG_1,
V4L2_MPEG_VIDEO_ENCODING_MPEG_2, 1,
V4L2_MPEG_VIDEO_ENCODING_MPEG_2);
if (err == 0)
qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
return err;
case V4L2_CID_MPEG_VIDEO_ASPECT:
return v4l2_ctrl_query_fill(qctrl,
Annotation
- Immediate include surface: `linux/module.h`, `linux/errno.h`, `linux/kernel.h`, `linux/init.h`, `linux/types.h`, `linux/videodev2.h`, `media/tuner.h`, `media/drv-intf/cx2341x.h`.
- Detected declarations: `function cx2341x_ctrl_fill`, `function cx2341x_get_ctrl`, `function cx2341x_set_ctrl`, `function cx2341x_ctrl_query_fill`, `function cx2341x_ctrl_query`, `function cx2341x_calc_audio_properties`, `function v4l2_ctrl_check`, `function cx2341x_ext_ctrls`, `function cx2341x_fill_defaults`, `function cx2341x_api`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration 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.