drivers/media/dvb-frontends/mb86a20s.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/mb86a20s.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/mb86a20s.c- Extension
.c- Size
- 53389 bytes
- Lines
- 2113
- 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.hasm/div64.hmedia/dvb_frontend.hmb86a20s.h
Detected Declarations
struct mb86a20s_statestruct regdatastruct linear_segmentsenum mb86a20s_bandwidthfunction mb86a20s_i2c_writeregfunction mb86a20s_i2c_writeregdatafunction mb86a20s_i2c_readregfunction routinesfunction mb86a20s_read_signal_strengthfunction mb86a20s_get_modulationfunction mb86a20s_get_fecfunction mb86a20s_get_interleavingfunction mb86a20s_get_segment_countfunction mb86a20s_reset_frontend_cachefunction isdbt_layer_min_bitratefunction mb86a20s_get_frontendfunction mb86a20s_reset_countersfunction mb86a20s_get_pre_berfunction mb86a20s_get_post_berfunction mb86a20s_get_blk_errorfunction interpolate_valuefunction mb86a20s_get_main_CNRfunction mb86a20s_get_blk_error_layer_CNRfunction mb86a20s_stats_not_readyfunction mb86a20s_get_statsfunction mb86a20s_initfefunction mb86a20s_set_frontendfunction mb86a20s_read_status_and_statsfunction mb86a20s_read_signal_strength_from_cachefunction mb86a20s_tunefunction mb86a20s_releasefunction mb86a20s_get_frontend_algoexport mb86a20s_attach
Annotated Snippet
struct mb86a20s_state {
struct i2c_adapter *i2c;
const struct mb86a20s_config *config;
u32 last_frequency;
struct dvb_frontend frontend;
u32 if_freq;
enum mb86a20s_bandwidth bw;
bool inversion;
u32 subchannel;
u32 estimated_rate[NUM_LAYERS];
unsigned long get_strength_time;
bool need_init;
};
struct regdata {
u8 reg;
u8 data;
};
#define BER_SAMPLING_RATE 1 /* Seconds */
/*
* Initialization sequence: Use whatevere default values that PV SBTVD
* does on its initialisation, obtained via USB snoop
*/
static struct regdata mb86a20s_init1[] = {
{ 0x70, 0x0f },
{ 0x70, 0xff },
{ 0x08, 0x01 },
{ 0x50, 0xd1 }, { 0x51, 0x20 },
};
static struct regdata mb86a20s_init2[] = {
{ 0x50, 0xd1 }, { 0x51, 0x22 },
{ 0x39, 0x01 },
{ 0x71, 0x00 },
{ 0x3b, 0x21 },
{ 0x3c, 0x3a },
{ 0x01, 0x0d },
{ 0x04, 0x08 }, { 0x05, 0x05 },
{ 0x04, 0x0e }, { 0x05, 0x00 },
{ 0x04, 0x0f }, { 0x05, 0x14 },
{ 0x04, 0x0b }, { 0x05, 0x8c },
{ 0x04, 0x00 }, { 0x05, 0x00 },
{ 0x04, 0x01 }, { 0x05, 0x07 },
{ 0x04, 0x02 }, { 0x05, 0x0f },
{ 0x04, 0x03 }, { 0x05, 0xa0 },
{ 0x04, 0x09 }, { 0x05, 0x00 },
{ 0x04, 0x0a }, { 0x05, 0xff },
{ 0x04, 0x27 }, { 0x05, 0x64 },
{ 0x04, 0x28 }, { 0x05, 0x00 },
{ 0x04, 0x1e }, { 0x05, 0xff },
{ 0x04, 0x29 }, { 0x05, 0x0a },
{ 0x04, 0x32 }, { 0x05, 0x0a },
{ 0x04, 0x14 }, { 0x05, 0x02 },
{ 0x04, 0x04 }, { 0x05, 0x00 },
{ 0x04, 0x05 }, { 0x05, 0x22 },
{ 0x04, 0x06 }, { 0x05, 0x0e },
{ 0x04, 0x07 }, { 0x05, 0xd8 },
{ 0x04, 0x12 }, { 0x05, 0x00 },
{ 0x04, 0x13 }, { 0x05, 0xff },
/*
* On this demod, when the bit count reaches the count below,
* it collects the bit error count. The bit counters are initialized
* to 65535 here. This warrants that all of them will be quickly
* calculated when device gets locked. As TMCC is parsed, the values
* will be adjusted later in the driver's code.
*/
{ 0x52, 0x01 }, /* Turn on BER before Viterbi */
{ 0x50, 0xa7 }, { 0x51, 0x00 },
{ 0x50, 0xa8 }, { 0x51, 0xff },
{ 0x50, 0xa9 }, { 0x51, 0xff },
{ 0x50, 0xaa }, { 0x51, 0x00 },
{ 0x50, 0xab }, { 0x51, 0xff },
{ 0x50, 0xac }, { 0x51, 0xff },
{ 0x50, 0xad }, { 0x51, 0x00 },
{ 0x50, 0xae }, { 0x51, 0xff },
{ 0x50, 0xaf }, { 0x51, 0xff },
/*
* On this demod, post BER counts blocks. When the count reaches the
* value below, it collects the block error count. The block counters
* are initialized to 127 here. This warrants that all of them will be
* quickly calculated when device gets locked. As TMCC is parsed, the
* values will be adjusted later in the driver's code.
Annotation
- Immediate include surface: `linux/kernel.h`, `asm/div64.h`, `media/dvb_frontend.h`, `mb86a20s.h`.
- Detected declarations: `struct mb86a20s_state`, `struct regdata`, `struct linear_segments`, `enum mb86a20s_bandwidth`, `function mb86a20s_i2c_writereg`, `function mb86a20s_i2c_writeregdata`, `function mb86a20s_i2c_readreg`, `function routines`, `function mb86a20s_read_signal_strength`, `function mb86a20s_get_modulation`.
- 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.