18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Remote Controller core raw events header
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2010 by Mauro Carvalho Chehab
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef _RC_CORE_PRIV
98c2ecf20Sopenharmony_ci#define _RC_CORE_PRIV
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define	RC_DEV_MAX		256
128c2ecf20Sopenharmony_ci/* Define the max number of pulse/space transitions to buffer */
138c2ecf20Sopenharmony_ci#define	MAX_IR_EVENT_SIZE	512
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include <linux/slab.h>
168c2ecf20Sopenharmony_ci#include <uapi/linux/bpf.h>
178c2ecf20Sopenharmony_ci#include <media/rc-core.h>
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/**
208c2ecf20Sopenharmony_ci * rc_open - Opens a RC device
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci * @rdev: pointer to struct rc_dev.
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ciint rc_open(struct rc_dev *rdev);
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/**
278c2ecf20Sopenharmony_ci * rc_close - Closes a RC device
288c2ecf20Sopenharmony_ci *
298c2ecf20Sopenharmony_ci * @rdev: pointer to struct rc_dev.
308c2ecf20Sopenharmony_ci */
318c2ecf20Sopenharmony_civoid rc_close(struct rc_dev *rdev);
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_cistruct ir_raw_handler {
348c2ecf20Sopenharmony_ci	struct list_head list;
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci	u64 protocols; /* which are handled by this handler */
378c2ecf20Sopenharmony_ci	int (*decode)(struct rc_dev *dev, struct ir_raw_event event);
388c2ecf20Sopenharmony_ci	int (*encode)(enum rc_proto protocol, u32 scancode,
398c2ecf20Sopenharmony_ci		      struct ir_raw_event *events, unsigned int max);
408c2ecf20Sopenharmony_ci	u32 carrier;
418c2ecf20Sopenharmony_ci	u32 min_timeout;
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci	/* These two should only be used by the mce kbd decoder */
448c2ecf20Sopenharmony_ci	int (*raw_register)(struct rc_dev *dev);
458c2ecf20Sopenharmony_ci	int (*raw_unregister)(struct rc_dev *dev);
468c2ecf20Sopenharmony_ci};
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_cistruct ir_raw_event_ctrl {
498c2ecf20Sopenharmony_ci	struct list_head		list;		/* to keep track of raw clients */
508c2ecf20Sopenharmony_ci	struct task_struct		*thread;
518c2ecf20Sopenharmony_ci	/* fifo for the pulse/space durations */
528c2ecf20Sopenharmony_ci	DECLARE_KFIFO(kfifo, struct ir_raw_event, MAX_IR_EVENT_SIZE);
538c2ecf20Sopenharmony_ci	ktime_t				last_event;	/* when last event occurred */
548c2ecf20Sopenharmony_ci	struct rc_dev			*dev;		/* pointer to the parent rc_dev */
558c2ecf20Sopenharmony_ci	/* handle delayed ir_raw_event_store_edge processing */
568c2ecf20Sopenharmony_ci	spinlock_t			edge_spinlock;
578c2ecf20Sopenharmony_ci	struct timer_list		edge_handle;
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci	/* raw decoder state follows */
608c2ecf20Sopenharmony_ci	struct ir_raw_event prev_ev;
618c2ecf20Sopenharmony_ci	struct ir_raw_event this_ev;
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci#ifdef CONFIG_BPF_LIRC_MODE2
648c2ecf20Sopenharmony_ci	u32				bpf_sample;
658c2ecf20Sopenharmony_ci	struct bpf_prog_array __rcu	*progs;
668c2ecf20Sopenharmony_ci#endif
678c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_NEC_DECODER)
688c2ecf20Sopenharmony_ci	struct nec_dec {
698c2ecf20Sopenharmony_ci		int state;
708c2ecf20Sopenharmony_ci		unsigned count;
718c2ecf20Sopenharmony_ci		u32 bits;
728c2ecf20Sopenharmony_ci		bool is_nec_x;
738c2ecf20Sopenharmony_ci		bool necx_repeat;
748c2ecf20Sopenharmony_ci	} nec;
758c2ecf20Sopenharmony_ci#endif
768c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_RC5_DECODER)
778c2ecf20Sopenharmony_ci	struct rc5_dec {
788c2ecf20Sopenharmony_ci		int state;
798c2ecf20Sopenharmony_ci		u32 bits;
808c2ecf20Sopenharmony_ci		unsigned count;
818c2ecf20Sopenharmony_ci		bool is_rc5x;
828c2ecf20Sopenharmony_ci	} rc5;
838c2ecf20Sopenharmony_ci#endif
848c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_RC6_DECODER)
858c2ecf20Sopenharmony_ci	struct rc6_dec {
868c2ecf20Sopenharmony_ci		int state;
878c2ecf20Sopenharmony_ci		u8 header;
888c2ecf20Sopenharmony_ci		u32 body;
898c2ecf20Sopenharmony_ci		bool toggle;
908c2ecf20Sopenharmony_ci		unsigned count;
918c2ecf20Sopenharmony_ci		unsigned wanted_bits;
928c2ecf20Sopenharmony_ci	} rc6;
938c2ecf20Sopenharmony_ci#endif
948c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_SONY_DECODER)
958c2ecf20Sopenharmony_ci	struct sony_dec {
968c2ecf20Sopenharmony_ci		int state;
978c2ecf20Sopenharmony_ci		u32 bits;
988c2ecf20Sopenharmony_ci		unsigned count;
998c2ecf20Sopenharmony_ci	} sony;
1008c2ecf20Sopenharmony_ci#endif
1018c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_JVC_DECODER)
1028c2ecf20Sopenharmony_ci	struct jvc_dec {
1038c2ecf20Sopenharmony_ci		int state;
1048c2ecf20Sopenharmony_ci		u16 bits;
1058c2ecf20Sopenharmony_ci		u16 old_bits;
1068c2ecf20Sopenharmony_ci		unsigned count;
1078c2ecf20Sopenharmony_ci		bool first;
1088c2ecf20Sopenharmony_ci		bool toggle;
1098c2ecf20Sopenharmony_ci	} jvc;
1108c2ecf20Sopenharmony_ci#endif
1118c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_SANYO_DECODER)
1128c2ecf20Sopenharmony_ci	struct sanyo_dec {
1138c2ecf20Sopenharmony_ci		int state;
1148c2ecf20Sopenharmony_ci		unsigned count;
1158c2ecf20Sopenharmony_ci		u64 bits;
1168c2ecf20Sopenharmony_ci	} sanyo;
1178c2ecf20Sopenharmony_ci#endif
1188c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_SHARP_DECODER)
1198c2ecf20Sopenharmony_ci	struct sharp_dec {
1208c2ecf20Sopenharmony_ci		int state;
1218c2ecf20Sopenharmony_ci		unsigned count;
1228c2ecf20Sopenharmony_ci		u32 bits;
1238c2ecf20Sopenharmony_ci		unsigned int pulse_len;
1248c2ecf20Sopenharmony_ci	} sharp;
1258c2ecf20Sopenharmony_ci#endif
1268c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_MCE_KBD_DECODER)
1278c2ecf20Sopenharmony_ci	struct mce_kbd_dec {
1288c2ecf20Sopenharmony_ci		/* locks key up timer */
1298c2ecf20Sopenharmony_ci		spinlock_t keylock;
1308c2ecf20Sopenharmony_ci		struct timer_list rx_timeout;
1318c2ecf20Sopenharmony_ci		int state;
1328c2ecf20Sopenharmony_ci		u8 header;
1338c2ecf20Sopenharmony_ci		u32 body;
1348c2ecf20Sopenharmony_ci		unsigned count;
1358c2ecf20Sopenharmony_ci		unsigned wanted_bits;
1368c2ecf20Sopenharmony_ci	} mce_kbd;
1378c2ecf20Sopenharmony_ci#endif
1388c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_XMP_DECODER)
1398c2ecf20Sopenharmony_ci	struct xmp_dec {
1408c2ecf20Sopenharmony_ci		int state;
1418c2ecf20Sopenharmony_ci		unsigned count;
1428c2ecf20Sopenharmony_ci		u32 durations[16];
1438c2ecf20Sopenharmony_ci	} xmp;
1448c2ecf20Sopenharmony_ci#endif
1458c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_IMON_DECODER)
1468c2ecf20Sopenharmony_ci	struct imon_dec {
1478c2ecf20Sopenharmony_ci		int state;
1488c2ecf20Sopenharmony_ci		int count;
1498c2ecf20Sopenharmony_ci		int last_chk;
1508c2ecf20Sopenharmony_ci		unsigned int bits;
1518c2ecf20Sopenharmony_ci		bool stick_keyboard;
1528c2ecf20Sopenharmony_ci	} imon;
1538c2ecf20Sopenharmony_ci#endif
1548c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IR_RCMM_DECODER)
1558c2ecf20Sopenharmony_ci	struct rcmm_dec {
1568c2ecf20Sopenharmony_ci		int state;
1578c2ecf20Sopenharmony_ci		unsigned int count;
1588c2ecf20Sopenharmony_ci		u32 bits;
1598c2ecf20Sopenharmony_ci	} rcmm;
1608c2ecf20Sopenharmony_ci#endif
1618c2ecf20Sopenharmony_ci};
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci/* Mutex for locking raw IR processing and handler change */
1648c2ecf20Sopenharmony_ciextern struct mutex ir_raw_handler_lock;
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci/* macros for IR decoders */
1678c2ecf20Sopenharmony_cistatic inline bool geq_margin(unsigned d1, unsigned d2, unsigned margin)
1688c2ecf20Sopenharmony_ci{
1698c2ecf20Sopenharmony_ci	return d1 > (d2 - margin);
1708c2ecf20Sopenharmony_ci}
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_cistatic inline bool eq_margin(unsigned d1, unsigned d2, unsigned margin)
1738c2ecf20Sopenharmony_ci{
1748c2ecf20Sopenharmony_ci	return ((d1 > (d2 - margin)) && (d1 < (d2 + margin)));
1758c2ecf20Sopenharmony_ci}
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_cistatic inline bool is_transition(struct ir_raw_event *x, struct ir_raw_event *y)
1788c2ecf20Sopenharmony_ci{
1798c2ecf20Sopenharmony_ci	return x->pulse != y->pulse;
1808c2ecf20Sopenharmony_ci}
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_cistatic inline void decrease_duration(struct ir_raw_event *ev, unsigned duration)
1838c2ecf20Sopenharmony_ci{
1848c2ecf20Sopenharmony_ci	if (duration > ev->duration)
1858c2ecf20Sopenharmony_ci		ev->duration = 0;
1868c2ecf20Sopenharmony_ci	else
1878c2ecf20Sopenharmony_ci		ev->duration -= duration;
1888c2ecf20Sopenharmony_ci}
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci/* Returns true if event is normal pulse/space event */
1918c2ecf20Sopenharmony_cistatic inline bool is_timing_event(struct ir_raw_event ev)
1928c2ecf20Sopenharmony_ci{
1938c2ecf20Sopenharmony_ci	return !ev.carrier_report && !ev.reset;
1948c2ecf20Sopenharmony_ci}
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci#define TO_STR(is_pulse)		((is_pulse) ? "pulse" : "space")
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci/* functions for IR encoders */
1998c2ecf20Sopenharmony_cibool rc_validate_scancode(enum rc_proto proto, u32 scancode);
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_cistatic inline void init_ir_raw_event_duration(struct ir_raw_event *ev,
2028c2ecf20Sopenharmony_ci					      unsigned int pulse,
2038c2ecf20Sopenharmony_ci					      u32 duration)
2048c2ecf20Sopenharmony_ci{
2058c2ecf20Sopenharmony_ci	*ev = (struct ir_raw_event) {
2068c2ecf20Sopenharmony_ci		.duration = duration,
2078c2ecf20Sopenharmony_ci		.pulse = pulse
2088c2ecf20Sopenharmony_ci	};
2098c2ecf20Sopenharmony_ci}
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci/**
2128c2ecf20Sopenharmony_ci * struct ir_raw_timings_manchester - Manchester coding timings
2138c2ecf20Sopenharmony_ci * @leader_pulse:	duration of leader pulse (if any) 0 if continuing
2148c2ecf20Sopenharmony_ci *			existing signal
2158c2ecf20Sopenharmony_ci * @leader_space:	duration of leader space (if any)
2168c2ecf20Sopenharmony_ci * @clock:		duration of each pulse/space in ns
2178c2ecf20Sopenharmony_ci * @invert:		if set clock logic is inverted
2188c2ecf20Sopenharmony_ci *			(0 = space + pulse, 1 = pulse + space)
2198c2ecf20Sopenharmony_ci * @trailer_space:	duration of trailer space in ns
2208c2ecf20Sopenharmony_ci */
2218c2ecf20Sopenharmony_cistruct ir_raw_timings_manchester {
2228c2ecf20Sopenharmony_ci	unsigned int leader_pulse;
2238c2ecf20Sopenharmony_ci	unsigned int leader_space;
2248c2ecf20Sopenharmony_ci	unsigned int clock;
2258c2ecf20Sopenharmony_ci	unsigned int invert:1;
2268c2ecf20Sopenharmony_ci	unsigned int trailer_space;
2278c2ecf20Sopenharmony_ci};
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ciint ir_raw_gen_manchester(struct ir_raw_event **ev, unsigned int max,
2308c2ecf20Sopenharmony_ci			  const struct ir_raw_timings_manchester *timings,
2318c2ecf20Sopenharmony_ci			  unsigned int n, u64 data);
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci/**
2348c2ecf20Sopenharmony_ci * ir_raw_gen_pulse_space() - generate pulse and space raw events.
2358c2ecf20Sopenharmony_ci * @ev:			Pointer to pointer to next free raw event.
2368c2ecf20Sopenharmony_ci *			Will be incremented for each raw event written.
2378c2ecf20Sopenharmony_ci * @max:		Pointer to number of raw events available in buffer.
2388c2ecf20Sopenharmony_ci *			Will be decremented for each raw event written.
2398c2ecf20Sopenharmony_ci * @pulse_width:	Width of pulse in ns.
2408c2ecf20Sopenharmony_ci * @space_width:	Width of space in ns.
2418c2ecf20Sopenharmony_ci *
2428c2ecf20Sopenharmony_ci * Returns:	0 on success.
2438c2ecf20Sopenharmony_ci *		-ENOBUFS if there isn't enough buffer space to write both raw
2448c2ecf20Sopenharmony_ci *		events. In this case @max events will have been written.
2458c2ecf20Sopenharmony_ci */
2468c2ecf20Sopenharmony_cistatic inline int ir_raw_gen_pulse_space(struct ir_raw_event **ev,
2478c2ecf20Sopenharmony_ci					 unsigned int *max,
2488c2ecf20Sopenharmony_ci					 unsigned int pulse_width,
2498c2ecf20Sopenharmony_ci					 unsigned int space_width)
2508c2ecf20Sopenharmony_ci{
2518c2ecf20Sopenharmony_ci	if (!*max)
2528c2ecf20Sopenharmony_ci		return -ENOBUFS;
2538c2ecf20Sopenharmony_ci	init_ir_raw_event_duration((*ev)++, 1, pulse_width);
2548c2ecf20Sopenharmony_ci	if (!--*max)
2558c2ecf20Sopenharmony_ci		return -ENOBUFS;
2568c2ecf20Sopenharmony_ci	init_ir_raw_event_duration((*ev)++, 0, space_width);
2578c2ecf20Sopenharmony_ci	--*max;
2588c2ecf20Sopenharmony_ci	return 0;
2598c2ecf20Sopenharmony_ci}
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_ci/**
2628c2ecf20Sopenharmony_ci * struct ir_raw_timings_pd - pulse-distance modulation timings
2638c2ecf20Sopenharmony_ci * @header_pulse:	duration of header pulse in ns (0 for none)
2648c2ecf20Sopenharmony_ci * @header_space:	duration of header space in ns
2658c2ecf20Sopenharmony_ci * @bit_pulse:		duration of bit pulse in ns
2668c2ecf20Sopenharmony_ci * @bit_space:		duration of bit space (for logic 0 and 1) in ns
2678c2ecf20Sopenharmony_ci * @trailer_pulse:	duration of trailer pulse in ns
2688c2ecf20Sopenharmony_ci * @trailer_space:	duration of trailer space in ns
2698c2ecf20Sopenharmony_ci * @msb_first:		1 if most significant bit is sent first
2708c2ecf20Sopenharmony_ci */
2718c2ecf20Sopenharmony_cistruct ir_raw_timings_pd {
2728c2ecf20Sopenharmony_ci	unsigned int header_pulse;
2738c2ecf20Sopenharmony_ci	unsigned int header_space;
2748c2ecf20Sopenharmony_ci	unsigned int bit_pulse;
2758c2ecf20Sopenharmony_ci	unsigned int bit_space[2];
2768c2ecf20Sopenharmony_ci	unsigned int trailer_pulse;
2778c2ecf20Sopenharmony_ci	unsigned int trailer_space;
2788c2ecf20Sopenharmony_ci	unsigned int msb_first:1;
2798c2ecf20Sopenharmony_ci};
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ciint ir_raw_gen_pd(struct ir_raw_event **ev, unsigned int max,
2828c2ecf20Sopenharmony_ci		  const struct ir_raw_timings_pd *timings,
2838c2ecf20Sopenharmony_ci		  unsigned int n, u64 data);
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci/**
2868c2ecf20Sopenharmony_ci * struct ir_raw_timings_pl - pulse-length modulation timings
2878c2ecf20Sopenharmony_ci * @header_pulse:	duration of header pulse in ns (0 for none)
2888c2ecf20Sopenharmony_ci * @bit_space:		duration of bit space in ns
2898c2ecf20Sopenharmony_ci * @bit_pulse:		duration of bit pulse (for logic 0 and 1) in ns
2908c2ecf20Sopenharmony_ci * @trailer_space:	duration of trailer space in ns
2918c2ecf20Sopenharmony_ci * @msb_first:		1 if most significant bit is sent first
2928c2ecf20Sopenharmony_ci */
2938c2ecf20Sopenharmony_cistruct ir_raw_timings_pl {
2948c2ecf20Sopenharmony_ci	unsigned int header_pulse;
2958c2ecf20Sopenharmony_ci	unsigned int bit_space;
2968c2ecf20Sopenharmony_ci	unsigned int bit_pulse[2];
2978c2ecf20Sopenharmony_ci	unsigned int trailer_space;
2988c2ecf20Sopenharmony_ci	unsigned int msb_first:1;
2998c2ecf20Sopenharmony_ci};
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ciint ir_raw_gen_pl(struct ir_raw_event **ev, unsigned int max,
3028c2ecf20Sopenharmony_ci		  const struct ir_raw_timings_pl *timings,
3038c2ecf20Sopenharmony_ci		  unsigned int n, u64 data);
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci/*
3068c2ecf20Sopenharmony_ci * Routines from rc-raw.c to be used internally and by decoders
3078c2ecf20Sopenharmony_ci */
3088c2ecf20Sopenharmony_ciu64 ir_raw_get_allowed_protocols(void);
3098c2ecf20Sopenharmony_ciint ir_raw_event_prepare(struct rc_dev *dev);
3108c2ecf20Sopenharmony_ciint ir_raw_event_register(struct rc_dev *dev);
3118c2ecf20Sopenharmony_civoid ir_raw_event_free(struct rc_dev *dev);
3128c2ecf20Sopenharmony_civoid ir_raw_event_unregister(struct rc_dev *dev);
3138c2ecf20Sopenharmony_ciint ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler);
3148c2ecf20Sopenharmony_civoid ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler);
3158c2ecf20Sopenharmony_civoid ir_raw_load_modules(u64 *protocols);
3168c2ecf20Sopenharmony_civoid ir_raw_init(void);
3178c2ecf20Sopenharmony_ci
3188c2ecf20Sopenharmony_ci/*
3198c2ecf20Sopenharmony_ci * lirc interface
3208c2ecf20Sopenharmony_ci */
3218c2ecf20Sopenharmony_ci#ifdef CONFIG_LIRC
3228c2ecf20Sopenharmony_ciint lirc_dev_init(void);
3238c2ecf20Sopenharmony_civoid lirc_dev_exit(void);
3248c2ecf20Sopenharmony_civoid lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev);
3258c2ecf20Sopenharmony_civoid lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc);
3268c2ecf20Sopenharmony_ciint lirc_register(struct rc_dev *dev);
3278c2ecf20Sopenharmony_civoid lirc_unregister(struct rc_dev *dev);
3288c2ecf20Sopenharmony_cistruct rc_dev *rc_dev_get_from_fd(int fd, bool write);
3298c2ecf20Sopenharmony_ci#else
3308c2ecf20Sopenharmony_cistatic inline int lirc_dev_init(void) { return 0; }
3318c2ecf20Sopenharmony_cistatic inline void lirc_dev_exit(void) {}
3328c2ecf20Sopenharmony_cistatic inline void lirc_raw_event(struct rc_dev *dev,
3338c2ecf20Sopenharmony_ci				  struct ir_raw_event ev) { }
3348c2ecf20Sopenharmony_cistatic inline void lirc_scancode_event(struct rc_dev *dev,
3358c2ecf20Sopenharmony_ci				       struct lirc_scancode *lsc) { }
3368c2ecf20Sopenharmony_cistatic inline int lirc_register(struct rc_dev *dev) { return 0; }
3378c2ecf20Sopenharmony_cistatic inline void lirc_unregister(struct rc_dev *dev) { }
3388c2ecf20Sopenharmony_ci#endif
3398c2ecf20Sopenharmony_ci
3408c2ecf20Sopenharmony_ci/*
3418c2ecf20Sopenharmony_ci * bpf interface
3428c2ecf20Sopenharmony_ci */
3438c2ecf20Sopenharmony_ci#ifdef CONFIG_BPF_LIRC_MODE2
3448c2ecf20Sopenharmony_civoid lirc_bpf_free(struct rc_dev *dev);
3458c2ecf20Sopenharmony_civoid lirc_bpf_run(struct rc_dev *dev, u32 sample);
3468c2ecf20Sopenharmony_ci#else
3478c2ecf20Sopenharmony_cistatic inline void lirc_bpf_free(struct rc_dev *dev) { }
3488c2ecf20Sopenharmony_cistatic inline void lirc_bpf_run(struct rc_dev *dev, u32 sample) { }
3498c2ecf20Sopenharmony_ci#endif
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ci#endif /* _RC_CORE_PRIV */
352