drivers/media/pci/ddbridge/ddbridge-sx8.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/ddbridge/ddbridge-sx8.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/ddbridge/ddbridge-sx8.c- Extension
.c- Size
- 11807 bytes
- Lines
- 478
- 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
ddbridge.hddbridge-io.hddbridge-mci.h
Detected Declarations
struct sx8_basestruct sx8function releasefunction get_infofunction get_snrfunction get_strengthfunction read_statusfunction mci_set_tunerfunction stopfunction startfunction start_iqfunction set_parametersfunction tunefunction get_algofunction set_inputfunction init
Annotated Snippet
struct sx8_base {
struct mci_base mci_base;
u8 tuner_use_count[SX8_TUNER_NUM];
u32 gain_mode[SX8_TUNER_NUM];
u32 used_ldpc_bitrate[SX8_DEMOD_NUM];
u8 demod_in_use[SX8_DEMOD_NUM];
u32 iq_mode;
u32 burst_size;
u32 direct_mode;
};
struct sx8 {
struct mci mci;
int first_time_lock;
int started;
struct mci_result signal_info;
u32 bb_mode;
u32 local_frequency;
};
static void release(struct dvb_frontend *fe)
{
struct sx8 *state = fe->demodulator_priv;
struct mci_base *mci_base = state->mci.base;
mci_base->count--;
if (mci_base->count == 0) {
list_del(&mci_base->mci_list);
kfree(mci_base);
}
kfree(state);
}
static int get_info(struct dvb_frontend *fe)
{
int stat;
struct sx8 *state = fe->demodulator_priv;
struct mci_command cmd;
memset(&cmd, 0, sizeof(cmd));
cmd.command = MCI_CMD_GETSIGNALINFO;
cmd.demod = state->mci.demod;
stat = ddb_mci_cmd(&state->mci, &cmd, &state->signal_info);
return stat;
}
static int get_snr(struct dvb_frontend *fe)
{
struct sx8 *state = fe->demodulator_priv;
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
p->cnr.len = 1;
p->cnr.stat[0].scale = FE_SCALE_DECIBEL;
p->cnr.stat[0].svalue =
(s64)state->signal_info.dvbs2_signal_info.signal_to_noise
* 10;
return 0;
}
static int get_strength(struct dvb_frontend *fe)
{
struct sx8 *state = fe->demodulator_priv;
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
s32 str;
str = 100000 -
(state->signal_info.dvbs2_signal_info.channel_power
* 10 + 108750);
p->strength.len = 1;
p->strength.stat[0].scale = FE_SCALE_DECIBEL;
p->strength.stat[0].svalue = str;
return 0;
}
static int read_status(struct dvb_frontend *fe, enum fe_status *status)
{
int stat;
struct sx8 *state = fe->demodulator_priv;
struct mci_command cmd;
struct mci_result res;
cmd.command = MCI_CMD_GETSTATUS;
cmd.demod = state->mci.demod;
stat = ddb_mci_cmd(&state->mci, &cmd, &res);
if (stat)
return stat;
Annotation
- Immediate include surface: `ddbridge.h`, `ddbridge-io.h`, `ddbridge-mci.h`.
- Detected declarations: `struct sx8_base`, `struct sx8`, `function release`, `function get_info`, `function get_snr`, `function get_strength`, `function read_status`, `function mci_set_tuner`, `function stop`, `function start`.
- 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.