drivers/media/usb/dvb-usb/m920x.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/dvb-usb/m920x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/dvb-usb/m920x.c- Extension
.c- Size
- 30821 bytes
- Lines
- 1282
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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
m920x.hmt352.hmt352_priv.hqt1010.htda1004x.htda827x.hmt2060.hmedia/tuner.htuner-simple.hlinux/unaligned.h
Detected Declarations
function m920x_readfunction m920x_writefunction m920x_write_seqfunction m920x_initfunction m920x_init_epfunction m920x_parse_rc_statefunction m920x_rc_queryfunction m920x_rc_core_queryfunction m920x_i2c_xferfunction m920x_i2c_funcfunction m920x_set_filterfunction m920x_update_filtersfunction m920x_pid_filter_ctrlfunction m920x_pid_filterfunction m920x_firmware_downloadfunction m920x_identify_statefunction m920x_mt352_demod_initfunction m920x_mt352_frontend_attachfunction m920x_mt352_frontend_attach_vp7049function m920x_tda10046_08_frontend_attachfunction m920x_tda10046_0b_frontend_attachfunction m920x_qt1010_tuner_attachfunction m920x_tda8275_60_tuner_attachfunction m920x_tda8275_61_tuner_attachfunction m920x_fmd1216me_tuner_attachfunction m920x_mt2060_tuner_attachfunction m920x_probe
Annotated Snippet
if (ret != 0) {
deb("Initialising remote control failed\n");
return ret;
}
deb("Initialising remote control success\n");
}
for (i = 0; i < d->props.num_adapters; i++)
flags |= d->adapter[i].props.fe[0].caps;
/* Some devices(Dposh) might crash if we attempt touch at all. */
if (flags & DVB_USB_ADAP_HAS_PID_FILTER) {
for (i = 0; i < d->props.num_adapters; i++) {
epi = d->adapter[i].props.fe[0].stream.endpoint - 0x81;
if (epi < 0 || epi >= M9206_MAX_ADAPTERS) {
printk(KERN_INFO "m920x: Unexpected adapter endpoint!\n");
return -EINVAL;
}
adap_enabled[epi] = 1;
}
for (i = 0; i < M9206_MAX_ADAPTERS; i++) {
if (adap_enabled[i])
continue;
if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x0)) != 0)
return ret;
if ((ret = m920x_set_filter(d, 0x81 + i, 0, 0x02f5)) != 0)
return ret;
}
}
return 0;
}
static int m920x_init_ep(struct usb_interface *intf)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct usb_host_interface *alt;
if ((alt = usb_altnum_to_altsetting(intf, 1)) == NULL) {
deb("No alt found!\n");
return -ENODEV;
}
return usb_set_interface(udev, alt->desc.bInterfaceNumber,
alt->desc.bAlternateSetting);
}
static inline void m920x_parse_rc_state(struct dvb_usb_device *d, u8 rc_state,
int *state)
{
struct m920x_state *m = d->priv;
switch (rc_state) {
case 0x80:
*state = REMOTE_NO_KEY_PRESSED;
break;
case 0x88: /* framing error or "invalid code" */
case 0x99:
case 0xc0:
case 0xd8:
*state = REMOTE_NO_KEY_PRESSED;
m->rep_count = 0;
break;
case 0x93:
case 0x92:
case 0x83: /* pinnacle PCTV310e */
case 0x82:
m->rep_count = 0;
*state = REMOTE_KEY_PRESSED;
break;
case 0x91:
case 0x81: /* pinnacle PCTV310e */
/* prevent immediate auto-repeat */
if (++m->rep_count > 2)
*state = REMOTE_KEY_REPEAT;
else
*state = REMOTE_NO_KEY_PRESSED;
break;
default:
deb("Unexpected rc state %02x\n", rc_state);
Annotation
- Immediate include surface: `m920x.h`, `mt352.h`, `mt352_priv.h`, `qt1010.h`, `tda1004x.h`, `tda827x.h`, `mt2060.h`, `media/tuner.h`.
- Detected declarations: `function m920x_read`, `function m920x_write`, `function m920x_write_seq`, `function m920x_init`, `function m920x_init_ep`, `function m920x_parse_rc_state`, `function m920x_rc_query`, `function m920x_rc_core_query`, `function m920x_i2c_xfer`, `function m920x_i2c_func`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.