Lines Matching +full:max +full:- +full:by +full:- +full:define
1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Copyright (C) 2010 by Mauro Carvalho Chehab
9 #define _RC_CORE_PRIV
11 #define RC_DEV_MAX 256
12 /* Define the max number of pulse/space transitions to buffer */
13 #define MAX_IR_EVENT_SIZE 512
17 #include <media/rc-core.h>
20 * rc_open - Opens a RC device
27 * rc_close - Closes a RC device
36 u64 protocols; /* which are handled by this handler */
39 struct ir_raw_event *events, unsigned int max);
43 /* These two should only be used by the mce kbd decoder */
169 return d1 > (d2 - margin); in geq_margin()
174 return ((d1 > (d2 - margin)) && (d1 < (d2 + margin))); in eq_margin()
179 return x->pulse != y->pulse; in is_transition()
184 if (duration > ev->duration) in decrease_duration()
185 ev->duration = 0; in decrease_duration()
187 ev->duration -= duration; in decrease_duration()
196 #define TO_STR(is_pulse) ((is_pulse) ? "pulse" : "space")
212 * struct ir_raw_timings_manchester - Manchester coding timings
229 int ir_raw_gen_manchester(struct ir_raw_event **ev, unsigned int max,
234 * ir_raw_gen_pulse_space() - generate pulse and space raw events.
237 * @max: Pointer to number of raw events available in buffer.
243 * -ENOBUFS if there isn't enough buffer space to write both raw
244 * events. In this case @max events will have been written.
247 unsigned int *max, in ir_raw_gen_pulse_space() argument
251 if (!*max) in ir_raw_gen_pulse_space()
252 return -ENOBUFS; in ir_raw_gen_pulse_space()
254 if (!--*max) in ir_raw_gen_pulse_space()
255 return -ENOBUFS; in ir_raw_gen_pulse_space()
257 --*max; in ir_raw_gen_pulse_space()
262 * struct ir_raw_timings_pd - pulse-distance modulation timings
281 int ir_raw_gen_pd(struct ir_raw_event **ev, unsigned int max,
286 * struct ir_raw_timings_pl - pulse-length modulation timings
301 int ir_raw_gen_pl(struct ir_raw_event **ev, unsigned int max,
306 * Routines from rc-raw.c to be used internally and by decoders