drivers/media/usb/as102/as102_drv.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/as102/as102_drv.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/as102/as102_drv.c- Extension
.c- Size
- 9704 bytes
- Lines
- 394
- 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/errno.hlinux/slab.hlinux/module.hlinux/mm.hlinux/kref.hlinux/uaccess.hlinux/usb.has102_drv.has10x_cmd.has102_fe.has102_fw.hmedia/dvbdev.h
Detected Declarations
function as102_stop_streamfunction as102_start_streamfunction as10x_pid_filterfunction as102_dvb_dmx_start_feedfunction as102_dvb_dmx_stop_feedfunction as102_set_tunefunction as102_get_tpsfunction as102_get_statusfunction as102_get_statsfunction as102_stream_ctrlfunction as102_dvb_registerfunction as102_dvb_unregister
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Abilis Systems Single DVB-T Receiver
* Copyright (C) 2008 Pierrick Hascoet <pierrick.hascoet@abilis.com>
* Copyright (C) 2010 Devin Heitmueller <dheitmueller@kernellabs.com>
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/kref.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
/* header file for usb device driver*/
#include "as102_drv.h"
#include "as10x_cmd.h"
#include "as102_fe.h"
#include "as102_fw.h"
#include <media/dvbdev.h>
int dual_tuner;
module_param_named(dual_tuner, dual_tuner, int, 0644);
MODULE_PARM_DESC(dual_tuner, "Activate Dual-Tuner config (default: off)");
static int fw_upload = 1;
module_param_named(fw_upload, fw_upload, int, 0644);
MODULE_PARM_DESC(fw_upload, "Turn on/off default FW upload (default: on)");
static int pid_filtering;
module_param_named(pid_filtering, pid_filtering, int, 0644);
MODULE_PARM_DESC(pid_filtering, "Activate HW PID filtering (default: off)");
static int ts_auto_disable;
module_param_named(ts_auto_disable, ts_auto_disable, int, 0644);
MODULE_PARM_DESC(ts_auto_disable, "Stream Auto Enable on FW (default: off)");
int elna_enable = 1;
module_param_named(elna_enable, elna_enable, int, 0644);
MODULE_PARM_DESC(elna_enable, "Activate eLNA (default: on)");
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static void as102_stop_stream(struct as102_dev_t *dev)
{
struct as10x_bus_adapter_t *bus_adap;
if (dev != NULL)
bus_adap = &dev->bus_adap;
else
return;
if (bus_adap->ops->stop_stream != NULL)
bus_adap->ops->stop_stream(dev);
if (ts_auto_disable) {
if (mutex_lock_interruptible(&dev->bus_adap.lock))
return;
if (as10x_cmd_stop_streaming(bus_adap) < 0)
dev_dbg(&dev->bus_adap.usb_dev->dev,
"as10x_cmd_stop_streaming failed\n");
mutex_unlock(&dev->bus_adap.lock);
}
}
static int as102_start_stream(struct as102_dev_t *dev)
{
struct as10x_bus_adapter_t *bus_adap;
int ret = -EFAULT;
if (dev != NULL)
bus_adap = &dev->bus_adap;
else
return ret;
if (bus_adap->ops->start_stream != NULL)
ret = bus_adap->ops->start_stream(dev);
if (ts_auto_disable) {
if (mutex_lock_interruptible(&dev->bus_adap.lock))
return -EFAULT;
ret = as10x_cmd_start_streaming(bus_adap);
mutex_unlock(&dev->bus_adap.lock);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/slab.h`, `linux/module.h`, `linux/mm.h`, `linux/kref.h`, `linux/uaccess.h`, `linux/usb.h`.
- Detected declarations: `function as102_stop_stream`, `function as102_start_stream`, `function as10x_pid_filter`, `function as102_dvb_dmx_start_feed`, `function as102_dvb_dmx_stop_feed`, `function as102_set_tune`, `function as102_get_tps`, `function as102_get_status`, `function as102_get_stats`, `function as102_stream_ctrl`.
- 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.