.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
1 | 2 | /* |
---|
2 | | - * SPDX-License-Identifier: GPL-2.0 |
---|
3 | 3 | * Remote Controller core raw events header |
---|
4 | 4 | * |
---|
5 | 5 | * Copyright (C) 2010 by Mauro Carvalho Chehab |
---|
.. | .. |
---|
64 | 64 | u32 bpf_sample; |
---|
65 | 65 | struct bpf_prog_array __rcu *progs; |
---|
66 | 66 | #endif |
---|
| 67 | +#if IS_ENABLED(CONFIG_IR_NEC_DECODER) |
---|
67 | 68 | struct nec_dec { |
---|
68 | 69 | int state; |
---|
69 | 70 | unsigned count; |
---|
.. | .. |
---|
71 | 72 | bool is_nec_x; |
---|
72 | 73 | bool necx_repeat; |
---|
73 | 74 | } nec; |
---|
| 75 | +#endif |
---|
| 76 | +#if IS_ENABLED(CONFIG_IR_RC5_DECODER) |
---|
74 | 77 | struct rc5_dec { |
---|
75 | 78 | int state; |
---|
76 | 79 | u32 bits; |
---|
77 | 80 | unsigned count; |
---|
78 | 81 | bool is_rc5x; |
---|
79 | 82 | } rc5; |
---|
| 83 | +#endif |
---|
| 84 | +#if IS_ENABLED(CONFIG_IR_RC6_DECODER) |
---|
80 | 85 | struct rc6_dec { |
---|
81 | 86 | int state; |
---|
82 | 87 | u8 header; |
---|
.. | .. |
---|
85 | 90 | unsigned count; |
---|
86 | 91 | unsigned wanted_bits; |
---|
87 | 92 | } rc6; |
---|
| 93 | +#endif |
---|
| 94 | +#if IS_ENABLED(CONFIG_IR_SONY_DECODER) |
---|
88 | 95 | struct sony_dec { |
---|
89 | 96 | int state; |
---|
90 | 97 | u32 bits; |
---|
91 | 98 | unsigned count; |
---|
92 | 99 | } sony; |
---|
| 100 | +#endif |
---|
| 101 | +#if IS_ENABLED(CONFIG_IR_JVC_DECODER) |
---|
93 | 102 | struct jvc_dec { |
---|
94 | 103 | int state; |
---|
95 | 104 | u16 bits; |
---|
.. | .. |
---|
98 | 107 | bool first; |
---|
99 | 108 | bool toggle; |
---|
100 | 109 | } jvc; |
---|
| 110 | +#endif |
---|
| 111 | +#if IS_ENABLED(CONFIG_IR_SANYO_DECODER) |
---|
101 | 112 | struct sanyo_dec { |
---|
102 | 113 | int state; |
---|
103 | 114 | unsigned count; |
---|
104 | 115 | u64 bits; |
---|
105 | 116 | } sanyo; |
---|
| 117 | +#endif |
---|
| 118 | +#if IS_ENABLED(CONFIG_IR_SHARP_DECODER) |
---|
106 | 119 | struct sharp_dec { |
---|
107 | 120 | int state; |
---|
108 | 121 | unsigned count; |
---|
109 | 122 | u32 bits; |
---|
110 | 123 | unsigned int pulse_len; |
---|
111 | 124 | } sharp; |
---|
| 125 | +#endif |
---|
| 126 | +#if IS_ENABLED(CONFIG_IR_MCE_KBD_DECODER) |
---|
112 | 127 | struct mce_kbd_dec { |
---|
113 | | - struct input_dev *idev; |
---|
114 | 128 | /* locks key up timer */ |
---|
115 | 129 | spinlock_t keylock; |
---|
116 | 130 | struct timer_list rx_timeout; |
---|
117 | | - char name[64]; |
---|
118 | | - char phys[64]; |
---|
119 | 131 | int state; |
---|
120 | 132 | u8 header; |
---|
121 | 133 | u32 body; |
---|
122 | 134 | unsigned count; |
---|
123 | 135 | unsigned wanted_bits; |
---|
124 | 136 | } mce_kbd; |
---|
| 137 | +#endif |
---|
| 138 | +#if IS_ENABLED(CONFIG_IR_XMP_DECODER) |
---|
125 | 139 | struct xmp_dec { |
---|
126 | 140 | int state; |
---|
127 | 141 | unsigned count; |
---|
128 | 142 | u32 durations[16]; |
---|
129 | 143 | } xmp; |
---|
| 144 | +#endif |
---|
| 145 | +#if IS_ENABLED(CONFIG_IR_IMON_DECODER) |
---|
130 | 146 | struct imon_dec { |
---|
131 | 147 | int state; |
---|
132 | 148 | int count; |
---|
133 | 149 | int last_chk; |
---|
134 | 150 | unsigned int bits; |
---|
135 | 151 | bool stick_keyboard; |
---|
136 | | - struct input_dev *idev; |
---|
137 | | - char name[64]; |
---|
138 | 152 | } imon; |
---|
| 153 | +#endif |
---|
| 154 | +#if IS_ENABLED(CONFIG_IR_RCMM_DECODER) |
---|
| 155 | + struct rcmm_dec { |
---|
| 156 | + int state; |
---|
| 157 | + unsigned int count; |
---|
| 158 | + u32 bits; |
---|
| 159 | + } rcmm; |
---|
| 160 | +#endif |
---|
139 | 161 | }; |
---|
140 | 162 | |
---|
141 | 163 | /* Mutex for locking raw IR processing and handler change */ |
---|
.. | .. |
---|
171 | 193 | return !ev.carrier_report && !ev.reset; |
---|
172 | 194 | } |
---|
173 | 195 | |
---|
174 | | -#define TO_US(duration) DIV_ROUND_CLOSEST((duration), 1000) |
---|
175 | 196 | #define TO_STR(is_pulse) ((is_pulse) ? "pulse" : "space") |
---|
176 | 197 | |
---|
177 | 198 | /* functions for IR encoders */ |
---|
.. | .. |
---|
181 | 202 | unsigned int pulse, |
---|
182 | 203 | u32 duration) |
---|
183 | 204 | { |
---|
184 | | - init_ir_raw_event(ev); |
---|
185 | | - ev->duration = duration; |
---|
186 | | - ev->pulse = pulse; |
---|
| 205 | + *ev = (struct ir_raw_event) { |
---|
| 206 | + .duration = duration, |
---|
| 207 | + .pulse = pulse |
---|
| 208 | + }; |
---|
187 | 209 | } |
---|
188 | 210 | |
---|
189 | 211 | /** |
---|
.. | .. |
---|
299 | 321 | #ifdef CONFIG_LIRC |
---|
300 | 322 | int lirc_dev_init(void); |
---|
301 | 323 | void lirc_dev_exit(void); |
---|
302 | | -void ir_lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev); |
---|
303 | | -void ir_lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc); |
---|
304 | | -int ir_lirc_register(struct rc_dev *dev); |
---|
305 | | -void ir_lirc_unregister(struct rc_dev *dev); |
---|
| 324 | +void lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev); |
---|
| 325 | +void lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc); |
---|
| 326 | +int lirc_register(struct rc_dev *dev); |
---|
| 327 | +void lirc_unregister(struct rc_dev *dev); |
---|
306 | 328 | struct rc_dev *rc_dev_get_from_fd(int fd); |
---|
307 | 329 | #else |
---|
308 | 330 | static inline int lirc_dev_init(void) { return 0; } |
---|
309 | 331 | static inline void lirc_dev_exit(void) {} |
---|
310 | | -static inline void ir_lirc_raw_event(struct rc_dev *dev, |
---|
311 | | - struct ir_raw_event ev) { } |
---|
312 | | -static inline void ir_lirc_scancode_event(struct rc_dev *dev, |
---|
313 | | - struct lirc_scancode *lsc) { } |
---|
314 | | -static inline int ir_lirc_register(struct rc_dev *dev) { return 0; } |
---|
315 | | -static inline void ir_lirc_unregister(struct rc_dev *dev) { } |
---|
| 332 | +static inline void lirc_raw_event(struct rc_dev *dev, |
---|
| 333 | + struct ir_raw_event ev) { } |
---|
| 334 | +static inline void lirc_scancode_event(struct rc_dev *dev, |
---|
| 335 | + struct lirc_scancode *lsc) { } |
---|
| 336 | +static inline int lirc_register(struct rc_dev *dev) { return 0; } |
---|
| 337 | +static inline void lirc_unregister(struct rc_dev *dev) { } |
---|
316 | 338 | #endif |
---|
317 | 339 | |
---|
318 | 340 | /* |
---|