drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/cxd2880/cxd2880_top.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/cxd2880/cxd2880_top.c- Extension
.c- Size
- 46665 bytes
- Lines
- 1958
- 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/spi/spi.hmedia/dvb_frontend.hlinux/int_log.hcxd2880.hcxd2880_tnrdmd_mon.hcxd2880_tnrdmd_dvbt2_mon.hcxd2880_tnrdmd_dvbt_mon.hcxd2880_integ.hcxd2880_tnrdmd_dvbt2.hcxd2880_tnrdmd_dvbt.hcxd2880_devio_spi.hcxd2880_spi_device.hcxd2880_tnrdmd_driver_version.h
Detected Declarations
struct cxd2880_privfunction cxd2880_pre_bit_err_tfunction cxd2880_pre_bit_err_t2function cxd2880_post_bit_err_tfunction cxd2880_post_bit_err_t2function cxd2880_read_block_err_tfunction cxd2880_read_block_err_t2function cxd2880_releasefunction cxd2880_initfunction cxd2880_sleepfunction cxd2880_read_signal_strengthfunction cxd2880_read_snrfunction cxd2880_read_ucblocksfunction cxd2880_read_berfunction cxd2880_set_ber_per_period_tfunction cxd2880_set_ber_per_period_t2function cxd2880_dvbt_tunefunction cxd2880_dvbt2_tunefunction cxd2880_set_frontendfunction cxd2880_get_statsfunction cxd2880_check_l1post_plpfunction cxd2880_read_statusfunction cxd2880_tunefunction cxd2880_get_frontend_tfunction cxd2880_get_frontend_t2function cxd2880_get_frontendfunction cxd2880_get_frontend_algoexport cxd2880_attach
Annotated Snippet
struct cxd2880_priv {
struct cxd2880_tnrdmd tnrdmd;
struct spi_device *spi;
struct cxd2880_io regio;
struct cxd2880_spi_device spi_device;
struct cxd2880_spi cxd2880_spi;
struct cxd2880_dvbt_tune_param dvbt_tune_param;
struct cxd2880_dvbt2_tune_param dvbt2_tune_param;
struct mutex *spi_mutex; /* For SPI access exclusive control */
unsigned long pre_ber_update;
unsigned long pre_ber_interval;
unsigned long post_ber_update;
unsigned long post_ber_interval;
unsigned long ucblock_update;
unsigned long ucblock_interval;
enum fe_status s;
};
static int cxd2880_pre_bit_err_t(struct cxd2880_tnrdmd *tnrdmd,
u32 *pre_bit_err, u32 *pre_bit_count)
{
u8 rdata[2];
int ret;
if (!tnrdmd || !pre_bit_err || !pre_bit_count)
return -EINVAL;
if (tnrdmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB)
return -EINVAL;
if (tnrdmd->state != CXD2880_TNRDMD_STATE_ACTIVE)
return -EINVAL;
if (tnrdmd->sys != CXD2880_DTV_SYS_DVBT)
return -EINVAL;
ret = slvt_freeze_reg(tnrdmd);
if (ret)
return ret;
ret = tnrdmd->io->write_reg(tnrdmd->io,
CXD2880_IO_TGT_DMD,
0x00, 0x10);
if (ret) {
slvt_unfreeze_reg(tnrdmd);
return ret;
}
ret = tnrdmd->io->read_regs(tnrdmd->io,
CXD2880_IO_TGT_DMD,
0x39, rdata, 1);
if (ret) {
slvt_unfreeze_reg(tnrdmd);
return ret;
}
if ((rdata[0] & 0x01) == 0) {
slvt_unfreeze_reg(tnrdmd);
return -EAGAIN;
}
ret = tnrdmd->io->read_regs(tnrdmd->io,
CXD2880_IO_TGT_DMD,
0x22, rdata, 2);
if (ret) {
slvt_unfreeze_reg(tnrdmd);
return ret;
}
*pre_bit_err = (rdata[0] << 8) | rdata[1];
ret = tnrdmd->io->read_regs(tnrdmd->io,
CXD2880_IO_TGT_DMD,
0x6f, rdata, 1);
if (ret) {
slvt_unfreeze_reg(tnrdmd);
return ret;
}
slvt_unfreeze_reg(tnrdmd);
*pre_bit_count = ((rdata[0] & 0x07) == 0) ?
256 : (0x1000 << (rdata[0] & 0x07));
return 0;
}
static int cxd2880_pre_bit_err_t2(struct cxd2880_tnrdmd *tnrdmd,
u32 *pre_bit_err,
u32 *pre_bit_count)
Annotation
- Immediate include surface: `linux/spi/spi.h`, `media/dvb_frontend.h`, `linux/int_log.h`, `cxd2880.h`, `cxd2880_tnrdmd_mon.h`, `cxd2880_tnrdmd_dvbt2_mon.h`, `cxd2880_tnrdmd_dvbt_mon.h`, `cxd2880_integ.h`.
- Detected declarations: `struct cxd2880_priv`, `function cxd2880_pre_bit_err_t`, `function cxd2880_pre_bit_err_t2`, `function cxd2880_post_bit_err_t`, `function cxd2880_post_bit_err_t2`, `function cxd2880_read_block_err_t`, `function cxd2880_read_block_err_t2`, `function cxd2880_release`, `function cxd2880_init`, `function cxd2880_sleep`.
- 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.