aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/ir-core.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-12-11 06:34:07 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:18:42 -0500
commit446e4a64d2f6efddc63a47169ba3c8037b620307 (patch)
tree3b14d76f7e93d5b35de50edf85a9179f759adb3d /include/media/ir-core.h
parente27d38112eb727df189a9ebf560aa104cb102253 (diff)
V4L/DVB (13613): IR: create ir-core module
Split the ir-common into two separate modules: - ir-core: it is the IR-independent functions; - ir-common: has the common part used by V4L drivers. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/ir-core.h')
-rw-r--r--include/media/ir-core.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
new file mode 100644
index 000000000000..825d04a4e77b
--- /dev/null
+++ b/include/media/ir-core.h
@@ -0,0 +1,57 @@
1/*
2 * Remote Controller core header
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _IR_CORE
15#define _IR_CORE
16
17#include <linux/input.h>
18#include <linux/spinlock.h>
19
20extern int ir_core_debug;
21#define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \
22 printk(KERN_DEBUG "%s: " fmt , __func__, ## arg)
23
24enum ir_type {
25 IR_TYPE_UNKNOWN = 0,
26 IR_TYPE_RC5 = 1,
27 IR_TYPE_PD = 2, /* Pulse distance encoded IR */
28 IR_TYPE_NEC = 3,
29 IR_TYPE_OTHER = 99,
30};
31
32struct ir_scancode {
33 u16 scancode;
34 u32 keycode;
35};
36
37struct ir_scancode_table {
38 struct ir_scancode *scan;
39 int size;
40 enum ir_type ir_type;
41 spinlock_t lock;
42};
43
44/* Routines from ir-keytable.c */
45
46u32 ir_g_keycode_from_table(struct input_dev *input_dev,
47 u32 scancode);
48
49int ir_set_keycode_table(struct input_dev *input_dev,
50 struct ir_scancode_table *rc_tab);
51
52int ir_roundup_tablesize(int n_elems);
53int ir_copy_table(struct ir_scancode_table *destin,
54 const struct ir_scancode_table *origin);
55void ir_input_free(struct input_dev *input_dev);
56
57#endif