Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v2.6.32-rc5 179 lines 7.3 kB view raw
1/* 2 * 3 * some common structs and functions to handle infrared remotes via 4 * input layer ... 5 * 6 * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 */ 22 23#ifndef _IR_COMMON 24#define _IR_COMMON 25 26#include <linux/input.h> 27#include <linux/workqueue.h> 28#include <linux/interrupt.h> 29 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 50#define RC5_START(x) (((x)>>12)&3) 51#define RC5_TOGGLE(x) (((x)>>11)&1) 52#define RC5_ADDR(x) (((x)>>6)&31) 53#define RC5_INSTR(x) ((x)&63) 54 55struct ir_input_state { 56 /* configuration */ 57 int ir_type; 58 IR_KEYTAB_TYPE ir_codes[IR_KEYTAB_SIZE]; 59 60 /* key info */ 61 u32 ir_raw; /* raw data */ 62 u32 ir_key; /* ir key code */ 63 u32 keycode; /* linux key code */ 64 int keypressed; /* current state */ 65}; 66 67/* this was saa7134_ir and bttv_ir, moved here for 68 * rc5 decoding. */ 69struct card_ir { 70 struct input_dev *dev; 71 struct ir_input_state ir; 72 char name[32]; 73 char phys[32]; 74 75 /* Usual gpio signalling */ 76 77 u32 mask_keycode; 78 u32 mask_keydown; 79 u32 mask_keyup; 80 u32 polling; 81 u32 last_gpio; 82 int shift_by; 83 int start; // What should RC5_START() be 84 int addr; // What RC5_ADDR() should be. 85 int rc5_key_timeout; 86 int rc5_remote_gap; 87 struct work_struct work; 88 struct timer_list timer; 89 90 /* RC5 gpio */ 91 u32 rc5_gpio; 92 struct timer_list timer_end; /* timer_end for code completion */ 93 struct timer_list timer_keyup; /* timer_end for key release */ 94 u32 last_rc5; /* last good rc5 code */ 95 u32 last_bit; /* last raw bit seen */ 96 u32 code; /* raw code under construction */ 97 struct timeval base_time; /* time of last seen code */ 98 int active; /* building raw code */ 99 100 /* NEC decoding */ 101 u32 nec_gpio; 102 struct tasklet_struct tlet; 103}; 104 105void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, 106 int ir_type, struct ir_scancode_table *ir_codes); 107void 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, 109 u32 ir_key, u32 ir_raw); 110u32 ir_extract_bits(u32 data, u32 mask); 111int ir_dump_samples(u32 *samples, int count); 112int ir_decode_biphase(u32 *samples, int count, int low, int high); 113int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); 114 115void ir_rc5_timer_end(unsigned long data); 116void ir_rc5_timer_keyup(unsigned long data); 117 118/* Keymaps to be used by other modules */ 119 120extern struct ir_scancode_table ir_codes_empty_table; 121extern struct ir_scancode_table ir_codes_avermedia_table; 122extern struct ir_scancode_table ir_codes_avermedia_dvbt_table; 123extern struct ir_scancode_table ir_codes_avermedia_m135a_table; 124extern struct ir_scancode_table ir_codes_avermedia_cardbus_table; 125extern struct ir_scancode_table ir_codes_apac_viewcomp_table; 126extern struct ir_scancode_table ir_codes_pixelview_table; 127extern struct ir_scancode_table ir_codes_pixelview_new_table; 128extern struct ir_scancode_table ir_codes_nebula_table; 129extern struct ir_scancode_table ir_codes_dntv_live_dvb_t_table; 130extern struct ir_scancode_table ir_codes_iodata_bctv7e_table; 131extern struct ir_scancode_table ir_codes_adstech_dvb_t_pci_table; 132extern struct ir_scancode_table ir_codes_msi_tvanywhere_table; 133extern struct ir_scancode_table ir_codes_cinergy_1400_table; 134extern struct ir_scancode_table ir_codes_avertv_303_table; 135extern struct ir_scancode_table ir_codes_dntv_live_dvbt_pro_table; 136extern struct ir_scancode_table ir_codes_em_terratec_table; 137extern struct ir_scancode_table ir_codes_pinnacle_grey_table; 138extern struct ir_scancode_table ir_codes_flyvideo_table; 139extern struct ir_scancode_table ir_codes_flydvb_table; 140extern struct ir_scancode_table ir_codes_cinergy_table; 141extern struct ir_scancode_table ir_codes_eztv_table; 142extern struct ir_scancode_table ir_codes_avermedia_table; 143extern struct ir_scancode_table ir_codes_videomate_tv_pvr_table; 144extern struct ir_scancode_table ir_codes_manli_table; 145extern struct ir_scancode_table ir_codes_gotview7135_table; 146extern struct ir_scancode_table ir_codes_purpletv_table; 147extern struct ir_scancode_table ir_codes_pctv_sedna_table; 148extern struct ir_scancode_table ir_codes_pv951_table; 149extern struct ir_scancode_table ir_codes_rc5_tv_table; 150extern struct ir_scancode_table ir_codes_winfast_table; 151extern struct ir_scancode_table ir_codes_pinnacle_color_table; 152extern struct ir_scancode_table ir_codes_hauppauge_new_table; 153extern struct ir_scancode_table ir_codes_npgtech_table; 154extern struct ir_scancode_table ir_codes_norwood_table; 155extern struct ir_scancode_table ir_codes_proteus_2309_table; 156extern struct ir_scancode_table ir_codes_budget_ci_old_table; 157extern struct ir_scancode_table ir_codes_asus_pc39_table; 158extern struct ir_scancode_table ir_codes_encore_enltv_table; 159extern struct ir_scancode_table ir_codes_encore_enltv2_table; 160extern struct ir_scancode_table ir_codes_tt_1500_table; 161extern struct ir_scancode_table ir_codes_fusionhdtv_mce_table; 162extern struct ir_scancode_table ir_codes_behold_table; 163extern struct ir_scancode_table ir_codes_behold_columbus_table; 164extern struct ir_scancode_table ir_codes_pinnacle_pctv_hd_table; 165extern struct ir_scancode_table ir_codes_genius_tvgo_a11mce_table; 166extern struct ir_scancode_table ir_codes_powercolor_real_angel_table; 167extern struct ir_scancode_table ir_codes_avermedia_a16d_table; 168extern struct ir_scancode_table ir_codes_encore_enltv_fm53_table; 169extern struct ir_scancode_table ir_codes_real_audio_220_32_keys_table; 170extern struct ir_scancode_table ir_codes_msi_tvanywhere_plus_table; 171extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table; 172extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; 173extern struct ir_scancode_table ir_codes_kaiomy_table; 174extern struct ir_scancode_table ir_codes_dm1105_nec_table; 175extern struct ir_scancode_table ir_codes_evga_indtube_table; 176extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; 177extern struct ir_scancode_table ir_codes_videomate_s350_table; 178extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; 179#endif