drivers/media/usb/dvb-usb-v2/mxl111sf.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/dvb-usb-v2/mxl111sf.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/dvb-usb-v2/mxl111sf.c- Extension
.c- Size
- 41317 bytes
- Lines
- 1467
- 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.
- 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/vmalloc.hlinux/i2c.hmedia/tuner.hmxl111sf.hmxl111sf-reg.hmxl111sf-phy.hmxl111sf-i2c.hmxl111sf-gpio.hmxl111sf-demod.hmxl111sf-tuner.hlgdt3305.hlg2160.h
Detected Declarations
function mxl111sf_ctrl_msgfunction mxl111sf_read_regfunction mxl111sf_write_regfunction mxl111sf_write_reg_maskfunction mxl111sf_ctrl_program_regsfunction mxl1x1sf_get_chip_infofunction mxl111sf_power_ctrlfunction mxl111sf_adap_fe_initfunction mxl111sf_adap_fe_sleepfunction mxl111sf_ep6_streaming_ctrlfunction mxl111sf_ep5_streaming_ctrlfunction mxl111sf_ep4_streaming_ctrlfunction mxl111sf_lgdt3305_frontend_attachfunction mxl111sf_lg2160_frontend_attachfunction mxl111sf_lg2161_frontend_attachfunction mxl111sf_lg2161_ep6_frontend_attachfunction mxl111sf_attach_demodfunction mxl111sf_set_ant_pathfunction mxl111sf_ant_huntfunction mxl111sf_attach_tunerfunction mxl111sf_i2c_funcfunction mxl111sf_initfunction mxl111sf_frontend_attach_dvbtfunction mxl111sf_frontend_attach_atscfunction mxl111sf_frontend_attach_mhfunction mxl111sf_frontend_attach_atsc_mhfunction mxl111sf_frontend_attach_mercuryfunction mxl111sf_frontend_attach_mercury_mhfunction mxl111sf_stream_config_bulkfunction mxl111sf_stream_config_isocfunction mxl111sf_get_stream_config_dvbtfunction mxl111sf_probefunction mxl111sf_get_stream_config_atscfunction mxl111sf_get_stream_config_mhfunction mxl111sf_get_stream_config_atsc_mhfunction mxl111sf_streaming_ctrl_atsc_mhfunction mxl111sf_get_stream_config_mercuryfunction mxl111sf_streaming_ctrl_mercuryfunction mxl111sf_get_stream_config_mercury_mhfunction mxl111sf_streaming_ctrl_mercury_mh
Annotated Snippet
if (mxl_fail(ret)) {
pr_err("failed on reg #%d (0x%02x)", i,
ctrl_reg_info[i].addr);
break;
}
}
return ret;
}
/* ------------------------------------------------------------------------ */
static int mxl1x1sf_get_chip_info(struct mxl111sf_state *state)
{
int ret;
u8 id, ver;
char *mxl_chip, *mxl_rev;
if ((state->chip_id) && (state->chip_ver))
return 0;
ret = mxl111sf_read_reg(state, CHIP_ID_REG, &id);
if (mxl_fail(ret))
goto fail;
state->chip_id = id;
ret = mxl111sf_read_reg(state, TOP_CHIP_REV_ID_REG, &ver);
if (mxl_fail(ret))
goto fail;
state->chip_ver = ver;
switch (id) {
case 0x61:
mxl_chip = "MxL101SF";
break;
case 0x63:
mxl_chip = "MxL111SF";
break;
default:
mxl_chip = "UNKNOWN MxL1X1";
break;
}
switch (ver) {
case 0x36:
state->chip_rev = MXL111SF_V6;
mxl_rev = "v6";
break;
case 0x08:
state->chip_rev = MXL111SF_V8_100;
mxl_rev = "v8_100";
break;
case 0x18:
state->chip_rev = MXL111SF_V8_200;
mxl_rev = "v8_200";
break;
default:
state->chip_rev = 0;
mxl_rev = "UNKNOWN REVISION";
break;
}
pr_info("%s detected, %s (0x%x)", mxl_chip, mxl_rev, ver);
fail:
return ret;
}
#define get_chip_info(state) \
({ \
int ___ret; \
___ret = mxl1x1sf_get_chip_info(state); \
if (mxl_fail(___ret)) { \
mxl_debug("failed to get chip info" \
" on first probe attempt"); \
___ret = mxl1x1sf_get_chip_info(state); \
if (mxl_fail(___ret)) \
pr_err("failed to get chip info during probe"); \
else \
mxl_debug("probe needed a retry " \
"in order to succeed."); \
} \
___ret; \
})
/* ------------------------------------------------------------------------ */
#if 0
static int mxl111sf_power_ctrl(struct dvb_usb_device *d, int onoff)
{
/* power control depends on which adapter is being woken:
* save this for init, instead, via mxl111sf_adap_fe_init */
return 0;
}
#endif
Annotation
- Immediate include surface: `linux/vmalloc.h`, `linux/i2c.h`, `media/tuner.h`, `mxl111sf.h`, `mxl111sf-reg.h`, `mxl111sf-phy.h`, `mxl111sf-i2c.h`, `mxl111sf-gpio.h`.
- Detected declarations: `function mxl111sf_ctrl_msg`, `function mxl111sf_read_reg`, `function mxl111sf_write_reg`, `function mxl111sf_write_reg_mask`, `function mxl111sf_ctrl_program_regs`, `function mxl1x1sf_get_chip_info`, `function mxl111sf_power_ctrl`, `function mxl111sf_adap_fe_init`, `function mxl111sf_adap_fe_sleep`, `function mxl111sf_ep6_streaming_ctrl`.
- 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.