aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2010-10-29 16:08:12 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 08:16:36 -0200
commit3ffea4988be3f3fa65f2104ba31eff2b5e0e82a0 (patch)
tree615e94196988cf5c37eeb80953d98fa4d9b91527 /include/media
parent[media] ir-core: remove remaining users of the ir-functions keyhandlers (diff)
downloadlinux-dev-3ffea4988be3f3fa65f2104ba31eff2b5e0e82a0.tar.xz
linux-dev-3ffea4988be3f3fa65f2104ba31eff2b5e0e82a0.zip
[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 4a32e89a3cfe..d1ae869f962c 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -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
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
index bff75f258fbc..53048a2eefb9 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)
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 */