]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/media/ir-common.h
V4L/DVB: saa7134: use a full scancode table for M135A
[net-next-2.6.git] / include / media / ir-common.h
CommitLineData
1da177e4 1/*
1da177e4
LT
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
d5e52653
MCC
23#ifndef _IR_COMMON
24#define _IR_COMMON
1da177e4 25
d5e52653 26#include <linux/input.h>
0b778a56 27#include <linux/workqueue.h>
622ecb30 28#include <linux/interrupt.h>
446e4a64 29#include <media/ir-core.h>
1da177e4 30
9160723e
HP
31#define RC5_START(x) (((x)>>12)&3)
32#define RC5_TOGGLE(x) (((x)>>11)&1)
33#define RC5_ADDR(x) (((x)>>6)&31)
34#define RC5_INSTR(x) ((x)&63)
35
1da177e4
LT
36struct ir_input_state {
37 /* configuration */
971e8298 38 u64 ir_type;
1da177e4
LT
39
40 /* key info */
8573b74a 41 u32 ir_key; /* ir scancode */
1da177e4
LT
42 u32 keycode; /* linux key code */
43 int keypressed; /* current state */
44};
45
9160723e
HP
46/* this was saa7134_ir and bttv_ir, moved here for
47 * rc5 decoding. */
48struct card_ir {
49 struct input_dev *dev;
50 struct ir_input_state ir;
51 char name[32];
52 char phys[32];
53
54 /* Usual gpio signalling */
55
56 u32 mask_keycode;
57 u32 mask_keydown;
58 u32 mask_keyup;
59 u32 polling;
60 u32 last_gpio;
61 int shift_by;
62 int start; // What should RC5_START() be
63 int addr; // What RC5_ADDR() should be.
64 int rc5_key_timeout;
65 int rc5_remote_gap;
66 struct work_struct work;
67 struct timer_list timer;
68
69 /* RC5 gpio */
70 u32 rc5_gpio;
71 struct timer_list timer_end; /* timer_end for code completion */
72 struct timer_list timer_keyup; /* timer_end for key release */
73 u32 last_rc5; /* last good rc5 code */
74 u32 last_bit; /* last raw bit seen */
75 u32 code; /* raw code under construction */
76 struct timeval base_time; /* time of last seen code */
77 int active; /* building raw code */
622ecb30
MCC
78
79 /* NEC decoding */
80 u32 nec_gpio;
81 struct tasklet_struct tlet;
9160723e
HP
82};
83
ef53a115
MCC
84/* Routines from ir-functions.c */
85
055cd556 86int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
971e8298 87 const u64 ir_type);
1da177e4
LT
88void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir);
89void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
8573b74a 90 u32 ir_key);
1da177e4
LT
91u32 ir_extract_bits(u32 data, u32 mask);
92int ir_dump_samples(u32 *samples, int count);
93int ir_decode_biphase(u32 *samples, int count, int low, int high);
793cf9e6 94int ir_decode_pulsedistance(u32 *samples, int count, int low, int high);
1d23a002 95u32 ir_rc5_decode(unsigned int code);
1da177e4 96
9160723e
HP
97void ir_rc5_timer_end(unsigned long data);
98void ir_rc5_timer_keyup(unsigned long data);
99
ef53a115 100/* scancode->keycode map tables from ir-keymaps.c */
4c0f631e 101
715a2233
MCC
102extern struct ir_scancode_table ir_codes_empty_table;
103extern struct ir_scancode_table ir_codes_avermedia_table;
104extern struct ir_scancode_table ir_codes_avermedia_dvbt_table;
d152b8b6 105extern struct ir_scancode_table ir_codes_avermedia_m135a_rm_jx_table;
715a2233
MCC
106extern struct ir_scancode_table ir_codes_avermedia_cardbus_table;
107extern struct ir_scancode_table ir_codes_apac_viewcomp_table;
108extern struct ir_scancode_table ir_codes_pixelview_table;
109extern struct ir_scancode_table ir_codes_pixelview_new_table;
110extern struct ir_scancode_table ir_codes_nebula_table;
111extern struct ir_scancode_table ir_codes_dntv_live_dvb_t_table;
112extern struct ir_scancode_table ir_codes_iodata_bctv7e_table;
113extern struct ir_scancode_table ir_codes_adstech_dvb_t_pci_table;
114extern struct ir_scancode_table ir_codes_msi_tvanywhere_table;
115extern struct ir_scancode_table ir_codes_cinergy_1400_table;
116extern struct ir_scancode_table ir_codes_avertv_303_table;
117extern struct ir_scancode_table ir_codes_dntv_live_dvbt_pro_table;
118extern struct ir_scancode_table ir_codes_em_terratec_table;
119extern struct ir_scancode_table ir_codes_pinnacle_grey_table;
120extern struct ir_scancode_table ir_codes_flyvideo_table;
121extern struct ir_scancode_table ir_codes_flydvb_table;
122extern struct ir_scancode_table ir_codes_cinergy_table;
123extern struct ir_scancode_table ir_codes_eztv_table;
124extern struct ir_scancode_table ir_codes_avermedia_table;
125extern struct ir_scancode_table ir_codes_videomate_tv_pvr_table;
126extern struct ir_scancode_table ir_codes_manli_table;
127extern struct ir_scancode_table ir_codes_gotview7135_table;
128extern struct ir_scancode_table ir_codes_purpletv_table;
129extern struct ir_scancode_table ir_codes_pctv_sedna_table;
130extern struct ir_scancode_table ir_codes_pv951_table;
131extern struct ir_scancode_table ir_codes_rc5_tv_table;
132extern struct ir_scancode_table ir_codes_winfast_table;
133extern struct ir_scancode_table ir_codes_pinnacle_color_table;
134extern struct ir_scancode_table ir_codes_hauppauge_new_table;
35d1988c 135extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table;
715a2233
MCC
136extern struct ir_scancode_table ir_codes_npgtech_table;
137extern struct ir_scancode_table ir_codes_norwood_table;
138extern struct ir_scancode_table ir_codes_proteus_2309_table;
139extern struct ir_scancode_table ir_codes_budget_ci_old_table;
140extern struct ir_scancode_table ir_codes_asus_pc39_table;
141extern struct ir_scancode_table ir_codes_encore_enltv_table;
142extern struct ir_scancode_table ir_codes_encore_enltv2_table;
143extern struct ir_scancode_table ir_codes_tt_1500_table;
144extern struct ir_scancode_table ir_codes_fusionhdtv_mce_table;
145extern struct ir_scancode_table ir_codes_behold_table;
146extern struct ir_scancode_table ir_codes_behold_columbus_table;
147extern struct ir_scancode_table ir_codes_pinnacle_pctv_hd_table;
148extern struct ir_scancode_table ir_codes_genius_tvgo_a11mce_table;
149extern struct ir_scancode_table ir_codes_powercolor_real_angel_table;
150extern struct ir_scancode_table ir_codes_avermedia_a16d_table;
151extern struct ir_scancode_table ir_codes_encore_enltv_fm53_table;
152extern struct ir_scancode_table ir_codes_real_audio_220_32_keys_table;
153extern struct ir_scancode_table ir_codes_msi_tvanywhere_plus_table;
154extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table;
155extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table;
156extern struct ir_scancode_table ir_codes_kaiomy_table;
157extern struct ir_scancode_table ir_codes_dm1105_nec_table;
9d2ba7ad 158extern struct ir_scancode_table ir_codes_tevii_nec_table;
d8d86225 159extern struct ir_scancode_table ir_codes_tbs_nec_table;
715a2233
MCC
160extern struct ir_scancode_table ir_codes_evga_indtube_table;
161extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table;
162extern struct ir_scancode_table ir_codes_videomate_s350_table;
163extern struct ir_scancode_table ir_codes_gadmei_rm008z_table;
cda4303f 164extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table;
ca39d84d 165extern struct ir_scancode_table ir_codes_winfast_usbii_deluxe_table;
9a0a75a5 166extern struct ir_scancode_table ir_codes_kworld_315u_table;
d5e52653 167#endif