drivers/media/dvb-frontends/stv0900_sw.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/stv0900_sw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/stv0900_sw.c- Extension
.c- Size
- 50708 bytes
- Lines
- 2016
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stv0900.hstv0900_reg.hstv0900_priv.h
Detected Declarations
function Copyrightfunction stv0900_check_signal_presencefunction stv0900_get_sw_loop_paramsfunction stv0900_search_carr_sw_loopfunction stv0900_sw_algofunction stv0900_get_symbol_ratefunction stv0900_set_symbol_ratefunction stv0900_set_max_symbol_ratefunction stv0900_set_min_symbol_ratefunction stv0900_get_timing_offstfunction stv0900_set_dvbs2_rollofffunction stv0900_carrier_widthfunction stv0900_check_timing_lockfunction stv0900_get_demod_cold_lockfunction stv0900_get_lock_timeoutfunction stv0900_set_viterbi_tracqfunction stv0900_set_viterbi_standardfunction stv0900_get_vit_fecfunction stv0900_set_dvbs1_track_car_loopfunction stv0900_track_optimizationfunction stv0900_get_fec_lockfunction stv0900_wait_for_lockfunction stv0900_get_standardfunction stv0900_get_carr_freqfunction stv0900_get_tuner_freqfunction stv0900_get_signal_paramsfunction stv0900_dvbs1_acq_workaroundfunction stv0900_blind_check_agc2_min_levelfunction stv0900_search_srate_coarsefunction stv0900_search_srate_finefunction stv0900_blind_search_algofunction stv0900_set_viterbi_acqfunction stv0900_set_search_standardfunction stv0900_algo
Annotated Snippet
if (intp->chip_id == 0x12) {
stv0900_write_bits(intp, RST_HWARE, 1);
stv0900_write_bits(intp, RST_HWARE, 0);
}
if (zigzag == TRUE) {
if (freqOffset >= 0)
freqOffset = -freqOffset - 2 * FreqIncr;
else
freqOffset = -freqOffset;
} else
freqOffset += + 2 * FreqIncr;
stepCpt++;
lock = stv0900_get_demod_lock(intp, demod, Timeout);
no_signal = stv0900_check_signal_presence(intp, demod);
} while ((lock == FALSE)
&& (no_signal == FALSE)
&& ((freqOffset - FreqIncr) < max_carrier)
&& ((freqOffset + FreqIncr) > -max_carrier)
&& (stepCpt < MaxStep));
stv0900_write_bits(intp, ALGOSWRST, 0);
return lock;
}
static int stv0900_sw_algo(struct stv0900_internal *intp,
enum fe_stv0900_demod_num demod)
{
int lock = FALSE,
no_signal,
zigzag;
s32 s2fw,
fqc_inc,
sft_stp_tout,
trial_cntr,
max_steps;
stv0900_get_sw_loop_params(intp, &fqc_inc, &sft_stp_tout,
&max_steps, demod);
switch (intp->srch_standard[demod]) {
case STV0900_SEARCH_DVBS1:
case STV0900_SEARCH_DSS:
if (intp->chip_id >= 0x20)
stv0900_write_reg(intp, CARFREQ, 0x3b);
else
stv0900_write_reg(intp, CARFREQ, 0xef);
stv0900_write_reg(intp, DMDCFGMD, 0x49);
zigzag = FALSE;
break;
case STV0900_SEARCH_DVBS2:
if (intp->chip_id >= 0x20)
stv0900_write_reg(intp, CORRELABS, 0x79);
else
stv0900_write_reg(intp, CORRELABS, 0x68);
stv0900_write_reg(intp, DMDCFGMD, 0x89);
zigzag = TRUE;
break;
case STV0900_AUTO_SEARCH:
default:
if (intp->chip_id >= 0x20) {
stv0900_write_reg(intp, CARFREQ, 0x3b);
stv0900_write_reg(intp, CORRELABS, 0x79);
} else {
stv0900_write_reg(intp, CARFREQ, 0xef);
stv0900_write_reg(intp, CORRELABS, 0x68);
}
stv0900_write_reg(intp, DMDCFGMD, 0xc9);
zigzag = FALSE;
break;
}
trial_cntr = 0;
do {
lock = stv0900_search_carr_sw_loop(intp,
fqc_inc,
sft_stp_tout,
zigzag,
max_steps,
demod);
no_signal = stv0900_check_signal_presence(intp, demod);
trial_cntr++;
if ((lock == TRUE)
|| (no_signal == TRUE)
Annotation
- Immediate include surface: `stv0900.h`, `stv0900_reg.h`, `stv0900_priv.h`.
- Detected declarations: `function Copyright`, `function stv0900_check_signal_presence`, `function stv0900_get_sw_loop_params`, `function stv0900_search_carr_sw_loop`, `function stv0900_sw_algo`, `function stv0900_get_symbol_rate`, `function stv0900_set_symbol_rate`, `function stv0900_set_max_symbol_rate`, `function stv0900_set_min_symbol_rate`, `function stv0900_get_timing_offst`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source 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.