drivers/media/dvb-frontends/gp8psk-fe.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/gp8psk-fe.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/gp8psk-fe.c- Extension
.c- Size
- 9935 bytes
- Lines
- 398
- 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
gp8psk-fe.hmedia/dvb_frontend.h
Detected Declarations
struct gp8psk_fe_statefunction gp8psk_tuned_to_DCIIfunction gp8psk_set_tuner_modefunction gp8psk_fe_update_statusfunction gp8psk_fe_read_statusfunction gp8psk_fe_read_berfunction gp8psk_fe_read_unc_blocksfunction gp8psk_fe_read_snrfunction gp8psk_fe_read_signal_strengthfunction gp8psk_fe_get_tune_settingsfunction gp8psk_fe_set_frontendfunction gp8psk_fe_send_diseqc_msgfunction gp8psk_fe_send_diseqc_burstfunction gp8psk_fe_set_tonefunction gp8psk_fe_set_voltagefunction gp8psk_fe_enable_high_lnb_voltagefunction gp8psk_fe_send_legacy_dish_cmdfunction gp8psk_fe_releaseexport gp8psk_fe_attach
Annotated Snippet
struct gp8psk_fe_state {
struct dvb_frontend fe;
void *priv;
const struct gp8psk_fe_ops *ops;
bool is_rev1;
u8 lock;
u16 snr;
unsigned long next_status_check;
unsigned long status_check_interval;
};
static int gp8psk_tuned_to_DCII(struct dvb_frontend *fe)
{
struct gp8psk_fe_state *st = fe->demodulator_priv;
u8 status;
st->ops->in(st->priv, GET_8PSK_CONFIG, 0, 0, &status, 1);
return status & bmDCtuned;
}
static int gp8psk_set_tuner_mode(struct dvb_frontend *fe, int mode)
{
struct gp8psk_fe_state *st = fe->demodulator_priv;
return st->ops->out(st->priv, SET_8PSK_CONFIG, mode, 0, NULL, 0);
}
static int gp8psk_fe_update_status(struct gp8psk_fe_state *st)
{
u8 buf[6];
if (time_after(jiffies,st->next_status_check)) {
st->ops->in(st->priv, GET_SIGNAL_LOCK, 0, 0, &st->lock, 1);
st->ops->in(st->priv, GET_SIGNAL_STRENGTH, 0, 0, buf, 6);
st->snr = (buf[1]) << 8 | buf[0];
st->next_status_check = jiffies + (st->status_check_interval*HZ)/1000;
}
return 0;
}
static int gp8psk_fe_read_status(struct dvb_frontend *fe,
enum fe_status *status)
{
struct gp8psk_fe_state *st = fe->demodulator_priv;
gp8psk_fe_update_status(st);
if (st->lock)
*status = FE_HAS_LOCK | FE_HAS_SYNC | FE_HAS_VITERBI | FE_HAS_SIGNAL | FE_HAS_CARRIER;
else
*status = 0;
if (*status & FE_HAS_LOCK)
st->status_check_interval = 1000;
else
st->status_check_interval = 100;
return 0;
}
/* not supported by this Frontend */
static int gp8psk_fe_read_ber(struct dvb_frontend* fe, u32 *ber)
{
(void) fe;
*ber = 0;
return 0;
}
/* not supported by this Frontend */
static int gp8psk_fe_read_unc_blocks(struct dvb_frontend* fe, u32 *unc)
{
(void) fe;
*unc = 0;
return 0;
}
static int gp8psk_fe_read_snr(struct dvb_frontend* fe, u16 *snr)
{
struct gp8psk_fe_state *st = fe->demodulator_priv;
gp8psk_fe_update_status(st);
/* snr is reported in dBu*256 */
*snr = st->snr;
return 0;
}
static int gp8psk_fe_read_signal_strength(struct dvb_frontend* fe, u16 *strength)
{
struct gp8psk_fe_state *st = fe->demodulator_priv;
gp8psk_fe_update_status(st);
/* snr is reported in dBu*256 */
/* snr / 38.4 ~= 100% strength */
/* snr * 17 returns 100% strength as 65535 */
if (st->snr > 0xf00)
Annotation
- Immediate include surface: `gp8psk-fe.h`, `media/dvb_frontend.h`.
- Detected declarations: `struct gp8psk_fe_state`, `function gp8psk_tuned_to_DCII`, `function gp8psk_set_tuner_mode`, `function gp8psk_fe_update_status`, `function gp8psk_fe_read_status`, `function gp8psk_fe_read_ber`, `function gp8psk_fe_read_unc_blocks`, `function gp8psk_fe_read_snr`, `function gp8psk_fe_read_signal_strength`, `function gp8psk_fe_get_tune_settings`.
- 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.