drivers/media/rc/serial_ir.c
Source file repositories/reference/linux-study-clean/drivers/media/rc/serial_ir.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/rc/serial_ir.c- Extension
.c- Size
- 20662 bytes
- Lines
- 846
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/errno.hlinux/interrupt.hlinux/io.hlinux/kernel.hlinux/serial_reg.hlinux/types.hlinux/delay.hlinux/platform_device.hlinux/spinlock.hmedia/rc-core.h
Detected Declarations
struct serial_ir_hwstruct serial_irfunction sinpfunction soutpfunction onfunction offfunction send_pulse_irdeofunction send_space_irdeofunction send_pulse_homebrewfunction send_space_homebrewfunction frbwritefunction serial_ir_irq_handlerfunction hardware_init_portfunction serial_ir_timeoutfunction serial_ir_probefunction serial_ir_openfunction serial_ir_closefunction serial_ir_txfunction serial_ir_tx_duty_cyclefunction serial_ir_tx_carrierfunction serial_ir_suspendfunction serial_ir_resumefunction serial_ir_initfunction serial_ir_exitfunction serial_ir_init_modulefunction serial_ir_exit_modulemodule init serial_ir_init_module
Annotated Snippet
module_init(serial_ir_init_module);
module_exit(serial_ir_exit_module);
MODULE_DESCRIPTION("Infra-red receiver driver for serial ports.");
MODULE_AUTHOR("Ralph Metzler, Trent Piepho, Ben Pfaff, Christoph Bartelmus, Andrei Tanas");
MODULE_LICENSE("GPL");
module_param(type, int, 0444);
MODULE_PARM_DESC(type, "Hardware type (0 = home-brew, 1 = IRdeo, 2 = IRdeo Remote, 3 = AnimaX, 4 = IgorPlug");
module_param_hw(io, int, ioport, 0444);
MODULE_PARM_DESC(io, "I/O address base (0x3f8 or 0x2f8)");
/* some architectures (e.g. intel xscale) have memory mapped registers */
module_param_hw(iommap, ulong, other, 0444);
MODULE_PARM_DESC(iommap, "physical base for memory mapped I/O (0 = no memory mapped io)");
/*
* some architectures (e.g. intel xscale) align the 8bit serial registers
* on 32bit word boundaries.
* See linux-kernel/drivers/tty/serial/8250/8250.c serial_in()/out()
*/
module_param_hw(ioshift, int, other, 0444);
MODULE_PARM_DESC(ioshift, "shift I/O register offset (0 = no shift)");
module_param_hw(irq, int, irq, 0444);
MODULE_PARM_DESC(irq, "Interrupt (4 or 3)");
module_param_hw(share_irq, bool, other, 0444);
MODULE_PARM_DESC(share_irq, "Share interrupts (0 = off, 1 = on)");
module_param(sense, int, 0444);
MODULE_PARM_DESC(sense, "Override autodetection of IR receiver circuit (0 = active high, 1 = active low )");
#ifdef CONFIG_IR_SERIAL_TRANSMITTER
module_param(txsense, bool, 0444);
MODULE_PARM_DESC(txsense, "Sense of transmitter circuit (0 = active high, 1 = active low )");
#endif
module_param(softcarrier, bool, 0444);
MODULE_PARM_DESC(softcarrier, "Software carrier (0 = off, 1 = on, default on)");
Annotation
- Immediate include surface: `linux/module.h`, `linux/errno.h`, `linux/interrupt.h`, `linux/io.h`, `linux/kernel.h`, `linux/serial_reg.h`, `linux/types.h`, `linux/delay.h`.
- Detected declarations: `struct serial_ir_hw`, `struct serial_ir`, `function sinp`, `function soutp`, `function on`, `function off`, `function send_pulse_irdeo`, `function send_space_irdeo`, `function send_pulse_homebrew`, `function send_space_homebrew`.
- 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.
- 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.