drivers/media/rc/rc-core-priv.h

Source file repositories/reference/linux-study-clean/drivers/media/rc/rc-core-priv.h

File Facts

System
Linux kernel
Corpus path
drivers/media/rc/rc-core-priv.h
Extension
.h
Size
9226 bytes
Lines
352
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ir_raw_handler {
	struct list_head list;

	u64 protocols; /* which are handled by this handler */
	int (*decode)(struct rc_dev *dev, struct ir_raw_event event);
	int (*encode)(enum rc_proto protocol, u32 scancode,
		      struct ir_raw_event *events, unsigned int max);
	u32 carrier;
	u32 min_timeout;

	/* These two should only be used by the mce kbd decoder */
	int (*raw_register)(struct rc_dev *dev);
	int (*raw_unregister)(struct rc_dev *dev);
};

struct ir_raw_event_ctrl {
	struct list_head		list;		/* to keep track of raw clients */
	struct task_struct		*thread;
	/* fifo for the pulse/space durations */
	DECLARE_KFIFO(kfifo, struct ir_raw_event, MAX_IR_EVENT_SIZE);
	ktime_t				last_event;	/* when last event occurred */
	struct rc_dev			*dev;		/* pointer to the parent rc_dev */
	/* handle delayed ir_raw_event_store_edge processing */
	spinlock_t			edge_spinlock;
	struct timer_list		edge_handle;

	/* raw decoder state follows */
	struct ir_raw_event prev_ev;
	struct ir_raw_event this_ev;

#ifdef CONFIG_BPF_LIRC_MODE2
	u32				bpf_sample;
	struct bpf_prog_array __rcu	*progs;
#endif
#if IS_ENABLED(CONFIG_IR_NEC_DECODER)
	struct nec_dec {
		int state;
		unsigned count;
		u32 bits;
		bool is_nec_x;
		bool necx_repeat;
	} nec;
#endif
#if IS_ENABLED(CONFIG_IR_RC5_DECODER)
	struct rc5_dec {
		int state;
		u32 bits;
		unsigned count;
		bool is_rc5x;
	} rc5;
#endif
#if IS_ENABLED(CONFIG_IR_RC6_DECODER)
	struct rc6_dec {
		int state;
		u8 header;
		bool toggle;
		u32 body;
		unsigned count;
		unsigned wanted_bits;
	} rc6;
#endif
#if IS_ENABLED(CONFIG_IR_SONY_DECODER)
	struct sony_dec {
		int state;
		u32 bits;
		unsigned count;
	} sony;
#endif
#if IS_ENABLED(CONFIG_IR_JVC_DECODER)
	struct jvc_dec {
		int state;
		u16 bits;
		u16 old_bits;
		unsigned count;
		bool first;
		bool toggle;
	} jvc;
#endif
#if IS_ENABLED(CONFIG_IR_SANYO_DECODER)
	struct sanyo_dec {
		int state;
		unsigned count;
		u64 bits;
	} sanyo;
#endif
#if IS_ENABLED(CONFIG_IR_SHARP_DECODER)
	struct sharp_dec {
		int state;
		unsigned count;
		u32 bits;

Annotation

Implementation Notes