drivers/media/usb/au0828/au0828-dvb.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/au0828/au0828-dvb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/au0828/au0828-dvb.c- Extension
.c- Size
- 16554 bytes
- Lines
- 686
- 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.
- 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
au0828.hlinux/module.hlinux/slab.hlinux/init.hlinux/device.hmedia/v4l2-common.hmedia/tuner.hau8522.hxc5000.hmxl5007t.htda18271.h
Detected Declarations
function au0828_bulk_timeoutfunction urb_completionfunction stop_urb_transferfunction start_urb_transferfunction au0828_start_transportfunction au0828_stop_transportfunction au0828_dvb_start_feedfunction au0828_dvb_stop_feedfunction au0828_restart_dvb_streamingfunction au0828_set_frontendfunction dvb_registerfunction au0828_dvb_unregisterfunction au0828_dvb_registerfunction au0828_dvb_suspendfunction au0828_dvb_resume
Annotated Snippet
if (dev->urbs[i]) {
usb_kill_urb(dev->urbs[i]);
if (!preallocate_big_buffers)
kfree(dev->urbs[i]->transfer_buffer);
usb_free_urb(dev->urbs[i]);
}
}
return 0;
}
static int start_urb_transfer(struct au0828_dev *dev)
{
struct urb *purb;
int i, ret;
dprintk(2, "%s()\n", __func__);
if (dev->urb_streaming) {
dprintk(2, "%s: bulk xfer already running!\n", __func__);
return 0;
}
for (i = 0; i < URB_COUNT; i++) {
dev->urbs[i] = usb_alloc_urb(0, GFP_KERNEL);
if (!dev->urbs[i])
return -ENOMEM;
purb = dev->urbs[i];
if (preallocate_big_buffers)
purb->transfer_buffer = dev->dig_transfer_buffer[i];
else
purb->transfer_buffer = kzalloc(URB_BUFSIZE,
GFP_KERNEL);
if (!purb->transfer_buffer) {
usb_free_urb(purb);
dev->urbs[i] = NULL;
ret = -ENOMEM;
pr_err("%s: failed big buffer allocation, err = %d\n",
__func__, ret);
return ret;
}
purb->status = -EINPROGRESS;
usb_fill_bulk_urb(purb,
dev->usbdev,
usb_rcvbulkpipe(dev->usbdev,
_AU0828_BULKPIPE),
purb->transfer_buffer,
URB_BUFSIZE,
urb_completion,
dev);
}
for (i = 0; i < URB_COUNT; i++) {
ret = usb_submit_urb(dev->urbs[i], GFP_ATOMIC);
if (ret != 0) {
stop_urb_transfer(dev);
pr_err("%s: failed urb submission, err = %d\n",
__func__, ret);
return ret;
}
}
dev->urb_streaming = true;
/* If we don't valid data within 1 second, restart stream */
mod_timer(&dev->bulk_timeout, jiffies + (HZ));
dev->bulk_timeout_running = 1;
return 0;
}
static void au0828_start_transport(struct au0828_dev *dev)
{
au0828_write(dev, 0x608, 0x90);
au0828_write(dev, 0x609, 0x72);
au0828_write(dev, 0x60a, 0x71);
au0828_write(dev, 0x60b, 0x01);
}
static void au0828_stop_transport(struct au0828_dev *dev, int full_stop)
{
if (full_stop) {
Annotation
- Immediate include surface: `au0828.h`, `linux/module.h`, `linux/slab.h`, `linux/init.h`, `linux/device.h`, `media/v4l2-common.h`, `media/tuner.h`, `au8522.h`.
- Detected declarations: `function au0828_bulk_timeout`, `function urb_completion`, `function stop_urb_transfer`, `function start_urb_transfer`, `function au0828_start_transport`, `function au0828_stop_transport`, `function au0828_dvb_start_feed`, `function au0828_dvb_stop_feed`, `function au0828_restart_dvb_streaming`, `function au0828_set_frontend`.
- 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.