diff options
Diffstat (limited to 'include/media/ir-common.h')
-rw-r--r-- | include/media/ir-common.h | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 29f0e53cff94..2c6af24b905e 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -26,26 +26,7 @@ | |||
26 | #include <linux/input.h> | 26 | #include <linux/input.h> |
27 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | 29 | #include <media/ir-core.h> | |
30 | #define IR_TYPE_RC5 1 | ||
31 | #define IR_TYPE_PD 2 /* Pulse distance encoded IR */ | ||
32 | #define IR_TYPE_OTHER 99 | ||
33 | |||
34 | #define IR_KEYTAB_TYPE u32 | ||
35 | #define IR_KEYTAB_SIZE 128 /* enougth for rc5, probably need more some day */ | ||
36 | |||
37 | struct ir_scancode { | ||
38 | u16 scancode; | ||
39 | u32 keycode; | ||
40 | }; | ||
41 | |||
42 | struct ir_scancode_table { | ||
43 | struct ir_scancode *scan; | ||
44 | int size; | ||
45 | }; | ||
46 | |||
47 | #define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \ | ||
48 | ? tab[code] : KEY_RESERVED) | ||
49 | 30 | ||
50 | #define RC5_START(x) (((x)>>12)&3) | 31 | #define RC5_START(x) (((x)>>12)&3) |
51 | #define RC5_TOGGLE(x) (((x)>>11)&1) | 32 | #define RC5_TOGGLE(x) (((x)>>11)&1) |
@@ -55,11 +36,9 @@ struct ir_scancode_table { | |||
55 | struct ir_input_state { | 36 | struct ir_input_state { |
56 | /* configuration */ | 37 | /* configuration */ |
57 | int ir_type; | 38 | int ir_type; |
58 | IR_KEYTAB_TYPE ir_codes[IR_KEYTAB_SIZE]; | ||
59 | 39 | ||
60 | /* key info */ | 40 | /* key info */ |
61 | u32 ir_raw; /* raw data */ | 41 | u32 ir_key; /* ir scancode */ |
62 | u32 ir_key; /* ir key code */ | ||
63 | u32 keycode; /* linux key code */ | 42 | u32 keycode; /* linux key code */ |
64 | int keypressed; /* current state */ | 43 | int keypressed; /* current state */ |
65 | }; | 44 | }; |
@@ -102,20 +81,23 @@ struct card_ir { | |||
102 | struct tasklet_struct tlet; | 81 | struct tasklet_struct tlet; |
103 | }; | 82 | }; |
104 | 83 | ||
105 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 84 | /* Routines from ir-functions.c */ |
106 | int ir_type, struct ir_scancode_table *ir_codes); | 85 | |
86 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | ||
87 | int ir_type); | ||
107 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | 88 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); |
108 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | 89 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, |
109 | u32 ir_key, u32 ir_raw); | 90 | u32 ir_key); |
110 | u32 ir_extract_bits(u32 data, u32 mask); | 91 | u32 ir_extract_bits(u32 data, u32 mask); |
111 | int ir_dump_samples(u32 *samples, int count); | 92 | int ir_dump_samples(u32 *samples, int count); |
112 | int ir_decode_biphase(u32 *samples, int count, int low, int high); | 93 | int ir_decode_biphase(u32 *samples, int count, int low, int high); |
113 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); | 94 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); |
95 | u32 ir_rc5_decode(unsigned int code); | ||
114 | 96 | ||
115 | void ir_rc5_timer_end(unsigned long data); | 97 | void ir_rc5_timer_end(unsigned long data); |
116 | void ir_rc5_timer_keyup(unsigned long data); | 98 | void ir_rc5_timer_keyup(unsigned long data); |
117 | 99 | ||
118 | /* Keymaps to be used by other modules */ | 100 | /* scancode->keycode map tables from ir-keymaps.c */ |
119 | 101 | ||
120 | extern struct ir_scancode_table ir_codes_empty_table; | 102 | extern struct ir_scancode_table ir_codes_empty_table; |
121 | extern struct ir_scancode_table ir_codes_avermedia_table; | 103 | extern struct ir_scancode_table ir_codes_avermedia_table; |
@@ -150,6 +132,7 @@ extern struct ir_scancode_table ir_codes_rc5_tv_table; | |||
150 | extern struct ir_scancode_table ir_codes_winfast_table; | 132 | extern struct ir_scancode_table ir_codes_winfast_table; |
151 | extern struct ir_scancode_table ir_codes_pinnacle_color_table; | 133 | extern struct ir_scancode_table ir_codes_pinnacle_color_table; |
152 | extern struct ir_scancode_table ir_codes_hauppauge_new_table; | 134 | extern struct ir_scancode_table ir_codes_hauppauge_new_table; |
135 | extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table; | ||
153 | extern struct ir_scancode_table ir_codes_npgtech_table; | 136 | extern struct ir_scancode_table ir_codes_npgtech_table; |
154 | extern struct ir_scancode_table ir_codes_norwood_table; | 137 | extern struct ir_scancode_table ir_codes_norwood_table; |
155 | extern struct ir_scancode_table ir_codes_proteus_2309_table; | 138 | extern struct ir_scancode_table ir_codes_proteus_2309_table; |
@@ -172,8 +155,11 @@ extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table; | |||
172 | extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; | 155 | extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; |
173 | extern struct ir_scancode_table ir_codes_kaiomy_table; | 156 | extern struct ir_scancode_table ir_codes_kaiomy_table; |
174 | extern struct ir_scancode_table ir_codes_dm1105_nec_table; | 157 | extern struct ir_scancode_table ir_codes_dm1105_nec_table; |
158 | extern struct ir_scancode_table ir_codes_tevii_nec_table; | ||
159 | extern struct ir_scancode_table ir_codes_tbs_nec_table; | ||
175 | extern struct ir_scancode_table ir_codes_evga_indtube_table; | 160 | extern struct ir_scancode_table ir_codes_evga_indtube_table; |
176 | extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; | 161 | extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; |
177 | extern struct ir_scancode_table ir_codes_videomate_s350_table; | 162 | extern struct ir_scancode_table ir_codes_videomate_s350_table; |
178 | extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; | 163 | extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; |
164 | extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table; | ||
179 | #endif | 165 | #endif |