mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
[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 <[email protected]> Acked-by: Jarod Wilson <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
62c6503125
commit
3ffea4988b
19 changed files with 40 additions and 47 deletions
|
|
@ -73,7 +73,6 @@ struct card_ir {
|
|||
};
|
||||
|
||||
/* Routines from ir-functions.c */
|
||||
u32 ir_extract_bits(u32 data, u32 mask);
|
||||
void ir_rc5_timer_end(unsigned long data);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -212,4 +212,23 @@ static inline void ir_raw_event_reset(struct input_dev *input_dev)
|
|||
ir_raw_event_handle(input_dev);
|
||||
}
|
||||
|
||||
|
||||
/* extract mask bits out of data and pack them into the result */
|
||||
static inline u32 ir_extract_bits(u32 data, u32 mask)
|
||||
{
|
||||
u32 vbit = 1, value = 0;
|
||||
|
||||
do {
|
||||
if (mask & 1) {
|
||||
if (data & 1)
|
||||
value |= vbit;
|
||||
vbit <<= 1;
|
||||
}
|
||||
data >>= 1;
|
||||
} while (mask >>= 1);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
#endif /* _IR_CORE */
|
||||
|
|
|
|||
Loading…
Reference in a new issue