aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2010-10-29 15:08:12 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 05:16:36 -0500
commit3ffea4988be3f3fa65f2104ba31eff2b5e0e82a0 (patch)
tree615e94196988cf5c37eeb80953d98fa4d9b91527 /include/media
parent62c6503125389763a74911408d984c5dd09eeb97 (diff)
[media] ir-core: more cleanups of ir-functions.c
cx88 only depends on VIDEO_IR because it needs ir_extract_bits(). Move that function to ir-core.h and make it inline. Lots of drivers had dependencies on VIDEO_IR when they really wanted IR_CORE. The only remaining drivers to depend on VIDEO_IR are bt8xx and saa7134 (ir_rc5_timer_end is the only function exported by ir-functions). Rename VIDEO_IR -> IR_LEGACY to give a hint to anyone writing or converting drivers to IR_CORE that they do not want a dependency on IR_LEGACY. Signed-off-by: David Härdeman <david@hardeman.nu> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/ir-common.h1
-rw-r--r--include/media/ir-core.h19
2 files changed, 19 insertions, 1 deletions
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 4a32e89a3cf..d1ae869f962 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -73,7 +73,6 @@ struct card_ir {
73}; 73};
74 74
75/* Routines from ir-functions.c */ 75/* Routines from ir-functions.c */
76u32 ir_extract_bits(u32 data, u32 mask);
77void ir_rc5_timer_end(unsigned long data); 76void ir_rc5_timer_end(unsigned long data);
78 77
79#endif 78#endif
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
index bff75f258fb..53048a2eefb 100644
--- a/include/media/ir-core.h
+++ b/include/media/ir-core.h
@@ -212,4 +212,23 @@ static inline void ir_raw_event_reset(struct input_dev *input_dev)
212 ir_raw_event_handle(input_dev); 212 ir_raw_event_handle(input_dev);
213} 213}
214 214
215
216/* extract mask bits out of data and pack them into the result */
217static inline u32 ir_extract_bits(u32 data, u32 mask)
218{
219 u32 vbit = 1, value = 0;
220
221 do {
222 if (mask & 1) {
223 if (data & 1)
224 value |= vbit;
225 vbit <<= 1;
226 }
227 data >>= 1;
228 } while (mask >>= 1);
229
230 return value;
231}
232
233
215#endif /* _IR_CORE */ 234#endif /* _IR_CORE */