drivers/media/rc/imon.c
Source file repositories/reference/linux-study-clean/drivers/media/rc/imon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/rc/imon.c- Extension
.c- Size
- 72451 bytes
- Lines
- 2613
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/errno.hlinux/init.hlinux/kernel.hlinux/ktime.hlinux/module.hlinux/slab.hlinux/uaccess.hlinux/ratelimit.hlinux/input.hlinux/usb.hlinux/usb/input.hmedia/rc-core.hlinux/timer.h
Detected Declarations
struct imon_panel_key_tablestruct imon_usb_dev_descrstruct imon_contextstruct tx_tfunction free_imon_contextfunction devicefunction devicefunction send_packetfunction send_associate_24gfunction send_set_imon_clockfunction associate_remote_showfunction associate_remote_storefunction imon_clock_showfunction imon_clock_storefunction vfd_writefunction newlinefunction usb_tx_callbackfunction imon_touch_display_timeoutfunction imon_ir_change_protocolfunction stabilizefunction imon_remote_key_lookupfunction imon_mce_key_lookupfunction imon_panel_key_lookupfunction imon_mouse_eventfunction imon_touch_eventfunction imon_pad_to_keysfunction coordinatefunction imon_parse_press_typefunction imon_incoming_packetfunction usb_rx_callback_intf0function usb_rx_callback_intf1function typefunction imon_set_display_typefunction imon_find_endpointsfunction imon_init_displayfunction imon_probefunction imon_disconnectfunction imon_suspendfunction imon_resume
Annotated Snippet
static const struct file_operations vfd_fops = {
.owner = THIS_MODULE,
.open = display_open,
.write = vfd_write,
.release = display_close,
.llseek = noop_llseek,
};
/* lcd character device file operations */
static const struct file_operations lcd_fops = {
.owner = THIS_MODULE,
.open = display_open,
.write = lcd_write,
.release = display_close,
.llseek = noop_llseek,
};
enum {
IMON_DISPLAY_TYPE_AUTO = 0,
IMON_DISPLAY_TYPE_VFD = 1,
IMON_DISPLAY_TYPE_LCD = 2,
IMON_DISPLAY_TYPE_VGA = 3,
IMON_DISPLAY_TYPE_NONE = 4,
};
enum {
IMON_KEY_IMON = 0,
IMON_KEY_MCE = 1,
IMON_KEY_PANEL = 2,
};
static struct usb_class_driver imon_vfd_class = {
.name = DEVICE_NAME,
.fops = &vfd_fops,
.minor_base = DISPLAY_MINOR_BASE,
};
static struct usb_class_driver imon_lcd_class = {
.name = DEVICE_NAME,
.fops = &lcd_fops,
.minor_base = DISPLAY_MINOR_BASE,
};
/* imon receiver front panel/knob key table */
static const struct imon_usb_dev_descr imon_default_table = {
.flags = IMON_NO_FLAGS,
.key_table = {
{ 0x000000000f00ffeell, KEY_MEDIA }, /* Go */
{ 0x000000001200ffeell, KEY_UP },
{ 0x000000001300ffeell, KEY_DOWN },
{ 0x000000001400ffeell, KEY_LEFT },
{ 0x000000001500ffeell, KEY_RIGHT },
{ 0x000000001600ffeell, KEY_ENTER },
{ 0x000000001700ffeell, KEY_ESC },
{ 0x000000001f00ffeell, KEY_AUDIO },
{ 0x000000002000ffeell, KEY_VIDEO },
{ 0x000000002100ffeell, KEY_CAMERA },
{ 0x000000002700ffeell, KEY_DVD },
{ 0x000000002300ffeell, KEY_TV },
{ 0x000000002b00ffeell, KEY_EXIT },
{ 0x000000002c00ffeell, KEY_SELECT },
{ 0x000000002d00ffeell, KEY_MENU },
{ 0x000000000500ffeell, KEY_PREVIOUS },
{ 0x000000000700ffeell, KEY_REWIND },
{ 0x000000000400ffeell, KEY_STOP },
{ 0x000000003c00ffeell, KEY_PLAYPAUSE },
{ 0x000000000800ffeell, KEY_FASTFORWARD },
{ 0x000000000600ffeell, KEY_NEXT },
{ 0x000000010000ffeell, KEY_RIGHT },
{ 0x000001000000ffeell, KEY_LEFT },
{ 0x000000003d00ffeell, KEY_SELECT },
{ 0x000100000000ffeell, KEY_VOLUMEUP },
{ 0x010000000000ffeell, KEY_VOLUMEDOWN },
{ 0x000000000100ffeell, KEY_MUTE },
/* 0xffdc iMON MCE VFD */
{ 0x00010000ffffffeell, KEY_VOLUMEUP },
{ 0x01000000ffffffeell, KEY_VOLUMEDOWN },
{ 0x00000001ffffffeell, KEY_MUTE },
{ 0x0000000fffffffeell, KEY_MEDIA },
{ 0x00000012ffffffeell, KEY_UP },
{ 0x00000013ffffffeell, KEY_DOWN },
{ 0x00000014ffffffeell, KEY_LEFT },
{ 0x00000015ffffffeell, KEY_RIGHT },
{ 0x00000016ffffffeell, KEY_ENTER },
{ 0x00000017ffffffeell, KEY_ESC },
/* iMON Knob values */
{ 0x000100ffffffffeell, KEY_VOLUMEUP },
{ 0x010000ffffffffeell, KEY_VOLUMEDOWN },
{ 0x000008ffffffffeell, KEY_MUTE },
{ 0, KEY_RESERVED },
Annotation
- Immediate include surface: `linux/errno.h`, `linux/init.h`, `linux/kernel.h`, `linux/ktime.h`, `linux/module.h`, `linux/slab.h`, `linux/uaccess.h`, `linux/ratelimit.h`.
- Detected declarations: `struct imon_panel_key_table`, `struct imon_usb_dev_descr`, `struct imon_context`, `struct tx_t`, `function free_imon_context`, `function device`, `function device`, `function send_packet`, `function send_associate_24g`, `function send_set_imon_clock`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.