drivers/media/dvb-frontends/cx24117.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/cx24117.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/cx24117.c- Extension
.c- Size
- 42813 bytes
- Lines
- 1655
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/slab.hlinux/kernel.hlinux/module.hlinux/moduleparam.hlinux/init.hlinux/firmware.htuner-i2c.hmedia/dvb_frontend.hcx24117.h
Detected Declarations
struct cx24117_tuningstruct cx24117_cmdstruct cx24117_privstruct cx24117_stateenum cmdsfunction cx24117_writeregfunction cx24117_writecmdfunction cx24117_readregfunction cx24117_readregNfunction cx24117_set_inversionfunction cx24117_lookup_fecmodfunction cx24117_set_fecfunction cx24117_set_symbolratefunction cx24117_firmware_ondemandfunction cx24117_cmd_execute_nolockfunction cx24117_cmd_executefunction cx24117_load_firmwarefunction cx24117_read_statusfunction cx24117_read_berfunction cx24117_read_signal_strengthfunction cx24117_read_snrfunction cx24117_read_ucblocksfunction cx24117_clone_paramsfunction cx24117_wait_for_lnbfunction cx24117_set_voltagefunction cx24117_set_tonefunction cx24117_diseqc_initfunction cx24117_send_diseqc_msgfunction cx24117_diseqc_send_burstfunction cx24117_get_privfunction cx24117_release_privfunction cx24117_releasefunction cx24117_initfefunction cx24117_sleepfunction cx24117_set_frontendfunction cx24117_tunefunction cx24117_get_algofunction cx24117_get_frontendexport cx24117_attach
Annotated Snippet
struct cx24117_tuning {
u32 frequency;
u32 symbol_rate;
enum fe_spectral_inversion inversion;
enum fe_code_rate fec;
enum fe_delivery_system delsys;
enum fe_modulation modulation;
enum fe_pilot pilot;
enum fe_rolloff rolloff;
/* Demod values */
u8 fec_val;
u8 fec_mask;
u8 inversion_val;
u8 pilot_val;
u8 rolloff_val;
};
/* Basic commands that are sent to the firmware */
struct cx24117_cmd {
u8 len;
u8 args[CX24117_ARGLEN];
};
/* common to both fe's */
struct cx24117_priv {
u8 demod_address;
struct i2c_adapter *i2c;
u8 skip_fw_load;
struct mutex fe_lock;
/* Used for sharing this struct between demods */
struct tuner_i2c_props i2c_props;
struct list_head hybrid_tuner_instance_list;
};
/* one per each fe */
struct cx24117_state {
struct cx24117_priv *priv;
struct dvb_frontend frontend;
struct cx24117_tuning dcur;
struct cx24117_tuning dnxt;
struct cx24117_cmd dsec_cmd;
int demod;
};
/* modfec (modulation and FEC) lookup table */
/* Check cx24116.c for a detailed description of each field */
static struct cx24117_modfec {
enum fe_delivery_system delivery_system;
enum fe_modulation modulation;
enum fe_code_rate fec;
u8 mask; /* In DVBS mode this is used to autodetect */
u8 val; /* Passed to the firmware to indicate mode selection */
} cx24117_modfec_modes[] = {
/* QPSK. For unknown rates we set hardware to auto detect 0xfe 0x30 */
/*mod fec mask val */
{ SYS_DVBS, QPSK, FEC_NONE, 0xfe, 0x30 },
{ SYS_DVBS, QPSK, FEC_1_2, 0x02, 0x2e }, /* 00000010 00101110 */
{ SYS_DVBS, QPSK, FEC_2_3, 0x04, 0x2f }, /* 00000100 00101111 */
{ SYS_DVBS, QPSK, FEC_3_4, 0x08, 0x30 }, /* 00001000 00110000 */
{ SYS_DVBS, QPSK, FEC_4_5, 0xfe, 0x30 }, /* 000?0000 ? */
{ SYS_DVBS, QPSK, FEC_5_6, 0x20, 0x31 }, /* 00100000 00110001 */
{ SYS_DVBS, QPSK, FEC_6_7, 0xfe, 0x30 }, /* 0?000000 ? */
{ SYS_DVBS, QPSK, FEC_7_8, 0x80, 0x32 }, /* 10000000 00110010 */
{ SYS_DVBS, QPSK, FEC_8_9, 0xfe, 0x30 }, /* 0000000? ? */
{ SYS_DVBS, QPSK, FEC_AUTO, 0xfe, 0x30 },
/* NBC-QPSK */
{ SYS_DVBS2, QPSK, FEC_NONE, 0x00, 0x00 },
{ SYS_DVBS2, QPSK, FEC_1_2, 0x00, 0x04 },
{ SYS_DVBS2, QPSK, FEC_3_5, 0x00, 0x05 },
{ SYS_DVBS2, QPSK, FEC_2_3, 0x00, 0x06 },
{ SYS_DVBS2, QPSK, FEC_3_4, 0x00, 0x07 },
{ SYS_DVBS2, QPSK, FEC_4_5, 0x00, 0x08 },
{ SYS_DVBS2, QPSK, FEC_5_6, 0x00, 0x09 },
{ SYS_DVBS2, QPSK, FEC_8_9, 0x00, 0x0a },
{ SYS_DVBS2, QPSK, FEC_9_10, 0x00, 0x0b },
{ SYS_DVBS2, QPSK, FEC_AUTO, 0x00, 0x00 },
/* 8PSK */
{ SYS_DVBS2, PSK_8, FEC_NONE, 0x00, 0x00 },
{ SYS_DVBS2, PSK_8, FEC_3_5, 0x00, 0x0c },
{ SYS_DVBS2, PSK_8, FEC_2_3, 0x00, 0x0d },
{ SYS_DVBS2, PSK_8, FEC_3_4, 0x00, 0x0e },
{ SYS_DVBS2, PSK_8, FEC_5_6, 0x00, 0x0f },
{ SYS_DVBS2, PSK_8, FEC_8_9, 0x00, 0x10 },
{ SYS_DVBS2, PSK_8, FEC_9_10, 0x00, 0x11 },
Annotation
- Immediate include surface: `linux/slab.h`, `linux/kernel.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/init.h`, `linux/firmware.h`, `tuner-i2c.h`, `media/dvb_frontend.h`.
- Detected declarations: `struct cx24117_tuning`, `struct cx24117_cmd`, `struct cx24117_priv`, `struct cx24117_state`, `enum cmds`, `function cx24117_writereg`, `function cx24117_writecmd`, `function cx24117_readreg`, `function cx24117_readregN`, `function cx24117_set_inversion`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration 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.