drivers/media/dvb-frontends/cxd2820r_t.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/cxd2820r_t.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/cxd2820r_t.c- Extension
.c- Size
- 9088 bytes
- Lines
- 426
- 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
cxd2820r_priv.h
Detected Declarations
function Copyrightfunction cxd2820r_get_frontend_tfunction cxd2820r_read_status_tfunction cxd2820r_init_tfunction cxd2820r_sleep_tfunction cxd2820r_get_tune_settings_t
Annotated Snippet
if (priv->ber_running) {
ret = regmap_bulk_read(priv->regmap[0], 0x0076, buf, 3);
if (ret)
goto error;
if ((buf[2] >> 7) & 0x01) {
post_bit_error = buf[2] << 16 | buf[1] << 8 |
buf[0] << 0;
post_bit_error &= 0x0fffff;
start_ber = true;
} else {
post_bit_error = 0;
start_ber = false;
}
} else {
post_bit_error = 0;
start_ber = true;
}
if (start_ber) {
ret = regmap_write(priv->regmap[0], 0x0079, 0x01);
if (ret)
goto error;
priv->ber_running = true;
}
priv->post_bit_error += post_bit_error;
c->post_bit_error.len = 1;
c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER;
c->post_bit_error.stat[0].uvalue = priv->post_bit_error;
} else {
c->post_bit_error.len = 1;
c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
}
return ret;
error:
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_init_t(struct dvb_frontend *fe)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret;
dev_dbg(&client->dev, "\n");
ret = regmap_write(priv->regmap[0], 0x0085, 0x07);
if (ret)
goto error;
return ret;
error:
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_sleep_t(struct dvb_frontend *fe)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct i2c_client *client = priv->client[0];
int ret;
static struct reg_val_mask tab[] = {
{ 0x000ff, 0x1f, 0xff },
{ 0x00085, 0x00, 0xff },
{ 0x00088, 0x01, 0xff },
{ 0x00081, 0x00, 0xff },
{ 0x00080, 0x00, 0xff },
};
dev_dbg(&client->dev, "\n");
priv->delivery_system = SYS_UNDEFINED;
ret = cxd2820r_wr_reg_val_mask_tab(priv, tab, ARRAY_SIZE(tab));
if (ret)
goto error;
return ret;
error:
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
int cxd2820r_get_tune_settings_t(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings *s)
{
Annotation
- Immediate include surface: `cxd2820r_priv.h`.
- Detected declarations: `function Copyright`, `function cxd2820r_get_frontend_t`, `function cxd2820r_read_status_t`, `function cxd2820r_init_t`, `function cxd2820r_sleep_t`, `function cxd2820r_get_tune_settings_t`.
- 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.