drivers/media/dvb-frontends/tda10048.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/tda10048.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/tda10048.c- Extension
.c- Size
- 29096 bytes
- Lines
- 1185
- 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/init.hlinux/module.hlinux/string.hlinux/slab.hlinux/delay.hlinux/math64.hasm/div64.hmedia/dvb_frontend.hlinux/int_log.htda10048.h
Detected Declarations
struct tda10048_statefunction tda10048_writeregfunction tda10048_readregfunction tda10048_writeregbulkfunction tda10048_set_phy2function tda10048_set_wreffunction tda10048_set_invwreffunction tda10048_set_bandwidthfunction tda10048_set_iffunction tda10048_firmware_uploadfunction tda10048_set_inversionfunction tda10048_get_tpsfunction tda10048_i2c_gate_ctrlfunction tda10048_output_modefunction tda10048_set_frontendfunction tda10048_initfunction tda10048_read_statusfunction tda10048_read_berfunction tda10048_read_signal_strengthfunction tda10048_read_snrfunction tda10048_read_ucblocksfunction tda10048_get_frontendfunction tda10048_get_tune_settingsfunction tda10048_releasefunction tda10048_establish_defaultsexport tda10048_attach
Annotated Snippet
struct tda10048_state {
struct i2c_adapter *i2c;
/* We'll cache and update the attach config settings */
struct tda10048_config config;
struct dvb_frontend frontend;
int fwloaded;
u32 freq_if_hz;
u32 xtal_hz;
u32 pll_mfactor;
u32 pll_nfactor;
u32 pll_pfactor;
u32 sample_freq;
u32 bandwidth;
};
static struct init_tab {
u8 reg;
u16 data;
} init_tab[] = {
{ TDA10048_CONF_PLL1, 0x08 },
{ TDA10048_CONF_ADC_2, 0x00 },
{ TDA10048_CONF_C4_1, 0x00 },
{ TDA10048_CONF_PLL1, 0x0f },
{ TDA10048_CONF_PLL2, 0x0a },
{ TDA10048_CONF_PLL3, 0x43 },
{ TDA10048_FREQ_PHY2_LSB, 0x02 },
{ TDA10048_FREQ_PHY2_MSB, 0x0a },
{ TDA10048_TIME_WREF_LSB, 0xbd },
{ TDA10048_TIME_WREF_MID1, 0xe4 },
{ TDA10048_TIME_WREF_MID2, 0xa8 },
{ TDA10048_TIME_WREF_MSB, 0x02 },
{ TDA10048_TIME_INVWREF_LSB, 0x04 },
{ TDA10048_TIME_INVWREF_MSB, 0x06 },
{ TDA10048_CONF_C4_1, 0x00 },
{ TDA10048_CONF_C1_1, 0xa8 },
{ TDA10048_AGC_CONF, 0x16 },
{ TDA10048_CONF_C1_3, 0x0b },
{ TDA10048_AGC_TUN_MIN, 0x00 },
{ TDA10048_AGC_TUN_MAX, 0xff },
{ TDA10048_AGC_IF_MIN, 0x00 },
{ TDA10048_AGC_IF_MAX, 0xff },
{ TDA10048_AGC_THRESHOLD_MSB, 0x00 },
{ TDA10048_AGC_THRESHOLD_LSB, 0x70 },
{ TDA10048_CVBER_CTRL, 0x38 },
{ TDA10048_AGC_GAINS, 0x12 },
{ TDA10048_CONF_XO, 0x00 },
{ TDA10048_CONF_TS1, 0x07 },
{ TDA10048_IC_MODE, 0x00 },
{ TDA10048_CONF_TS2, 0xc0 },
{ TDA10048_CONF_TRISTATE1, 0x21 },
{ TDA10048_CONF_TRISTATE2, 0x00 },
{ TDA10048_CONF_POLARITY, 0x00 },
{ TDA10048_CONF_C4_2, 0x04 },
{ TDA10048_CONF_ADC, 0x60 },
{ TDA10048_CONF_ADC_2, 0x10 },
{ TDA10048_CONF_ADC, 0x60 },
{ TDA10048_CONF_ADC_2, 0x00 },
{ TDA10048_CONF_C1_1, 0xa8 },
{ TDA10048_UNCOR_CTRL, 0x00 },
{ TDA10048_CONF_C4_2, 0x04 },
};
static struct pll_tab {
u32 clk_freq_khz;
u32 if_freq_khz;
} pll_tab[] = {
{ TDA10048_CLK_4000, TDA10048_IF_36130 },
{ TDA10048_CLK_16000, TDA10048_IF_3300 },
{ TDA10048_CLK_16000, TDA10048_IF_3500 },
{ TDA10048_CLK_16000, TDA10048_IF_3800 },
{ TDA10048_CLK_16000, TDA10048_IF_4000 },
{ TDA10048_CLK_16000, TDA10048_IF_4300 },
{ TDA10048_CLK_16000, TDA10048_IF_4500 },
{ TDA10048_CLK_16000, TDA10048_IF_5000 },
{ TDA10048_CLK_16000, TDA10048_IF_36130 },
};
static int tda10048_writereg(struct tda10048_state *state, u8 reg, u8 data)
{
struct tda10048_config *config = &state->config;
int ret;
u8 buf[] = { reg, data };
struct i2c_msg msg = {
.addr = config->demod_address,
.flags = 0, .buf = buf, .len = 2 };
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/module.h`, `linux/string.h`, `linux/slab.h`, `linux/delay.h`, `linux/math64.h`, `asm/div64.h`.
- Detected declarations: `struct tda10048_state`, `function tda10048_writereg`, `function tda10048_readreg`, `function tda10048_writeregbulk`, `function tda10048_set_phy2`, `function tda10048_set_wref`, `function tda10048_set_invwref`, `function tda10048_set_bandwidth`, `function tda10048_set_if`, `function tda10048_firmware_upload`.
- 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.