drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c- Extension
.c- Size
- 77015 bytes
- Lines
- 3520
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
media/dvb_frontend.hcxd2880_common.hcxd2880_tnrdmd.hcxd2880_tnrdmd_mon.hcxd2880_tnrdmd_dvbt.hcxd2880_tnrdmd_dvbt2.h
Detected Declarations
struct cxd2880_tnrdmd_ts_clk_cfgfunction p_init1function p_init2function p_init3function rf_init1function rf_init2function x_tune1function x_tune2function x_tune3function x_tune4function x_sleep1function x_sleep2function x_sleep3function x_sleep4function spll_resetfunction t_power_xfunction set_ts_clk_mode_and_freqfunction pid_ftr_settingfunction load_cfg_memfunction set_cfg_memfunction cxd2880_tnrdmd_createfunction cxd2880_tnrdmd_diver_createfunction cxd2880_tnrdmd_init1function cxd2880_tnrdmd_init2function cxd2880_tnrdmd_check_internal_cpu_statusfunction cxd2880_tnrdmd_common_tune_setting1function cxd2880_tnrdmd_common_tune_setting2function cxd2880_tnrdmd_sleepfunction cxd2880_tnrdmd_set_cfgfunction cxd2880_tnrdmd_gpio_set_cfgfunction cxd2880_tnrdmd_gpio_set_cfg_subfunction cxd2880_tnrdmd_gpio_readfunction cxd2880_tnrdmd_gpio_read_subfunction cxd2880_tnrdmd_gpio_writefunction cxd2880_tnrdmd_gpio_write_subfunction cxd2880_tnrdmd_interrupt_readfunction cxd2880_tnrdmd_interrupt_clearfunction cxd2880_tnrdmd_ts_buf_clearfunction cxd2880_tnrdmd_chip_idfunction cxd2880_tnrdmd_set_and_save_reg_bitsfunction cxd2880_tnrdmd_set_scan_modefunction cxd2880_tnrdmd_set_pid_ftrfunction cxd2880_tnrdmd_set_rf_lvl_cmpstnfunction cxd2880_tnrdmd_set_rf_lvl_cmpstn_subfunction cxd2880_tnrdmd_set_lna_thrsfunction cxd2880_tnrdmd_set_lna_thrs_subfunction cxd2880_tnrdmd_set_ts_pin_high_lowfunction cxd2880_tnrdmd_set_ts_output
Annotated Snippet
struct cxd2880_tnrdmd_ts_clk_cfg {
u8 srl_clk_mode;
u8 srl_duty_mode;
u8 ts_clk_period;
};
static int set_ts_clk_mode_and_freq(struct cxd2880_tnrdmd *tnr_dmd,
enum cxd2880_dtv_sys sys)
{
int ret;
u8 backwards_compatible = 0;
struct cxd2880_tnrdmd_ts_clk_cfg ts_clk_cfg;
u8 ts_rate_ctrl_off = 0;
u8 ts_in_off = 0;
u8 ts_clk_manaul_on = 0;
u8 data = 0;
static const struct cxd2880_tnrdmd_ts_clk_cfg srl_ts_clk_stgs[2][2] = {
{
{3, 1, 8,},
{0, 2, 16,}
}, {
{1, 1, 8,},
{2, 2, 16,}
}
};
if (!tnr_dmd)
return -EINVAL;
ret = tnr_dmd->io->write_reg(tnr_dmd->io,
CXD2880_IO_TGT_DMD,
0x00, 0x00);
if (ret)
return ret;
if (tnr_dmd->is_ts_backwards_compatible_mode) {
backwards_compatible = 1;
ts_rate_ctrl_off = 1;
ts_in_off = 1;
} else {
backwards_compatible = 0;
ts_rate_ctrl_off = 0;
ts_in_off = 0;
}
if (tnr_dmd->ts_byte_clk_manual_setting) {
ts_clk_manaul_on = 1;
ts_rate_ctrl_off = 0;
}
ret = cxd2880_io_set_reg_bits(tnr_dmd->io,
CXD2880_IO_TGT_DMD,
0xd3, ts_rate_ctrl_off, 0x01);
if (ret)
return ret;
ret = cxd2880_io_set_reg_bits(tnr_dmd->io,
CXD2880_IO_TGT_DMD,
0xde, ts_in_off, 0x01);
if (ret)
return ret;
ret = cxd2880_io_set_reg_bits(tnr_dmd->io,
CXD2880_IO_TGT_DMD,
0xda, ts_clk_manaul_on, 0x01);
if (ret)
return ret;
ts_clk_cfg = srl_ts_clk_stgs[tnr_dmd->srl_ts_clk_mod_cnts]
[tnr_dmd->srl_ts_clk_frq];
if (tnr_dmd->ts_byte_clk_manual_setting)
ts_clk_cfg.ts_clk_period = tnr_dmd->ts_byte_clk_manual_setting;
ret = cxd2880_io_set_reg_bits(tnr_dmd->io,
CXD2880_IO_TGT_DMD,
0xc4, ts_clk_cfg.srl_clk_mode, 0x03);
if (ret)
return ret;
ret = cxd2880_io_set_reg_bits(tnr_dmd->io,
CXD2880_IO_TGT_DMD,
0xd1, ts_clk_cfg.srl_duty_mode, 0x03);
if (ret)
return ret;
ret = tnr_dmd->io->write_reg(tnr_dmd->io,
CXD2880_IO_TGT_DMD, 0xd9,
ts_clk_cfg.ts_clk_period);
Annotation
- Immediate include surface: `media/dvb_frontend.h`, `cxd2880_common.h`, `cxd2880_tnrdmd.h`, `cxd2880_tnrdmd_mon.h`, `cxd2880_tnrdmd_dvbt.h`, `cxd2880_tnrdmd_dvbt2.h`.
- Detected declarations: `struct cxd2880_tnrdmd_ts_clk_cfg`, `function p_init1`, `function p_init2`, `function p_init3`, `function rf_init1`, `function rf_init2`, `function x_tune1`, `function x_tune2`, `function x_tune3`, `function x_tune4`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source 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.