drivers/media/usb/dvb-usb-v2/az6007.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/dvb-usb-v2/az6007.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/dvb-usb-v2/az6007.c- Extension
.c- Size
- 22582 bytes
- Lines
- 993
- 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
drxk.hmt2063.hmedia/dvb_ca_en50221.hdvb_usb.hcypress_firmware.h
Detected Declarations
struct az6007_device_statefunction drxk_gate_ctrlfunction __az6007_readfunction az6007_readfunction __az6007_writefunction az6007_writefunction az6007_streaming_ctrlfunction az6007_rc_queryfunction az6007_get_rc_configfunction az6007_ci_read_attribute_memfunction az6007_ci_write_attribute_memfunction az6007_ci_read_cam_controlfunction az6007_ci_write_cam_controlfunction CI_CamReadyfunction az6007_ci_slot_resetfunction az6007_ci_slot_shutdownfunction az6007_ci_slot_ts_enablefunction az6007_ci_poll_slot_statusfunction az6007_ci_uninitfunction az6007_ci_initfunction az6007_read_mac_addrfunction az6007_frontend_attachfunction az6007_cablestar_hdci_frontend_attachfunction az6007_tuner_attachfunction az6007_power_ctrlfunction az6007_i2c_xferfunction az6007_i2c_funcfunction az6007_identify_statefunction az6007_usb_disconnectfunction az6007_download_firmwarefunction az6007_suspendfunction az6007_resume
Annotated Snippet
struct az6007_device_state {
struct mutex mutex;
struct mutex ca_mutex;
struct dvb_ca_en50221 ca;
unsigned warm:1;
int (*gate_ctrl) (struct dvb_frontend *, int);
unsigned char data[4096];
};
static struct drxk_config terratec_h7_drxk = {
.adr = 0x29,
.parallel_ts = true,
.dynamic_clk = true,
.single_master = true,
.enable_merr_cfg = true,
.no_i2c_bridge = false,
.chunk_size = 64,
.mpeg_out_clk_strength = 0x02,
.qam_demod_parameter_count = 2,
.microcode_name = "dvb-usb-terratec-h7-drxk.fw",
};
static struct drxk_config cablestar_hdci_drxk = {
.adr = 0x29,
.parallel_ts = true,
.dynamic_clk = true,
.single_master = true,
.enable_merr_cfg = true,
.no_i2c_bridge = false,
.chunk_size = 64,
.mpeg_out_clk_strength = 0x02,
.qam_demod_parameter_count = 2,
.microcode_name = "dvb-usb-technisat-cablestar-hdci-drxk.fw",
};
static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable)
{
struct az6007_device_state *st = fe_to_priv(fe);
struct dvb_usb_adapter *adap = fe->sec_priv;
int status = 0;
pr_debug("%s: %s\n", __func__, enable ? "enable" : "disable");
if (!adap || !st)
return -EINVAL;
if (enable)
status = st->gate_ctrl(fe, 1);
else
status = st->gate_ctrl(fe, 0);
return status;
}
static struct mt2063_config az6007_mt2063_config = {
.tuner_address = 0x60,
.refclock = 36125000,
};
static int __az6007_read(struct usb_device *udev, u8 req, u16 value,
u16 index, u8 *b, int blen)
{
int ret;
ret = usb_control_msg(udev,
usb_rcvctrlpipe(udev, 0),
req,
USB_TYPE_VENDOR | USB_DIR_IN,
value, index, b, blen, 5000);
if (ret < 0) {
pr_warn("usb read operation failed. (%d)\n", ret);
return -EIO;
}
if (az6007_xfer_debug) {
printk(KERN_DEBUG "az6007: IN req: %02x, value: %04x, index: %04x\n",
req, value, index);
print_hex_dump_bytes("az6007: payload: ",
DUMP_PREFIX_NONE, b, blen);
}
return ret;
}
static int az6007_read(struct dvb_usb_device *d, u8 req, u16 value,
u16 index, u8 *b, int blen)
{
struct az6007_device_state *st = d->priv;
int ret;
Annotation
- Immediate include surface: `drxk.h`, `mt2063.h`, `media/dvb_ca_en50221.h`, `dvb_usb.h`, `cypress_firmware.h`.
- Detected declarations: `struct az6007_device_state`, `function drxk_gate_ctrl`, `function __az6007_read`, `function az6007_read`, `function __az6007_write`, `function az6007_write`, `function az6007_streaming_ctrl`, `function az6007_rc_query`, `function az6007_get_rc_config`, `function az6007_ci_read_attribute_mem`.
- 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.