hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/media/rc/rc-core-priv.h
....@@ -1,5 +1,5 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
2
- * SPDX-License-Identifier: GPL-2.0
33 * Remote Controller core raw events header
44 *
55 * Copyright (C) 2010 by Mauro Carvalho Chehab
....@@ -64,6 +64,7 @@
6464 u32 bpf_sample;
6565 struct bpf_prog_array __rcu *progs;
6666 #endif
67
+#if IS_ENABLED(CONFIG_IR_NEC_DECODER)
6768 struct nec_dec {
6869 int state;
6970 unsigned count;
....@@ -71,12 +72,16 @@
7172 bool is_nec_x;
7273 bool necx_repeat;
7374 } nec;
75
+#endif
76
+#if IS_ENABLED(CONFIG_IR_RC5_DECODER)
7477 struct rc5_dec {
7578 int state;
7679 u32 bits;
7780 unsigned count;
7881 bool is_rc5x;
7982 } rc5;
83
+#endif
84
+#if IS_ENABLED(CONFIG_IR_RC6_DECODER)
8085 struct rc6_dec {
8186 int state;
8287 u8 header;
....@@ -85,11 +90,15 @@
8590 unsigned count;
8691 unsigned wanted_bits;
8792 } rc6;
93
+#endif
94
+#if IS_ENABLED(CONFIG_IR_SONY_DECODER)
8895 struct sony_dec {
8996 int state;
9097 u32 bits;
9198 unsigned count;
9299 } sony;
100
+#endif
101
+#if IS_ENABLED(CONFIG_IR_JVC_DECODER)
93102 struct jvc_dec {
94103 int state;
95104 u16 bits;
....@@ -98,44 +107,57 @@
98107 bool first;
99108 bool toggle;
100109 } jvc;
110
+#endif
111
+#if IS_ENABLED(CONFIG_IR_SANYO_DECODER)
101112 struct sanyo_dec {
102113 int state;
103114 unsigned count;
104115 u64 bits;
105116 } sanyo;
117
+#endif
118
+#if IS_ENABLED(CONFIG_IR_SHARP_DECODER)
106119 struct sharp_dec {
107120 int state;
108121 unsigned count;
109122 u32 bits;
110123 unsigned int pulse_len;
111124 } sharp;
125
+#endif
126
+#if IS_ENABLED(CONFIG_IR_MCE_KBD_DECODER)
112127 struct mce_kbd_dec {
113
- struct input_dev *idev;
114128 /* locks key up timer */
115129 spinlock_t keylock;
116130 struct timer_list rx_timeout;
117
- char name[64];
118
- char phys[64];
119131 int state;
120132 u8 header;
121133 u32 body;
122134 unsigned count;
123135 unsigned wanted_bits;
124136 } mce_kbd;
137
+#endif
138
+#if IS_ENABLED(CONFIG_IR_XMP_DECODER)
125139 struct xmp_dec {
126140 int state;
127141 unsigned count;
128142 u32 durations[16];
129143 } xmp;
144
+#endif
145
+#if IS_ENABLED(CONFIG_IR_IMON_DECODER)
130146 struct imon_dec {
131147 int state;
132148 int count;
133149 int last_chk;
134150 unsigned int bits;
135151 bool stick_keyboard;
136
- struct input_dev *idev;
137
- char name[64];
138152 } 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
139161 };
140162
141163 /* Mutex for locking raw IR processing and handler change */
....@@ -171,7 +193,6 @@
171193 return !ev.carrier_report && !ev.reset;
172194 }
173195
174
-#define TO_US(duration) DIV_ROUND_CLOSEST((duration), 1000)
175196 #define TO_STR(is_pulse) ((is_pulse) ? "pulse" : "space")
176197
177198 /* functions for IR encoders */
....@@ -181,9 +202,10 @@
181202 unsigned int pulse,
182203 u32 duration)
183204 {
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
+ };
187209 }
188210
189211 /**
....@@ -299,20 +321,20 @@
299321 #ifdef CONFIG_LIRC
300322 int lirc_dev_init(void);
301323 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);
306328 struct rc_dev *rc_dev_get_from_fd(int fd);
307329 #else
308330 static inline int lirc_dev_init(void) { return 0; }
309331 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) { }
316338 #endif
317339
318340 /*