drivers/media/dvb-frontends/dib8000.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/dib8000.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/dib8000.c- Extension
.c- Size
- 136491 bytes
- Lines
- 4539
- 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.
- 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/kernel.hlinux/slab.hlinux/i2c.hlinux/mutex.hasm/div64.hlinux/int_log.hmedia/dvb_frontend.hdib8000.h
Detected Declarations
struct i2c_devicestruct dib8000_statestruct per_layer_regsstruct linear_segmentsenum param_loop_stepenum dib8000_autosearch_stepenum timeout_modeenum dib8000_power_modefunction dib8000_i2c_read16function __dib8000_read_wordfunction dib8000_read_wordfunction dib8000_read32function dib8000_i2c_write16function dib8000_write_wordfunction fft_to_modefunction dib8000_set_acquisition_modefunction dib8000_set_output_modefunction dib8000_set_diversity_infunction dib8000_set_power_modefunction dib8000_set_adc_statefunction dib8000_set_bandwidthfunction dib8000_sad_calibfunction dib8000_set_wbd_reffunction dib8000_reset_pll_commonfunction dib8000_reset_pllfunction dib8000_update_pllfunction dib8000_reset_gpiofunction dib8000_cfg_gpiofunction dib8000_set_gpiofunction dib8000_identifyfunction dib8000_reset_statsfunction dib8000_resetfunction dib8000_restart_agcfunction dib8000_update_lnafunction dib8000_set_agc_configfunction dib8000_pwm_agc_resetfunction dib8000_agc_soft_splitfunction dib8000_agc_startupfunction dib8096p_host_bus_drivefunction dib8096p_calcSyncFreqfunction dib8096p_cfg_DibTxfunction dib8096p_cfg_DibRxfunction dib8096p_enMpegMuxfunction dib8096p_configMpegMuxfunction dib8096p_setDibTxMuxfunction dib8096p_setHostBusMuxfunction dib8096p_set_diversity_infunction dib8096p_set_output_mode
Annotated Snippet
struct i2c_device {
struct i2c_adapter *adap;
u8 addr;
u8 *i2c_write_buffer;
u8 *i2c_read_buffer;
struct mutex *i2c_buffer_lock;
};
enum param_loop_step {
LOOP_TUNE_1,
LOOP_TUNE_2
};
enum dib8000_autosearch_step {
AS_START = 0,
AS_SEARCHING_FFT,
AS_SEARCHING_GUARD,
AS_DONE = 100,
};
enum timeout_mode {
SYMBOL_DEPENDENT_OFF = 0,
SYMBOL_DEPENDENT_ON,
};
struct dib8000_state {
struct dib8000_config cfg;
struct i2c_device i2c;
struct dibx000_i2c_master i2c_master;
u16 wbd_ref;
u8 current_band;
u32 current_bandwidth;
struct dibx000_agc_config *current_agc;
u32 timf;
u32 timf_default;
u8 div_force_off:1;
u8 div_state:1;
u16 div_sync_wait;
u8 agc_state;
u8 differential_constellation;
u8 diversity_onoff;
s16 ber_monitored_layer;
u16 gpio_dir;
u16 gpio_val;
u16 revision;
u8 isdbt_cfg_loaded;
enum frontend_tune_state tune_state;
s32 status;
struct dvb_frontend *fe[MAX_NUMBER_OF_FRONTENDS];
/* for the I2C transfer */
struct i2c_msg msg[2];
u8 i2c_write_buffer[4];
u8 i2c_read_buffer[2];
struct mutex i2c_buffer_lock;
u8 input_mode_mpeg;
u16 tuner_enable;
struct i2c_adapter dib8096p_tuner_adap;
u16 current_demod_bw;
u16 seg_mask;
u16 seg_diff_mask;
u16 mode;
u8 layer_b_nb_seg;
u8 layer_c_nb_seg;
u8 channel_parameters_set;
u16 autosearch_state;
u16 found_nfft;
u16 found_guard;
u8 subchannel;
u8 symbol_duration;
unsigned long timeout;
u8 longest_intlv_layer;
u16 output_mode;
/* for DVBv5 stats */
s64 init_ucb;
unsigned long per_jiffies_stats;
unsigned long ber_jiffies_stats;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/slab.h`, `linux/i2c.h`, `linux/mutex.h`, `asm/div64.h`, `linux/int_log.h`, `media/dvb_frontend.h`, `dib8000.h`.
- Detected declarations: `struct i2c_device`, `struct dib8000_state`, `struct per_layer_regs`, `struct linear_segments`, `enum param_loop_step`, `enum dib8000_autosearch_step`, `enum timeout_mode`, `enum dib8000_power_mode`, `function dib8000_i2c_read16`, `function __dib8000_read_word`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration 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.