drivers/media/pci/saa7164/saa7164-dvb.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/saa7164/saa7164-dvb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/saa7164/saa7164-dvb.c- Extension
.c- Size
- 21434 bytes
- Lines
- 741
- 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
saa7164.htda10048.htda18271.hs5h1411.hsi2157.hsi2168.hlgdt3306a.h
Detected Declarations
function si2157_attachfunction saa7164_dvb_stop_portfunction saa7164_dvb_acquire_portfunction saa7164_dvb_pause_portfunction saa7164_dvb_stop_streamingfunction saa7164_dvb_start_portfunction saa7164_dvb_start_feedfunction saa7164_dvb_stop_feedfunction dvb_registerfunction saa7164_dvb_unregisterfunction saa7164_dvb_register
Annotated Snippet
if ((result != SAA_OK) && (result != SAA_ERR_ALREADY_STOPPED)) {
printk(KERN_ERR "%s() acquire/forced stop transition failed, res = 0x%x\n",
__func__, result);
}
ret = -EIO;
goto out;
} else
dprintk(DBGLVL_DVB, "%s() Acquired\n", __func__);
/* Pause the hardware */
result = saa7164_api_transition_port(port, SAA_DMASTATE_PAUSE);
if ((result != SAA_OK) && (result != SAA_ERR_ALREADY_STOPPED)) {
printk(KERN_ERR "%s() pause transition failed, res = 0x%x\n",
__func__, result);
/* Stop the hardware, regardless */
result = saa7164_api_transition_port(port, SAA_DMASTATE_STOP);
if ((result != SAA_OK) && (result != SAA_ERR_ALREADY_STOPPED)) {
printk(KERN_ERR "%s() pause/forced stop transition failed, res = 0x%x\n",
__func__, result);
}
ret = -EIO;
goto out;
} else
dprintk(DBGLVL_DVB, "%s() Paused\n", __func__);
/* Start the hardware */
result = saa7164_api_transition_port(port, SAA_DMASTATE_RUN);
if ((result != SAA_OK) && (result != SAA_ERR_ALREADY_STOPPED)) {
printk(KERN_ERR "%s() run transition failed, result = 0x%x\n",
__func__, result);
/* Stop the hardware, regardless */
result = saa7164_api_transition_port(port, SAA_DMASTATE_STOP);
if ((result != SAA_OK) && (result != SAA_ERR_ALREADY_STOPPED)) {
printk(KERN_ERR "%s() run/forced stop transition failed, res = 0x%x\n",
__func__, result);
}
ret = -EIO;
} else
dprintk(DBGLVL_DVB, "%s() Running\n", __func__);
out:
return ret;
}
static int saa7164_dvb_start_feed(struct dvb_demux_feed *feed)
{
struct dvb_demux *demux = feed->demux;
struct saa7164_port *port = demux->priv;
struct saa7164_dvb *dvb = &port->dvb;
struct saa7164_dev *dev = port->dev;
int ret = 0;
dprintk(DBGLVL_DVB, "%s(port=%d)\n", __func__, port->nr);
if (!demux->dmx.frontend)
return -EINVAL;
if (dvb) {
mutex_lock(&dvb->lock);
if (dvb->feeding++ == 0) {
/* Start transport */
ret = saa7164_dvb_start_port(port);
}
mutex_unlock(&dvb->lock);
dprintk(DBGLVL_DVB, "%s(port=%d) now feeding = %d\n",
__func__, port->nr, dvb->feeding);
}
return ret;
}
static int saa7164_dvb_stop_feed(struct dvb_demux_feed *feed)
{
struct dvb_demux *demux = feed->demux;
struct saa7164_port *port = demux->priv;
struct saa7164_dvb *dvb = &port->dvb;
struct saa7164_dev *dev = port->dev;
int ret = 0;
dprintk(DBGLVL_DVB, "%s(port=%d)\n", __func__, port->nr);
if (dvb) {
mutex_lock(&dvb->lock);
if (--dvb->feeding == 0) {
/* Stop transport */
ret = saa7164_dvb_stop_streaming(port);
Annotation
- Immediate include surface: `saa7164.h`, `tda10048.h`, `tda18271.h`, `s5h1411.h`, `si2157.h`, `si2168.h`, `lgdt3306a.h`.
- Detected declarations: `function si2157_attach`, `function saa7164_dvb_stop_port`, `function saa7164_dvb_acquire_port`, `function saa7164_dvb_pause_port`, `function saa7164_dvb_stop_streaming`, `function saa7164_dvb_start_port`, `function saa7164_dvb_start_feed`, `function saa7164_dvb_stop_feed`, `function dvb_register`, `function saa7164_dvb_unregister`.
- 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.