drivers/staging/media/av7110/av7110.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/av7110/av7110.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/av7110/av7110.c- Extension
.c- Size
- 80436 bytes
- Lines
- 2887
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/module.hlinux/kmod.hlinux/delay.hlinux/fs.hlinux/timer.hlinux/poll.hlinux/kernel.hlinux/sched.hlinux/types.hlinux/fcntl.hlinux/interrupt.hlinux/string.hlinux/pci.hlinux/vmalloc.hlinux/firmware.hlinux/crc32.hlinux/i2c.hlinux/kthread.hlinux/slab.hlinux/unaligned.hasm/byteorder.hlinux/dvb/frontend.hmedia/dvb_frontend.httpci-eeprom.hav7110.hav7110_hw.hav7110_av.hav7110_ca.hav7110_ipack.hbsbe1.hlnbp21.hbsru6.h
Detected Declarations
function init_av7110_avfunction recover_armfunction av7110_arm_syncfunction arm_threadfunction DvbDmxFilterCallbackfunction start_debi_dmafunction debiirqfunction gpioirqfunction dvb_osd_ioctlfunction SetPIDsfunction ChangePIDsfunction StartHWFilterfunction StopHWFilterfunction dvb_feed_start_pidfunction dvb_feed_stop_pidfunction av7110_start_feedfunction av7110_stop_feedfunction restart_feedsfunction dvb_get_stcfunction av7110_set_tonefunction av7110_diseqc_send_master_cmdfunction av7110_diseqc_send_burstfunction stop_ts_capturefunction start_ts_capturefunction budget_start_feedfunction budget_stop_feedfunction vpeirqfunction av7110_registerfunction dvb_unregisterfunction i2c_writeregfunction i2c_readregfunction check_firmwarefunction put_firmwarefunction get_firmwarefunction alps_bsrv2_tuner_set_paramsfunction alps_tdbe2_tuner_set_paramsfunction grundig_29504_451_tuner_set_paramsfunction philips_cd1516_tuner_set_paramsfunction alps_tdlb7_tuner_set_paramsfunction alps_tdlb7_request_firmwarefunction nexusca_stv0297_tuner_set_paramsfunction grundig_29504_401_tuner_set_paramsfunction av7110_fe_lock_fixfunction av7110_fe_set_frontendfunction av7110_fe_initfunction av7110_fe_read_statusfunction av7110_fe_diseqc_reset_overloadfunction av7110_fe_diseqc_send_master_cmd
Annotated Snippet
static const struct file_operations dvb_osd_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = dvb_generic_ioctl,
.open = dvb_generic_open,
.release = dvb_generic_release,
.llseek = noop_llseek,
};
static struct dvb_device dvbdev_osd = {
.priv = NULL,
.users = 1,
.writers = 1,
.fops = &dvb_osd_fops,
.kernel_ioctl = dvb_osd_ioctl,
};
#endif /* CONFIG_DVB_AV7110_OSD */
static inline int SetPIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
u16 subpid, u16 pcrpid)
{
u16 aflags = 0;
dprintk(4, "%p\n", av7110);
if (vpid == 0x1fff || apid == 0x1fff ||
ttpid == 0x1fff || subpid == 0x1fff || pcrpid == 0x1fff) {
vpid = 0;
apid = 0;
ttpid = 0;
subpid = 0;
pcrpid = 0;
av7110->pids[DMX_PES_VIDEO] = 0;
av7110->pids[DMX_PES_AUDIO] = 0;
av7110->pids[DMX_PES_TELETEXT] = 0;
av7110->pids[DMX_PES_PCR] = 0;
}
if (av7110->audiostate.bypass_mode)
aflags |= 0x8000;
return av7110_fw_cmd(av7110, COMTYPE_PIDFILTER,
AV7110_MULTI_PID, 6,
pcrpid, vpid, apid, ttpid, subpid, aflags);
}
int ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
u16 subpid, u16 pcrpid)
{
int ret = 0;
dprintk(4, "%p\n", av7110);
if (mutex_lock_interruptible(&av7110->pid_mutex))
return -ERESTARTSYS;
if (!(vpid & 0x8000))
av7110->pids[DMX_PES_VIDEO] = vpid;
if (!(apid & 0x8000))
av7110->pids[DMX_PES_AUDIO] = apid;
if (!(ttpid & 0x8000))
av7110->pids[DMX_PES_TELETEXT] = ttpid;
if (!(pcrpid & 0x8000))
av7110->pids[DMX_PES_PCR] = pcrpid;
av7110->pids[DMX_PES_SUBTITLE] = 0;
if (av7110->fe_synced) {
pcrpid = av7110->pids[DMX_PES_PCR];
ret = SetPIDs(av7110, vpid, apid, ttpid, subpid, pcrpid);
}
mutex_unlock(&av7110->pid_mutex);
return ret;
}
/******************************************************************************
* hardware filter functions
******************************************************************************/
static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter)
{
struct dvb_demux_feed *dvbdmxfeed = dvbdmxfilter->feed;
struct av7110 *av7110 = dvbdmxfeed->demux->priv;
u16 buf[20];
int ret, i;
u16 handle;
u16 mode = 0xb96a;
dprintk(4, "%p\n", av7110);
Annotation
- Immediate include surface: `linux/module.h`, `linux/kmod.h`, `linux/delay.h`, `linux/fs.h`, `linux/timer.h`, `linux/poll.h`, `linux/kernel.h`, `linux/sched.h`.
- Detected declarations: `function init_av7110_av`, `function recover_arm`, `function av7110_arm_sync`, `function arm_thread`, `function DvbDmxFilterCallback`, `function start_debi_dma`, `function debiirq`, `function gpioirq`, `function dvb_osd_ioctl`, `function SetPIDs`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: pattern 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.