drivers/media/dvb-frontends/s5h1409.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/s5h1409.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/s5h1409.c- Extension
.c- Size
- 23626 bytes
- Lines
- 1012
- 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.hmedia/dvb_frontend.hs5h1409.h
Detected Declarations
struct s5h1409_statefunction s5h1409_writeregfunction s5h1409_readregfunction s5h1409_softresetfunction s5h1409_set_if_freqfunction s5h1409_set_spectralinversionfunction s5h1409_enable_modulationfunction s5h1409_i2c_gate_ctrlfunction s5h1409_set_gpiofunction s5h1409_sleepfunction s5h1409_register_resetfunction s5h1409_set_qam_amhum_modefunction s5h1409_set_qam_amhum_mode_legacyfunction s5h1409_set_qam_interleave_modefunction s5h1409_set_qam_interleave_mode_legacyfunction s5h1409_set_frontendfunction s5h1409_set_mpeg_timingfunction s5h1409_initfunction s5h1409_read_statusfunction s5h1409_qam256_lookup_snrfunction s5h1409_qam64_lookup_snrfunction s5h1409_vsb_lookup_snrfunction s5h1409_read_snrfunction s5h1409_read_signal_strengthfunction s5h1409_read_ucblocksfunction s5h1409_read_berfunction s5h1409_get_frontendfunction s5h1409_get_tune_settingsfunction s5h1409_releaseexport s5h1409_attach
Annotated Snippet
struct s5h1409_state {
struct i2c_adapter *i2c;
/* configuration settings */
const struct s5h1409_config *config;
struct dvb_frontend frontend;
/* previous uncorrected block counter */
enum fe_modulation current_modulation;
u32 current_frequency;
int if_freq;
u32 is_qam_locked;
/* QAM tuning state goes through the following state transitions */
#define QAM_STATE_UNTUNED 0
#define QAM_STATE_TUNING_STARTED 1
#define QAM_STATE_INTERLEAVE_SET 2
#define QAM_STATE_QAM_OPTIMIZED_L1 3
#define QAM_STATE_QAM_OPTIMIZED_L2 4
#define QAM_STATE_QAM_OPTIMIZED_L3 5
u8 qam_state;
};
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Enable verbose debug messages");
#define dprintk if (debug) printk
/* Register values to initialise the demod, this will set VSB by default */
static struct init_tab {
u8 reg;
u16 data;
} init_tab[] = {
{ 0x00, 0x0071, },
{ 0x01, 0x3213, },
{ 0x09, 0x0025, },
{ 0x1c, 0x001d, },
{ 0x1f, 0x002d, },
{ 0x20, 0x001d, },
{ 0x22, 0x0022, },
{ 0x23, 0x0020, },
{ 0x29, 0x110f, },
{ 0x2a, 0x10b4, },
{ 0x2b, 0x10ae, },
{ 0x2c, 0x0031, },
{ 0x31, 0x010d, },
{ 0x32, 0x0100, },
{ 0x44, 0x0510, },
{ 0x54, 0x0104, },
{ 0x58, 0x2222, },
{ 0x59, 0x1162, },
{ 0x5a, 0x3211, },
{ 0x5d, 0x0370, },
{ 0x5e, 0x0296, },
{ 0x61, 0x0010, },
{ 0x63, 0x4a00, },
{ 0x65, 0x0800, },
{ 0x71, 0x0003, },
{ 0x72, 0x0470, },
{ 0x81, 0x0002, },
{ 0x82, 0x0600, },
{ 0x86, 0x0002, },
{ 0x8a, 0x2c38, },
{ 0x8b, 0x2a37, },
{ 0x92, 0x302f, },
{ 0x93, 0x3332, },
{ 0x96, 0x000c, },
{ 0x99, 0x0101, },
{ 0x9c, 0x2e37, },
{ 0x9d, 0x2c37, },
{ 0x9e, 0x2c37, },
{ 0xab, 0x0100, },
{ 0xac, 0x1003, },
{ 0xad, 0x103f, },
{ 0xe2, 0x0100, },
{ 0xe3, 0x1000, },
{ 0x28, 0x1010, },
{ 0xb1, 0x000e, },
};
/* VSB SNR lookup table */
static struct vsb_snr_tab {
u16 val;
u16 data;
} vsb_snr_tab[] = {
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/module.h`, `linux/string.h`, `linux/slab.h`, `linux/delay.h`, `media/dvb_frontend.h`, `s5h1409.h`.
- Detected declarations: `struct s5h1409_state`, `function s5h1409_writereg`, `function s5h1409_readreg`, `function s5h1409_softreset`, `function s5h1409_set_if_freq`, `function s5h1409_set_spectralinversion`, `function s5h1409_enable_modulation`, `function s5h1409_i2c_gate_ctrl`, `function s5h1409_set_gpio`, `function s5h1409_sleep`.
- 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.