drivers/media/pci/cx23885/cx23885-dvb.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/cx23885/cx23885-dvb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/cx23885/cx23885-dvb.c- Extension
.c- Size
- 78560 bytes
- Lines
- 2742
- 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
cx23885.hlinux/module.hlinux/init.hlinux/device.hlinux/fs.hlinux/kthread.hlinux/file.hlinux/suspend.hmedia/v4l2-common.hmedia/dvb_ca_en50221.hs5h1409.hs5h1411.hmt2131.htda8290.htda18271.hlgdt330x.hxc4000.hxc5000.hmax2165.htda10048.hxc2028.htuner-simple.hdib7000p.hdib0070.hdibx000_common.hzl10353.hstv0900.hstv0900_reg.hstv6110.hlnbh24.hcx24116.hcx24117.h
Detected Declarations
function queue_setupfunction buffer_preparefunction buffer_finishfunction buffer_queuefunction cx23885_dvb_gate_ctrlfunction cx23885_start_streamingfunction cx23885_stop_streamingfunction p8000_set_voltagefunction dvbsky_t9580_set_voltagefunction dvbsky_s952_portc_set_voltagefunction cx23885_sp2_ci_ctrlfunction cx23885_dvb_set_frontendfunction cx23885_set_frontend_hookfunction netup_altera_fpga_rwfunction dib7070_tuner_resetfunction dib7070_tuner_sleepfunction dvb_register_ci_macfunction dvb_registerfunction cx23885_dvb_registerfunction cx23885_dvb_unregister
Annotated Snippet
if (*mem < 0) {
ret = -EREMOTEIO;
goto err;
}
}
return 0;
err:
return ret;
}
static int cx23885_dvb_set_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct cx23885_tsport *port = fe->dvb->priv;
struct cx23885_dev *dev = port->dev;
switch (dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1275:
switch (p->modulation) {
case VSB_8:
cx23885_gpio_clear(dev, GPIO_5);
break;
case QAM_64:
case QAM_256:
default:
cx23885_gpio_set(dev, GPIO_5);
break;
}
break;
case CX23885_BOARD_MYGICA_X8506:
case CX23885_BOARD_MYGICA_X8507:
case CX23885_BOARD_MAGICPRO_PROHDTVE2:
/* Select Digital TV */
cx23885_gpio_set(dev, GPIO_0);
break;
}
/* Call the real set_frontend */
if (port->set_frontend)
return port->set_frontend(fe);
return 0;
}
static void cx23885_set_frontend_hook(struct cx23885_tsport *port,
struct dvb_frontend *fe)
{
port->set_frontend = fe->ops.set_frontend;
fe->ops.set_frontend = cx23885_dvb_set_frontend;
}
static struct lgs8gxx_config magicpro_prohdtve2_lgs8g75_config = {
.prod = LGS8GXX_PROD_LGS8G75,
.demod_address = 0x19,
.serial_ts = 0,
.ts_clk_pol = 1,
.ts_clk_gated = 1,
.if_clk_freq = 30400, /* 30.4 MHz */
.if_freq = 6500, /* 6.50 MHz */
.if_neg_center = 1,
.ext_adc = 0,
.adc_signed = 1,
.adc_vpp = 2, /* 1.6 Vpp */
.if_neg_edge = 1,
};
static struct xc5000_config magicpro_prohdtve2_xc5000_config = {
.i2c_address = 0x61,
.if_khz = 6500,
};
static struct atbm8830_config mygica_x8558pro_atbm8830_cfg1 = {
.prod = ATBM8830_PROD_8830,
.demod_address = 0x44,
.serial_ts = 0,
.ts_sampling_edge = 1,
.ts_clk_gated = 0,
.osc_clk_freq = 30400, /* in kHz */
.if_freq = 0, /* zero IF */
.zif_swap_iq = 1,
.agc_min = 0x2E,
.agc_max = 0xFF,
.agc_hold_loop = 0,
};
static struct max2165_config mygic_x8558pro_max2165_cfg1 = {
.i2c_address = 0x60,
.osc_clk = 20
};
Annotation
- Immediate include surface: `cx23885.h`, `linux/module.h`, `linux/init.h`, `linux/device.h`, `linux/fs.h`, `linux/kthread.h`, `linux/file.h`, `linux/suspend.h`.
- Detected declarations: `function queue_setup`, `function buffer_prepare`, `function buffer_finish`, `function buffer_queue`, `function cx23885_dvb_gate_ctrl`, `function cx23885_start_streaming`, `function cx23885_stop_streaming`, `function p8000_set_voltage`, `function dvbsky_t9580_set_voltage`, `function dvbsky_s952_portc_set_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.