drivers/media/dvb-frontends/dib3000mb.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/dib3000mb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/dib3000mb.c- Extension
.c- Size
- 23277 bytes
- Lines
- 819
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/kernel.hlinux/module.hlinux/init.hlinux/delay.hlinux/string.hlinux/slab.hmedia/dvb_frontend.hdib3000.hdib3000mb_priv.h
Detected Declarations
function dib3000_read_regfunction dib3000_write_regfunction dib3000_search_statusfunction dib3000mb_set_frontendfunction dib3000mb_fe_initfunction dib3000mb_get_frontendfunction dib3000mb_read_statusfunction dib3000mb_read_berfunction dib3000mb_read_signal_strengthfunction dib3000mb_read_snrfunction dib3000mb_read_unc_blocksfunction dib3000mb_sleepfunction dib3000mb_fe_get_tune_settingsfunction dib3000mb_fe_init_nonmobilefunction dib3000mb_set_frontend_and_tunerfunction dib3000mb_releasefunction dib3000mb_pid_controlfunction dib3000mb_fifo_controlfunction dib3000mb_pid_parsefunction dib3000mb_tuner_pass_ctrlfunction dib3000mb_attachexport dib3000mb_attach
Annotated Snippet
if (lock & 0x01) {
deb_srch("auto search succeeded\n");
return 1; // auto search succeeded
} else {
deb_srch("auto search not successful\n");
return 0; // auto search failed
}
} else if (irq & 0x01) {
deb_srch("auto search failed\n");
return 0; // auto search failed
}
return -1; // try again
}
/* for auto search */
static u16 dib3000_seq[2][2][2] = /* fft,gua, inv */
{ /* fft */
{ /* gua */
{ 0, 1 }, /* 0 0 { 0,1 } */
{ 3, 9 }, /* 0 1 { 0,1 } */
},
{
{ 2, 5 }, /* 1 0 { 0,1 } */
{ 6, 11 }, /* 1 1 { 0,1 } */
}
};
static int dib3000mb_get_frontend(struct dvb_frontend* fe,
struct dtv_frontend_properties *c);
static int dib3000mb_set_frontend(struct dvb_frontend *fe, int tuner)
{
struct dib3000_state* state = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
enum fe_code_rate fe_cr = FEC_NONE;
int search_state, seq;
if (tuner && fe->ops.tuner_ops.set_params) {
fe->ops.tuner_ops.set_params(fe);
if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
switch (c->bandwidth_hz) {
case 8000000:
wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[2]);
wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_8mhz);
break;
case 7000000:
wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[1]);
wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_7mhz);
break;
case 6000000:
wr_foreach(dib3000mb_reg_timing_freq, dib3000mb_timing_freq[0]);
wr_foreach(dib3000mb_reg_bandwidth, dib3000mb_bandwidth_6mhz);
break;
case 0:
return -EOPNOTSUPP;
default:
pr_err("unknown bandwidth value.\n");
return -EINVAL;
}
deb_setf("bandwidth: %d MHZ\n", c->bandwidth_hz / 1000000);
}
wr(DIB3000MB_REG_LOCK1_MASK, DIB3000MB_LOCK1_SEARCH_4);
switch (c->transmission_mode) {
case TRANSMISSION_MODE_2K:
deb_setf("transmission mode: 2k\n");
wr(DIB3000MB_REG_FFT, DIB3000_TRANSMISSION_MODE_2K);
break;
case TRANSMISSION_MODE_8K:
deb_setf("transmission mode: 8k\n");
wr(DIB3000MB_REG_FFT, DIB3000_TRANSMISSION_MODE_8K);
break;
case TRANSMISSION_MODE_AUTO:
deb_setf("transmission mode: auto\n");
break;
default:
return -EINVAL;
}
switch (c->guard_interval) {
case GUARD_INTERVAL_1_32:
deb_setf("guard 1_32\n");
wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_32);
break;
case GUARD_INTERVAL_1_16:
deb_setf("guard 1_16\n");
wr(DIB3000MB_REG_GUARD_TIME, DIB3000_GUARD_TIME_1_16);
break;
case GUARD_INTERVAL_1_8:
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/delay.h`, `linux/string.h`, `linux/slab.h`, `media/dvb_frontend.h`, `dib3000.h`.
- Detected declarations: `function dib3000_read_reg`, `function dib3000_write_reg`, `function dib3000_search_status`, `function dib3000mb_set_frontend`, `function dib3000mb_fe_init`, `function dib3000mb_get_frontend`, `function dib3000mb_read_status`, `function dib3000mb_read_ber`, `function dib3000mb_read_signal_strength`, `function dib3000mb_read_snr`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration 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.