drivers/media/rc/nuvoton-cir.h
Source file repositories/reference/linux-study-clean/drivers/media/rc/nuvoton-cir.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/rc/nuvoton-cir.h- Extension
.h- Size
- 9666 bytes
- Lines
- 358
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/spinlock.hlinux/ioctl.h
Detected Declarations
struct nvt_chipstruct nvt_devenum nvt_chip_ver
Annotated Snippet
struct nvt_chip {
const char *name;
enum nvt_chip_ver chip_ver;
};
struct nvt_dev {
struct rc_dev *rdev;
spinlock_t lock;
/* for rx */
u8 buf[RX_BUF_LEN];
unsigned int pkts;
/* EFER Config register index/data pair */
u32 cr_efir;
u32 cr_efdr;
/* hardware I/O settings */
unsigned long cir_addr;
unsigned long cir_wake_addr;
int cir_irq;
enum nvt_chip_ver chip_ver;
/* hardware id */
u8 chip_major;
u8 chip_minor;
/* carrier period = 1 / frequency */
u32 carrier;
};
/* buffer packet constants */
#define BUF_PULSE_BIT 0x80
#define BUF_LEN_MASK 0x7f
#define BUF_REPEAT_BYTE 0x70
#define BUF_REPEAT_MASK 0xf0
/* CIR settings */
/* total length of CIR and CIR WAKE */
#define CIR_IOREG_LENGTH 0x0f
/* RX limit length, 8 high bits for SLCH, 8 low bits for SLCL */
#define CIR_RX_LIMIT_COUNT (IR_DEFAULT_TIMEOUT / SAMPLE_PERIOD)
/* CIR Regs */
#define CIR_IRCON 0x00
#define CIR_IRSTS 0x01
#define CIR_IREN 0x02
#define CIR_RXFCONT 0x03
#define CIR_CP 0x04
#define CIR_CC 0x05
#define CIR_SLCH 0x06
#define CIR_SLCL 0x07
#define CIR_FIFOCON 0x08
#define CIR_IRFIFOSTS 0x09
#define CIR_SRXFIFO 0x0a
#define CIR_TXFCONT 0x0b
#define CIR_STXFIFO 0x0c
#define CIR_FCCH 0x0d
#define CIR_FCCL 0x0e
#define CIR_IRFSM 0x0f
/* CIR IRCON settings */
#define CIR_IRCON_RECV 0x80
#define CIR_IRCON_WIREN 0x40
#define CIR_IRCON_TXEN 0x20
#define CIR_IRCON_RXEN 0x10
#define CIR_IRCON_WRXINV 0x08
#define CIR_IRCON_RXINV 0x04
#define CIR_IRCON_SAMPLE_PERIOD_SEL_1 0x00
#define CIR_IRCON_SAMPLE_PERIOD_SEL_25 0x01
#define CIR_IRCON_SAMPLE_PERIOD_SEL_50 0x02
#define CIR_IRCON_SAMPLE_PERIOD_SEL_100 0x03
/* FIXME: make this a runtime option */
/* select sample period as 50us */
#define CIR_IRCON_SAMPLE_PERIOD_SEL CIR_IRCON_SAMPLE_PERIOD_SEL_50
/* CIR IRSTS settings */
#define CIR_IRSTS_RDR 0x80
#define CIR_IRSTS_RTR 0x40
#define CIR_IRSTS_PE 0x20
#define CIR_IRSTS_RFO 0x10
#define CIR_IRSTS_TE 0x08
#define CIR_IRSTS_TTR 0x04
#define CIR_IRSTS_TFU 0x02
#define CIR_IRSTS_GH 0x01
Annotation
- Immediate include surface: `linux/spinlock.h`, `linux/ioctl.h`.
- Detected declarations: `struct nvt_chip`, `struct nvt_dev`, `enum nvt_chip_ver`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.