drivers/media/pci/solo6x10/solo6x10-v4l2.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/solo6x10/solo6x10-v4l2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/solo6x10/solo6x10-v4l2.c- Extension
.c- Size
- 18497 bytes
- Lines
- 718
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/kthread.hlinux/freezer.hmedia/v4l2-ioctl.hmedia/v4l2-common.hmedia/v4l2-event.hmedia/videobuf2-v4l2.hmedia/videobuf2-dma-contig.hsolo6x10.hsolo6x10-tw28.h
Detected Declarations
function Copyrightfunction erase_offfunction solo_video_in_isrfunction solo_win_setupfunction solo_v4l2_ch_ext_4upfunction solo_v4l2_ch_ext_16upfunction solo_v4l2_chfunction solo_v4l2_set_chfunction solo_fillbuffunction solo_thread_tryfunction solo_threadfunction solo_start_threadfunction solo_stop_threadfunction solo_queue_setupfunction solo_start_streamingfunction solo_stop_streamingfunction solo_buf_queuefunction solo_querycapfunction solo_enum_ext_inputfunction solo_enum_inputfunction solo_set_inputfunction solo_get_inputfunction solo_enum_fmt_capfunction solo_try_fmt_capfunction solo_set_fmt_capfunction solo_get_fmt_capfunction solo_g_stdfunction solo_set_video_typefunction solo_s_stdfunction solo_s_ctrlfunction solo_v4l2_initfunction solo_v4l2_exit
Annotated Snippet
if (ctrl->val) {
solo_reg_write(solo_dev, SOLO_VI_MOTION_BORDER,
SOLO_VI_MOTION_Y_ADD |
SOLO_VI_MOTION_Y_VALUE(0x20) |
SOLO_VI_MOTION_CB_VALUE(0x10) |
SOLO_VI_MOTION_CR_VALUE(0x10));
solo_reg_write(solo_dev, SOLO_VI_MOTION_BAR,
SOLO_VI_MOTION_CR_ADD |
SOLO_VI_MOTION_Y_VALUE(0x10) |
SOLO_VI_MOTION_CB_VALUE(0x80) |
SOLO_VI_MOTION_CR_VALUE(0x10));
} else {
solo_reg_write(solo_dev, SOLO_VI_MOTION_BORDER, 0);
solo_reg_write(solo_dev, SOLO_VI_MOTION_BAR, 0);
}
return 0;
default:
break;
}
return -EINVAL;
}
static const struct v4l2_file_operations solo_v4l2_fops = {
.owner = THIS_MODULE,
.open = v4l2_fh_open,
.release = vb2_fop_release,
.read = vb2_fop_read,
.poll = vb2_fop_poll,
.mmap = vb2_fop_mmap,
.unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops solo_v4l2_ioctl_ops = {
.vidioc_querycap = solo_querycap,
.vidioc_s_std = solo_s_std,
.vidioc_g_std = solo_g_std,
/* Input callbacks */
.vidioc_enum_input = solo_enum_input,
.vidioc_s_input = solo_set_input,
.vidioc_g_input = solo_get_input,
/* Video capture format callbacks */
.vidioc_enum_fmt_vid_cap = solo_enum_fmt_cap,
.vidioc_try_fmt_vid_cap = solo_try_fmt_cap,
.vidioc_s_fmt_vid_cap = solo_set_fmt_cap,
.vidioc_g_fmt_vid_cap = solo_get_fmt_cap,
/* Streaming I/O */
.vidioc_reqbufs = vb2_ioctl_reqbufs,
.vidioc_querybuf = vb2_ioctl_querybuf,
.vidioc_qbuf = vb2_ioctl_qbuf,
.vidioc_dqbuf = vb2_ioctl_dqbuf,
.vidioc_streamon = vb2_ioctl_streamon,
.vidioc_streamoff = vb2_ioctl_streamoff,
/* Logging and events */
.vidioc_log_status = v4l2_ctrl_log_status,
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
};
static const struct video_device solo_v4l2_template = {
.name = SOLO6X10_NAME,
.fops = &solo_v4l2_fops,
.ioctl_ops = &solo_v4l2_ioctl_ops,
.minor = -1,
.release = video_device_release,
.tvnorms = V4L2_STD_NTSC_M | V4L2_STD_PAL,
.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING,
};
static const struct v4l2_ctrl_ops solo_ctrl_ops = {
.s_ctrl = solo_s_ctrl,
};
static const struct v4l2_ctrl_config solo_motion_trace_ctrl = {
.ops = &solo_ctrl_ops,
.id = V4L2_CID_MOTION_TRACE,
.name = "Motion Detection Trace",
.type = V4L2_CTRL_TYPE_BOOLEAN,
.max = 1,
.step = 1,
};
int solo_v4l2_init(struct solo_dev *solo_dev, unsigned nr)
{
int ret;
int i;
init_waitqueue_head(&solo_dev->disp_thread_wait);
spin_lock_init(&solo_dev->slock);
mutex_init(&solo_dev->lock);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/kthread.h`, `linux/freezer.h`, `media/v4l2-ioctl.h`, `media/v4l2-common.h`, `media/v4l2-event.h`, `media/videobuf2-v4l2.h`.
- Detected declarations: `function Copyright`, `function erase_off`, `function solo_video_in_isr`, `function solo_win_setup`, `function solo_v4l2_ch_ext_4up`, `function solo_v4l2_ch_ext_16up`, `function solo_v4l2_ch`, `function solo_v4l2_set_ch`, `function solo_fillbuf`, `function solo_thread_try`.
- 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.
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.