drivers/media/usb/dvb-usb/dib0700_devices.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/dvb-usb/dib0700_devices.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/dvb-usb/dib0700_devices.c- Extension
.c- Size
- 146057 bytes
- Lines
- 5249
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dib0700.hdib3000mc.hdib7000m.hdib7000p.hdib8000.hdib9000.hmt2060.hmt2266.hxc2028.hxc5000.hxc4000.hs5h1411.hdib0070.hdib0090.hlgdt3305.hmxl5007t.hmn88472.htda18250.h
Detected Declarations
struct dib0700_adapter_statestruct dibx090p_best_adcfunction bristol_frontend_attachfunction eeprom_readfunction bristol_tuner_attachfunction stk7700P2_frontend_attachfunction stk7700d_frontend_attachfunction stk7700d_tuner_attachfunction stk7700ph_xc3028_callbackfunction stk7700ph_frontend_attachfunction stk7700ph_tuner_attachfunction dib0700_rc_urb_completionfunction stk7700p_frontend_attachfunction stk7700p_tuner_attachfunction dib7070_tuner_resetfunction dib7070_tuner_sleepfunction dib7070_set_param_overridefunction dib7770_set_param_overridefunction dib7770p_tuner_attachfunction dib7070p_tuner_attachfunction stk7700p_pid_filterfunction stk7700p_pid_filter_ctrlfunction stk70x0p_pid_filterfunction stk70x0p_pid_filter_ctrlfunction stk7070p_frontend_attachfunction stk7770p_frontend_attachfunction dib80xx_tuner_resetfunction dib80xx_tuner_sleepfunction dib807x_set_param_overridefunction dib807x_tuner_attachfunction stk80xx_pid_filterfunction stk80xx_pid_filter_ctrlfunction stk807x_frontend_attachfunction stk807xpvr_frontend_attach0function stk807xpvr_frontend_attach1function dib8090_get_adc_powerfunction dib8090_agc_controlfunction dib8090_compute_pll_parametersfunction dib8096_set_param_overridefunction dib809x_tuner_attachfunction stk809x_frontend_attachfunction stk809x_frontend1_attachfunction nim8096md_tuner_attachfunction nim8096md_frontend_attachfunction dib8096p_get_best_samplingfunction dib8096p_agc_startupfunction tfe8096p_frontend_attachfunction tfe8096p_tuner_attach
Annotated Snippet
struct dib0700_adapter_state {
int (*set_param_save) (struct dvb_frontend *);
const struct firmware *frontend_firmware;
struct dib7000p_ops dib7000p_ops;
struct dib8000_ops dib8000_ops;
};
/* Hauppauge Nova-T 500 (aka Bristol)
* has a LNA on GPIO0 which is enabled by setting 1 */
static struct mt2060_config bristol_mt2060_config[2] = {
{
.i2c_address = 0x60,
.clock_out = 3,
}, {
.i2c_address = 0x61,
}
};
static struct dibx000_agc_config bristol_dib3000p_mt2060_agc_config = {
.band_caps = BAND_VHF | BAND_UHF,
.setup = (1 << 8) | (5 << 5) | (0 << 4) | (0 << 3) | (0 << 2) | (2 << 0),
.agc1_max = 42598,
.agc1_min = 17694,
.agc2_max = 45875,
.agc2_min = 0,
.agc1_pt1 = 0,
.agc1_pt2 = 59,
.agc1_slope1 = 0,
.agc1_slope2 = 69,
.agc2_pt1 = 0,
.agc2_pt2 = 59,
.agc2_slope1 = 111,
.agc2_slope2 = 28,
};
static struct dib3000mc_config bristol_dib3000mc_config[2] = {
{ .agc = &bristol_dib3000p_mt2060_agc_config,
.max_time = 0x196,
.ln_adc_level = 0x1cc7,
.output_mpeg2_in_188_bytes = 1,
},
{ .agc = &bristol_dib3000p_mt2060_agc_config,
.max_time = 0x196,
.ln_adc_level = 0x1cc7,
.output_mpeg2_in_188_bytes = 1,
}
};
static int bristol_frontend_attach(struct dvb_usb_adapter *adap)
{
struct dib0700_state *st = adap->dev->priv;
if (adap->id == 0) {
dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10);
dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10);
dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10);
if (force_lna_activation)
dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
else
dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0);
if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib3000mc_config) != 0) {
dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10);
return -ENODEV;
}
}
st->mt2060_if1[adap->id] = 1220;
return (adap->fe_adap[0].fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap,
(10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0;
}
static int eeprom_read(struct i2c_adapter *adap,u8 adrs,u8 *pval)
{
struct i2c_msg msg[2] = {
{ .addr = 0x50, .flags = 0, .buf = &adrs, .len = 1 },
{ .addr = 0x50, .flags = I2C_M_RD, .buf = pval, .len = 1 },
};
if (i2c_transfer(adap, msg, 2) != 2) return -EREMOTEIO;
return 0;
}
static int bristol_tuner_attach(struct dvb_usb_adapter *adap)
{
Annotation
- Immediate include surface: `dib0700.h`, `dib3000mc.h`, `dib7000m.h`, `dib7000p.h`, `dib8000.h`, `dib9000.h`, `mt2060.h`, `mt2266.h`.
- Detected declarations: `struct dib0700_adapter_state`, `struct dibx090p_best_adc`, `function bristol_frontend_attach`, `function eeprom_read`, `function bristol_tuner_attach`, `function stk7700P2_frontend_attach`, `function stk7700d_frontend_attach`, `function stk7700d_tuner_attach`, `function stk7700ph_xc3028_callback`, `function stk7700ph_frontend_attach`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.