aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/ir-common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/ir-common.h')
-rw-r--r--include/media/ir-common.h40
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
37struct ir_scancode {
38 u16 scancode;
39 u32 keycode;
40};
41
42struct 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 {
55struct ir_input_state { 36struct 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
105void 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
86int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
87 int ir_type);
107void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); 88void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir);
108void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, 89void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
109 u32 ir_key, u32 ir_raw); 90 u32 ir_key);
110u32 ir_extract_bits(u32 data, u32 mask); 91u32 ir_extract_bits(u32 data, u32 mask);
111int ir_dump_samples(u32 *samples, int count); 92int ir_dump_samples(u32 *samples, int count);
112int ir_decode_biphase(u32 *samples, int count, int low, int high); 93int ir_decode_biphase(u32 *samples, int count, int low, int high);
113int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); 94int ir_decode_pulsedistance(u32 *samples, int count, int low, int high);
95u32 ir_rc5_decode(unsigned int code);
114 96
115void ir_rc5_timer_end(unsigned long data); 97void ir_rc5_timer_end(unsigned long data);
116void ir_rc5_timer_keyup(unsigned long data); 98void 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
120extern struct ir_scancode_table ir_codes_empty_table; 102extern struct ir_scancode_table ir_codes_empty_table;
121extern struct ir_scancode_table ir_codes_avermedia_table; 103extern struct ir_scancode_table ir_codes_avermedia_table;
@@ -150,6 +132,7 @@ extern struct ir_scancode_table ir_codes_rc5_tv_table;
150extern struct ir_scancode_table ir_codes_winfast_table; 132extern struct ir_scancode_table ir_codes_winfast_table;
151extern struct ir_scancode_table ir_codes_pinnacle_color_table; 133extern struct ir_scancode_table ir_codes_pinnacle_color_table;
152extern struct ir_scancode_table ir_codes_hauppauge_new_table; 134extern struct ir_scancode_table ir_codes_hauppauge_new_table;
135extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table;
153extern struct ir_scancode_table ir_codes_npgtech_table; 136extern struct ir_scancode_table ir_codes_npgtech_table;
154extern struct ir_scancode_table ir_codes_norwood_table; 137extern struct ir_scancode_table ir_codes_norwood_table;
155extern struct ir_scancode_table ir_codes_proteus_2309_table; 138extern 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;
172extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; 155extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table;
173extern struct ir_scancode_table ir_codes_kaiomy_table; 156extern struct ir_scancode_table ir_codes_kaiomy_table;
174extern struct ir_scancode_table ir_codes_dm1105_nec_table; 157extern struct ir_scancode_table ir_codes_dm1105_nec_table;
158extern struct ir_scancode_table ir_codes_tevii_nec_table;
159extern struct ir_scancode_table ir_codes_tbs_nec_table;
175extern struct ir_scancode_table ir_codes_evga_indtube_table; 160extern struct ir_scancode_table ir_codes_evga_indtube_table;
176extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; 161extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table;
177extern struct ir_scancode_table ir_codes_videomate_s350_table; 162extern struct ir_scancode_table ir_codes_videomate_s350_table;
178extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; 163extern struct ir_scancode_table ir_codes_gadmei_rm008z_table;
164extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table;
179#endif 165#endif