drivers/media/pci/ddbridge/ddbridge-max.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/ddbridge/ddbridge-max.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/ddbridge/ddbridge-max.c- Extension
.c- Size
- 12391 bytes
- Lines
- 496
- 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
linux/module.hlinux/init.hlinux/interrupt.hlinux/delay.hlinux/slab.hlinux/poll.hlinux/io.hlinux/pci.hlinux/pci_ids.hlinux/timer.hlinux/i2c.hlinux/swab.hlinux/vmalloc.hddbridge.hddbridge-regs.hddbridge-io.hddbridge-mci.hddbridge-max.hmxl5xx.h
Detected Declarations
function lnb_commandfunction max_send_master_cmdfunction lnb_send_diseqcfunction lnb_set_satfunction lnb_set_tonefunction lnb_set_voltagefunction max_set_input_unlockedfunction max_set_tonefunction max_set_voltagefunction max_enable_high_lnb_voltagefunction max_send_burstfunction mxl_fw_readfunction ddb_lnb_init_fmodefunction ddb_fe_attach_mxl5xxfunction ddb_fe_attach_mci
Annotated Snippet
if (old_quattro) {
if (dvb->tone == SEC_TONE_ON)
tuner |= 2;
if (dvb->voltage == SEC_VOLTAGE_18)
tuner |= 1;
} else {
if (dvb->tone == SEC_TONE_ON)
tuner |= 1;
if (dvb->voltage == SEC_VOLTAGE_18)
tuner |= 2;
}
res = max_set_input_unlocked(fe, tuner);
break;
}
mutex_unlock(&dev->link[port->lnr].lnb.lock);
return res;
}
static int max_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage)
{
struct ddb_input *input = fe->sec_priv;
struct ddb_port *port = input->port;
struct ddb *dev = port->dev;
struct ddb_dvb *dvb = &port->dvb[input->nr & 1];
int tuner = 0;
u32 nv, ov = dev->link[port->lnr].lnb.voltages;
int res = 0;
u32 fmode = dev->link[port->lnr].lnb.fmode;
mutex_lock(&dev->link[port->lnr].lnb.lock);
dvb->voltage = voltage;
switch (fmode) {
case 3:
default:
case 0:
if (fmode == 3)
max_set_input_unlocked(fe, 0);
if (voltage == SEC_VOLTAGE_OFF)
dev->link[port->lnr].lnb.voltage[dvb->input] &=
~(1ULL << input->nr);
else
dev->link[port->lnr].lnb.voltage[dvb->input] |=
(1ULL << input->nr);
res = lnb_set_voltage(dev, port->lnr, dvb->input, voltage);
break;
case 1:
case 2:
if (voltage == SEC_VOLTAGE_OFF)
dev->link[port->lnr].lnb.voltages &=
~(1ULL << input->nr);
else
dev->link[port->lnr].lnb.voltages |=
(1ULL << input->nr);
nv = dev->link[port->lnr].lnb.voltages;
if (old_quattro) {
if (dvb->tone == SEC_TONE_ON)
tuner |= 2;
if (dvb->voltage == SEC_VOLTAGE_18)
tuner |= 1;
} else {
if (dvb->tone == SEC_TONE_ON)
tuner |= 1;
if (dvb->voltage == SEC_VOLTAGE_18)
tuner |= 2;
}
res = max_set_input_unlocked(fe, tuner);
if (nv != ov) {
if (nv) {
lnb_set_voltage(
dev, port->lnr,
0, SEC_VOLTAGE_13);
if (fmode == 1) {
lnb_set_voltage(
dev, port->lnr,
0, SEC_VOLTAGE_13);
if (old_quattro) {
lnb_set_voltage(
dev, port->lnr,
1, SEC_VOLTAGE_18);
lnb_set_voltage(
dev, port->lnr,
2, SEC_VOLTAGE_13);
} else {
lnb_set_voltage(
dev, port->lnr,
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/interrupt.h`, `linux/delay.h`, `linux/slab.h`, `linux/poll.h`, `linux/io.h`, `linux/pci.h`.
- Detected declarations: `function lnb_command`, `function max_send_master_cmd`, `function lnb_send_diseqc`, `function lnb_set_sat`, `function lnb_set_tone`, `function lnb_set_voltage`, `function max_set_input_unlocked`, `function max_set_tone`, `function max_set_voltage`, `function max_enable_high_lnb_voltage`.
- 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.