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.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 4bb0ad810179..9807a7c15830 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -36,6 +36,11 @@
36#define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \ 36#define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \
37 ? tab[code] : KEY_RESERVED) 37 ? tab[code] : KEY_RESERVED)
38 38
39#define RC5_START(x) (((x)>>12)&3)
40#define RC5_TOGGLE(x) (((x)>>11)&1)
41#define RC5_ADDR(x) (((x)>>6)&31)
42#define RC5_INSTR(x) ((x)&63)
43
39struct ir_input_state { 44struct ir_input_state {
40 /* configuration */ 45 /* configuration */
41 int ir_type; 46 int ir_type;
@@ -48,6 +53,40 @@ struct ir_input_state {
48 int keypressed; /* current state */ 53 int keypressed; /* current state */
49}; 54};
50 55
56/* this was saa7134_ir and bttv_ir, moved here for
57 * rc5 decoding. */
58struct card_ir {
59 struct input_dev *dev;
60 struct ir_input_state ir;
61 char name[32];
62 char phys[32];
63
64 /* Usual gpio signalling */
65
66 u32 mask_keycode;
67 u32 mask_keydown;
68 u32 mask_keyup;
69 u32 polling;
70 u32 last_gpio;
71 int shift_by;
72 int start; // What should RC5_START() be
73 int addr; // What RC5_ADDR() should be.
74 int rc5_key_timeout;
75 int rc5_remote_gap;
76 struct work_struct work;
77 struct timer_list timer;
78
79 /* RC5 gpio */
80 u32 rc5_gpio;
81 struct timer_list timer_end; /* timer_end for code completion */
82 struct timer_list timer_keyup; /* timer_end for key release */
83 u32 last_rc5; /* last good rc5 code */
84 u32 last_bit; /* last raw bit seen */
85 u32 code; /* raw code under construction */
86 struct timeval base_time; /* time of last seen code */
87 int active; /* building raw code */
88};
89
51void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, 90void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
52 int ir_type, IR_KEYTAB_TYPE *ir_codes); 91 int ir_type, IR_KEYTAB_TYPE *ir_codes);
53void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); 92void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir);
@@ -58,6 +97,10 @@ int ir_dump_samples(u32 *samples, int count);
58int ir_decode_biphase(u32 *samples, int count, int low, int high); 97int ir_decode_biphase(u32 *samples, int count, int low, int high);
59int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); 98int ir_decode_pulsedistance(u32 *samples, int count, int low, int high);
60 99
100u32 ir_rc5_decode(unsigned int code);
101void ir_rc5_timer_end(unsigned long data);
102void ir_rc5_timer_keyup(unsigned long data);
103
61/* Keymaps to be used by other modules */ 104/* Keymaps to be used by other modules */
62 105
63extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; 106extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE];
@@ -94,6 +137,9 @@ extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE];
94extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; 137extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE];
95extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; 138extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE];
96extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE]; 139extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE];
140extern IR_KEYTAB_TYPE ir_codes_asus_pc39[IR_KEYTAB_SIZE];
141extern IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE];
142extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE];
97 143
98#endif 144#endif
99 145