Merge branch 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[safe/jmp/linux-2.6] / include / media / ir-common.h
index 29f0e53..c662980 100644 (file)
 #include <linux/input.h>
 #include <linux/workqueue.h>
 #include <linux/interrupt.h>
-
-#define IR_TYPE_RC5     1
-#define IR_TYPE_PD      2 /* Pulse distance encoded IR */
-#define IR_TYPE_OTHER  99
-
-#define IR_KEYTAB_TYPE u32
-#define IR_KEYTAB_SIZE 128  /* enougth for rc5, probably need more some day */
-
-struct ir_scancode {
-       u16     scancode;
-       u32     keycode;
-};
-
-struct ir_scancode_table {
-       struct ir_scancode *scan;
-       int size;
-};
-
-#define IR_KEYCODE(tab,code)   (((unsigned)code < IR_KEYTAB_SIZE) \
-                                ? tab[code] : KEY_RESERVED)
+#include <media/ir-core.h>
 
 #define RC5_START(x)   (((x)>>12)&3)
 #define RC5_TOGGLE(x)  (((x)>>11)&1)
@@ -54,12 +35,10 @@ struct ir_scancode_table {
 
 struct ir_input_state {
        /* configuration */
-       int                ir_type;
-       IR_KEYTAB_TYPE     ir_codes[IR_KEYTAB_SIZE];
+       u64      ir_type;
 
        /* key info */
-       u32                ir_raw;      /* raw data */
-       u32                ir_key;      /* ir key code */
+       u32                ir_key;      /* ir scancode */
        u32                keycode;     /* linux key code */
        int                keypressed;  /* current state */
 };
@@ -102,20 +81,23 @@ struct card_ir {
        struct tasklet_struct   tlet;
 };
 
-void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
-                  int ir_type, struct ir_scancode_table *ir_codes);
+/* Routines from ir-functions.c */
+
+int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
+                  const u64 ir_type);
 void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir);
 void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
-                     u32 ir_key, u32 ir_raw);
+                     u32 ir_key);
 u32  ir_extract_bits(u32 data, u32 mask);
 int  ir_dump_samples(u32 *samples, int count);
 int  ir_decode_biphase(u32 *samples, int count, int low, int high);
 int  ir_decode_pulsedistance(u32 *samples, int count, int low, int high);
+u32  ir_rc5_decode(unsigned int code);
 
 void ir_rc5_timer_end(unsigned long data);
 void ir_rc5_timer_keyup(unsigned long data);
 
-/* Keymaps to be used by other modules */
+/* scancode->keycode map tables from ir-keymaps.c */
 
 extern struct ir_scancode_table ir_codes_empty_table;
 extern struct ir_scancode_table ir_codes_avermedia_table;
@@ -150,6 +132,7 @@ extern struct ir_scancode_table ir_codes_rc5_tv_table;
 extern struct ir_scancode_table ir_codes_winfast_table;
 extern struct ir_scancode_table ir_codes_pinnacle_color_table;
 extern struct ir_scancode_table ir_codes_hauppauge_new_table;
+extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table;
 extern struct ir_scancode_table ir_codes_npgtech_table;
 extern struct ir_scancode_table ir_codes_norwood_table;
 extern struct ir_scancode_table ir_codes_proteus_2309_table;
@@ -172,8 +155,13 @@ extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table;
 extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table;
 extern struct ir_scancode_table ir_codes_kaiomy_table;
 extern struct ir_scancode_table ir_codes_dm1105_nec_table;
+extern struct ir_scancode_table ir_codes_tevii_nec_table;
+extern struct ir_scancode_table ir_codes_tbs_nec_table;
 extern struct ir_scancode_table ir_codes_evga_indtube_table;
 extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table;
 extern struct ir_scancode_table ir_codes_videomate_s350_table;
 extern struct ir_scancode_table ir_codes_gadmei_rm008z_table;
+extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table;
+extern struct ir_scancode_table ir_codes_winfast_usbii_deluxe_table;
+extern struct ir_scancode_table ir_codes_kworld_315u_table;
 #endif