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