diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-04-04 11:38:57 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:56:58 -0400 |
commit | 4f9256b496677adf799342cee7d406dd46e566d9 (patch) | |
tree | f54b3c2ed3c5041f1110059bf86c0ba547a7a50d /include/media | |
parent | 587835a4b0ada7d78c4f3300e3ab26b7b2495705 (diff) |
V4L/DVB: ir-core: move rc map code to rc-map.h
The keymaps don't need to be recompiled every time a change at ir-core.h
happens, since it only depends on rc-map defines. By moving those
definitions to the proper header, the code became cleaner, and avoids
needing to recompile all the RC maps every time a non-related change
is introduced.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/ir-core.h | 34 | ||||
-rw-r--r-- | include/media/rc-map.h | 37 |
2 files changed, 36 insertions, 35 deletions
diff --git a/include/media/ir-core.h b/include/media/ir-core.h index 1c1e8d9bd10a..0f64b48ecd90 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #ifndef _IR_CORE | 16 | #ifndef _IR_CORE |
17 | #define _IR_CORE | 17 | #define _IR_CORE |
18 | 18 | ||
19 | #include <linux/input.h> | ||
20 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
21 | #include <linux/kfifo.h> | 20 | #include <linux/kfifo.h> |
22 | #include <linux/time.h> | 21 | #include <linux/time.h> |
@@ -27,12 +26,6 @@ extern int ir_core_debug; | |||
27 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | 26 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ |
28 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | 27 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) |
29 | 28 | ||
30 | #define IR_TYPE_UNKNOWN 0 | ||
31 | #define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ | ||
32 | #define IR_TYPE_PD (1 << 1) /* Pulse distance encoded IR */ | ||
33 | #define IR_TYPE_NEC (1 << 2) | ||
34 | #define IR_TYPE_OTHER (((u64)1) << 63l) | ||
35 | |||
36 | enum raw_event_type { | 29 | enum raw_event_type { |
37 | IR_SPACE = (1 << 0), | 30 | IR_SPACE = (1 << 0), |
38 | IR_PULSE = (1 << 1), | 31 | IR_PULSE = (1 << 1), |
@@ -40,26 +33,6 @@ enum raw_event_type { | |||
40 | IR_STOP_EVENT = (1 << 3), | 33 | IR_STOP_EVENT = (1 << 3), |
41 | }; | 34 | }; |
42 | 35 | ||
43 | struct ir_scancode { | ||
44 | u16 scancode; | ||
45 | u32 keycode; | ||
46 | }; | ||
47 | |||
48 | struct ir_scancode_table { | ||
49 | struct ir_scancode *scan; | ||
50 | unsigned int size; /* Max number of entries */ | ||
51 | unsigned int len; /* Used number of entries */ | ||
52 | unsigned int alloc; /* Size of *scan in bytes */ | ||
53 | u64 ir_type; | ||
54 | char *name; | ||
55 | spinlock_t lock; | ||
56 | }; | ||
57 | |||
58 | struct rc_keymap { | ||
59 | struct list_head list; | ||
60 | struct ir_scancode_table map; | ||
61 | }; | ||
62 | |||
63 | struct ir_dev_props { | 36 | struct ir_dev_props { |
64 | unsigned long allowed_protos; | 37 | unsigned long allowed_protos; |
65 | void *priv; | 38 | void *priv; |
@@ -108,13 +81,6 @@ struct ir_raw_handler { | |||
108 | 81 | ||
109 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) | 82 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) |
110 | 83 | ||
111 | /* Routines from rc-map.c */ | ||
112 | |||
113 | int ir_register_map(struct rc_keymap *map); | ||
114 | void ir_unregister_map(struct rc_keymap *map); | ||
115 | struct ir_scancode_table *get_rc_map(const char *name); | ||
116 | void rc_map_init(void); | ||
117 | |||
118 | /* Routines from ir-keytable.c */ | 84 | /* Routines from ir-keytable.c */ |
119 | 85 | ||
120 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, | 86 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 9ea0033fa3cc..b10990d1749d 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -9,7 +9,42 @@ | |||
9 | * (at your option) any later version. | 9 | * (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <media/ir-core.h> | 12 | #include <linux/input.h> |
13 | |||
14 | #define IR_TYPE_UNKNOWN 0 | ||
15 | #define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ | ||
16 | #define IR_TYPE_PD (1 << 1) /* Pulse distance encoded IR */ | ||
17 | #define IR_TYPE_NEC (1 << 2) | ||
18 | #define IR_TYPE_OTHER (1u << 31) | ||
19 | |||
20 | struct ir_scancode { | ||
21 | u16 scancode; | ||
22 | u32 keycode; | ||
23 | }; | ||
24 | |||
25 | struct ir_scancode_table { | ||
26 | struct ir_scancode *scan; | ||
27 | unsigned int size; /* Max number of entries */ | ||
28 | unsigned int len; /* Used number of entries */ | ||
29 | unsigned int alloc; /* Size of *scan in bytes */ | ||
30 | u64 ir_type; | ||
31 | char *name; | ||
32 | spinlock_t lock; | ||
33 | }; | ||
34 | |||
35 | struct rc_keymap { | ||
36 | struct list_head list; | ||
37 | struct ir_scancode_table map; | ||
38 | }; | ||
39 | |||
40 | /* Routines from rc-map.c */ | ||
41 | |||
42 | int ir_register_map(struct rc_keymap *map); | ||
43 | void ir_unregister_map(struct rc_keymap *map); | ||
44 | struct ir_scancode_table *get_rc_map(const char *name); | ||
45 | void rc_map_init(void); | ||
46 | |||
47 | /* Names of the several keytables defined in-kernel */ | ||
13 | 48 | ||
14 | #define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci" | 49 | #define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci" |
15 | #define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" | 50 | #define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" |