drivers/media/dvb-frontends/dib9000.c
Source file repositories/reference/linux-study-clean/drivers/media/dvb-frontends/dib9000.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/dvb-frontends/dib9000.c- Extension
.c- Size
- 72062 bytes
- Lines
- 2585
- 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/kernel.hlinux/i2c.hlinux/mutex.hlinux/int_log.hmedia/dvb_frontend.hdib9000.hdibx000_common.h
Detected Declarations
struct i2c_devicestruct dib9000_pid_ctrlstruct dib9000_statestruct dib9000_fe_memory_mapstruct dibDVBTChannelstruct dibDVBTChannelenum dib9000_power_modeenum dib9000_out_messagesenum dib9000_in_messagesfunction to_fw_output_modefunction dib9000_read16_attrfunction dib9000_i2c_read16function dib9000_read_wordfunction dib9000_read_word_attrfunction dib9000_write16_attrfunction dib9000_i2c_write16function dib9000_write_wordfunction dib9000_write_word_attrfunction dib9000_risc_mem_setup_cmdfunction dib9000_risc_mem_setupfunction dib9000_risc_mem_readfunction dib9000_risc_mem_writefunction dib9000_firmware_downloadfunction dib9000_mbx_host_initfunction dib9000_mbx_send_attrfunction dib9000_mbx_readfunction dib9000_risc_debug_buffunction dib9000_mbx_fetch_to_cachefunction dib9000_mbx_countfunction dib9000_mbx_processfunction dib9000_mbx_get_message_attrfunction dib9000_risc_check_versionfunction dib9000_fw_bootfunction dib9000_identifyfunction dib9000_set_power_modefunction dib9000_fw_resetfunction dib9000_risc_apb_access_readfunction dib9000_risc_apb_access_writefunction dib9000_fw_memmbx_syncfunction dib9000_fw_initfunction dib9000_fw_set_channel_headfunction dib9000_fw_get_channelfunction dib9000_fw_set_channel_unionfunction dib9000_fw_tunefunction dib9000_fw_set_diversity_infunction dib9000_fw_set_output_modefunction dib9000_tuner_xferfunction dib9000_fw_set_component_bus_speed
Annotated Snippet
struct i2c_device {
struct i2c_adapter *i2c_adap;
u8 i2c_addr;
u8 *i2c_read_buffer;
u8 *i2c_write_buffer;
};
struct dib9000_pid_ctrl {
#define DIB9000_PID_FILTER_CTRL 0
#define DIB9000_PID_FILTER 1
u8 cmd;
u8 id;
u16 pid;
u8 onoff;
};
struct dib9000_state {
struct i2c_device i2c;
struct dibx000_i2c_master i2c_master;
struct i2c_adapter tuner_adap;
struct i2c_adapter component_bus;
u16 revision;
u8 reg_offs;
enum frontend_tune_state tune_state;
u32 status;
struct dvb_frontend_parametersContext channel_status;
u8 fe_id;
#define DIB9000_GPIO_DEFAULT_DIRECTIONS 0xffff
u16 gpio_dir;
#define DIB9000_GPIO_DEFAULT_VALUES 0x0000
u16 gpio_val;
#define DIB9000_GPIO_DEFAULT_PWM_POS 0xffff
u16 gpio_pwm_pos;
union { /* common for all chips */
struct {
u8 mobile_mode:1;
} host;
struct {
struct dib9000_fe_memory_map {
u16 addr;
u16 size;
} fe_mm[18];
u8 memcmd;
struct mutex mbx_if_lock; /* to protect read/write operations */
struct mutex mbx_lock; /* to protect the whole mailbox handling */
struct mutex mem_lock; /* to protect the memory accesses */
struct mutex mem_mbx_lock; /* to protect the memory-based mailbox */
#define MBX_MAX_WORDS (256 - 200 - 2)
#define DIB9000_MSG_CACHE_SIZE 2
u16 message_cache[DIB9000_MSG_CACHE_SIZE][MBX_MAX_WORDS];
u8 fw_is_running;
} risc;
} platform;
union { /* common for all platforms */
struct {
struct dib9000_config cfg;
} d9;
} chip;
struct dvb_frontend *fe[MAX_NUMBER_OF_FRONTENDS];
u16 component_bus_speed;
/* for the I2C transfer */
struct i2c_msg msg[2];
u8 i2c_write_buffer[255];
u8 i2c_read_buffer[255];
struct mutex demod_lock;
u8 get_frontend_internal;
struct dib9000_pid_ctrl pid_ctrl[10];
s8 pid_ctrl_index; /* -1: empty list; -2: do not use the list */
};
static const u32 fe_info[44] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
enum dib9000_power_mode {
DIB9000_POWER_ALL = 0,
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/i2c.h`, `linux/mutex.h`, `linux/int_log.h`, `media/dvb_frontend.h`, `dib9000.h`, `dibx000_common.h`.
- Detected declarations: `struct i2c_device`, `struct dib9000_pid_ctrl`, `struct dib9000_state`, `struct dib9000_fe_memory_map`, `struct dibDVBTChannel`, `struct dibDVBTChannel`, `enum dib9000_power_mode`, `enum dib9000_out_messages`, `enum dib9000_in_messages`, `function to_fw_output_mode`.
- 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.