2 * DVB USB Linux driver for Afatech AF9015 DVB-T USB2.0 receiver
4 * Copyright (C) 2007 Antti Palosaari <crope@iki.fi>
6 * Thanks to Afatech who kindly provided information.
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.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _DVB_USB_AF9015_H_
25 #define _DVB_USB_AF9015_H_
27 #define DVB_USB_LOG_PREFIX "af9015"
30 #define deb_info(args...) dprintk(dvb_usb_af9015_debug, 0x01, args)
31 #define deb_rc(args...) dprintk(dvb_usb_af9015_debug, 0x02, args)
32 #define deb_xfer(args...) dprintk(dvb_usb_af9015_debug, 0x04, args)
33 #define deb_reg(args...) dprintk(dvb_usb_af9015_debug, 0x08, args)
34 #define deb_i2c(args...) dprintk(dvb_usb_af9015_debug, 0x10, args)
35 #define deb_fw(args...) dprintk(dvb_usb_af9015_debug, 0x20, args)
37 #define AF9015_I2C_EEPROM 0xa0
38 #define AF9015_I2C_DEMOD 0x38
39 #define AF9015_USB_TIMEOUT 2000
41 /* EEPROM locations */
42 #define AF9015_EEPROM_IR_MODE 0x18
43 #define AF9015_EEPROM_IR_REMOTE_TYPE 0x34
44 #define AF9015_EEPROM_TS_MODE 0x31
45 #define AF9015_EEPROM_DEMOD2_I2C 0x32
47 #define AF9015_EEPROM_SAW_BW1 0x35
48 #define AF9015_EEPROM_XTAL_TYPE1 0x36
49 #define AF9015_EEPROM_SPEC_INV1 0x37
50 #define AF9015_EEPROM_IF1L 0x38
51 #define AF9015_EEPROM_IF1H 0x39
52 #define AF9015_EEPROM_MT2060_IF1L 0x3a
53 #define AF9015_EEPROM_MT2060_IF1H 0x3b
54 #define AF9015_EEPROM_TUNER_ID1 0x3c
56 #define AF9015_EEPROM_SAW_BW2 0x45
57 #define AF9015_EEPROM_XTAL_TYPE2 0x46
58 #define AF9015_EEPROM_SPEC_INV2 0x47
59 #define AF9015_EEPROM_IF2L 0x48
60 #define AF9015_EEPROM_IF2H 0x49
61 #define AF9015_EEPROM_MT2060_IF2L 0x4a
62 #define AF9015_EEPROM_MT2060_IF2H 0x4b
63 #define AF9015_EEPROM_TUNER_ID2 0x4c
65 #define AF9015_EEPROM_OFFSET (AF9015_EEPROM_SAW_BW2 - AF9015_EEPROM_SAW_BW1)
70 u8 i2c_addr
; /* [2] */
73 u8 addr_len
; /* [6] */
74 u8 data_len
; /* [7] */
80 DOWNLOAD_FIRMWARE
= 0x11,
84 READ_WRITE_I2C
= 0x22,
87 WRITE_VIRTUAL_MEMORY
= 0x26,
94 AF9015_IR_MODE_DISABLED
= 0,
100 struct af9015_state
{
101 struct i2c_adapter i2c_adap
; /* I2C adapter for 2nd FE */
104 struct af9015_config
{
108 u16 firmware_checksum
;
114 AF9015_REMOTE_NONE
= 0,
115 /* 1 */ AF9015_REMOTE_A_LINK_DTU_M
,
116 AF9015_REMOTE_MSI_DIGIVOX_MINI_II_V3
,
117 AF9015_REMOTE_MYGICTV_U718
,
118 AF9015_REMOTE_DIGITTRADE_DVB_T
,
119 /* 5 */ AF9015_REMOTE_AVERMEDIA_KS
,
122 /* Leadtek WinFast DTV Dongle Gold */
123 static struct dvb_usb_rc_key af9015_rc_keys_leadtek
[] = {
134 { 0x0028, KEY_ENTER
},
135 { 0x004f, KEY_VOLUMEUP
},
136 { 0x0050, KEY_VOLUMEDOWN
},
137 { 0x0051, KEY_CHANNELDOWN
},
138 { 0x0052, KEY_CHANNELUP
},
141 static u8 af9015_ir_table_leadtek
[] = {
142 0x03, 0xfc, 0x00, 0xff, 0x1a, 0x01, 0x00,
143 0x03, 0xfc, 0x56, 0xa9, 0x00, 0x00, 0x00,
144 0x03, 0xfc, 0x4b, 0xb4, 0x00, 0x00, 0x00,
145 0x03, 0xfc, 0x4c, 0xb3, 0xb2, 0x04, 0x00,
146 0x03, 0xfc, 0x4d, 0xb2, 0x00, 0x00, 0x00,
147 0x03, 0xfc, 0x4e, 0xb1, 0x00, 0x00, 0x00,
148 0x03, 0xfc, 0x1f, 0xe0, 0x3d, 0x00, 0x00,
149 0x03, 0xfc, 0x40, 0xbf, 0x13, 0x01, 0x00,
150 0x03, 0xfc, 0x14, 0xeb, 0x10, 0x00, 0x00,
151 0x03, 0xfc, 0x49, 0xb6, 0x05, 0x01, 0x00,
152 0x03, 0xfc, 0x50, 0xaf, 0x29, 0x00, 0x00,
153 0x03, 0xfc, 0x0c, 0xf3, 0x52, 0x00, 0x00,
154 0x03, 0xfc, 0x03, 0xfc, 0x09, 0x00, 0x00,
155 0x03, 0xfc, 0x08, 0xf7, 0x50, 0x00, 0x00,
156 0x03, 0xfc, 0x13, 0xec, 0x28, 0x00, 0x00,
157 0x03, 0xfc, 0x04, 0xfb, 0x4f, 0x00, 0x00,
158 0x03, 0xfc, 0x4f, 0xb0, 0x0f, 0x01, 0x00,
159 0x03, 0xfc, 0x10, 0xef, 0x51, 0x00, 0x00,
160 0x03, 0xfc, 0x51, 0xae, 0x3f, 0x00, 0x00,
161 0x03, 0xfc, 0x42, 0xbd, 0x13, 0x00, 0x00,
162 0x03, 0xfc, 0x43, 0xbc, 0x00, 0x00, 0x00,
163 0x03, 0xfc, 0x44, 0xbb, 0x11, 0x00, 0x00,
164 0x03, 0xfc, 0x52, 0xad, 0x19, 0x00, 0x00,
165 0x03, 0xfc, 0x54, 0xab, 0x05, 0x00, 0x00,
166 0x03, 0xfc, 0x46, 0xb9, 0x29, 0x00, 0x00,
167 0x03, 0xfc, 0x55, 0xaa, 0x2b, 0x00, 0x00,
168 0x03, 0xfc, 0x53, 0xac, 0x41, 0x00, 0x00,
169 0x03, 0xfc, 0x05, 0xfa, 0x1e, 0x00, 0x00,
170 0x03, 0xfc, 0x06, 0xf9, 0x1f, 0x00, 0x00,
171 0x03, 0xfc, 0x07, 0xf8, 0x20, 0x00, 0x00,
172 0x03, 0xfc, 0x1e, 0xe1, 0x19, 0x00, 0x00,
173 0x03, 0xfc, 0x09, 0xf6, 0x21, 0x00, 0x00,
174 0x03, 0xfc, 0x0a, 0xf5, 0x22, 0x00, 0x00,
175 0x03, 0xfc, 0x0b, 0xf4, 0x23, 0x00, 0x00,
176 0x03, 0xfc, 0x1b, 0xe4, 0x16, 0x00, 0x00,
177 0x03, 0xfc, 0x0d, 0xf2, 0x24, 0x00, 0x00,
178 0x03, 0xfc, 0x0e, 0xf1, 0x25, 0x00, 0x00,
179 0x03, 0xfc, 0x0f, 0xf0, 0x26, 0x00, 0x00,
180 0x03, 0xfc, 0x16, 0xe9, 0x28, 0x00, 0x00,
181 0x03, 0xfc, 0x41, 0xbe, 0x37, 0x00, 0x00,
182 0x03, 0xfc, 0x12, 0xed, 0x27, 0x00, 0x00,
183 0x03, 0xfc, 0x11, 0xee, 0x2a, 0x00, 0x00,
184 0x03, 0xfc, 0x48, 0xb7, 0x2c, 0x00, 0x00,
185 0x03, 0xfc, 0x4a, 0xb5, 0x3c, 0x00, 0x00,
186 0x03, 0xfc, 0x47, 0xb8, 0x15, 0x01, 0x00,
187 0x03, 0xfc, 0x45, 0xba, 0x0b, 0x01, 0x00,
188 0x03, 0xfc, 0x5e, 0xa1, 0x43, 0x00, 0x00,
189 0x03, 0xfc, 0x5a, 0xa5, 0x42, 0x00, 0x00,
190 0x03, 0xfc, 0x5b, 0xa4, 0x4b, 0x00, 0x00,
191 0x03, 0xfc, 0x5f, 0xa0, 0x4e, 0x00, 0x00,
194 /* TwinHan AzureWave AD-TU700(704J) */
195 static struct dvb_usb_rc_key af9015_rc_keys_twinhan
[] = {
196 { 0x053f, KEY_POWER
},
197 { 0x0019, KEY_FAVORITES
}, /* Favorite List */
198 { 0x0004, KEY_TEXT
}, /* Teletext */
199 { 0x000e, KEY_POWER
},
200 { 0x000e, KEY_INFO
}, /* Preview */
201 { 0x0008, KEY_EPG
}, /* Info/EPG */
202 { 0x000f, KEY_LIST
}, /* Record List */
213 { 0x0029, KEY_CANCEL
}, /* Cancel */
214 { 0x004c, KEY_CLEAR
}, /* Clear */
215 { 0x002a, KEY_BACK
}, /* Back */
216 { 0x002b, KEY_TAB
}, /* Tab */
217 { 0x0052, KEY_UP
}, /* up arrow */
218 { 0x0051, KEY_DOWN
}, /* down arrow */
219 { 0x004f, KEY_RIGHT
}, /* right arrow */
220 { 0x0050, KEY_LEFT
}, /* left arrow */
221 { 0x0028, KEY_ENTER
}, /* Enter / ok */
222 { 0x0252, KEY_VOLUMEUP
},
223 { 0x0251, KEY_VOLUMEDOWN
},
224 { 0x004e, KEY_CHANNELDOWN
},
225 { 0x004b, KEY_CHANNELUP
},
226 { 0x004a, KEY_RECORD
},
227 { 0x0111, KEY_PLAY
},
228 { 0x0017, KEY_PAUSE
},
229 { 0x000c, KEY_REWIND
}, /* FR << */
230 { 0x0011, KEY_FASTFORWARD
}, /* FF >> */
231 { 0x0115, KEY_PREVIOUS
}, /* Replay */
232 { 0x010e, KEY_NEXT
}, /* Skip */
233 { 0x0013, KEY_CAMERA
}, /* Capture */
234 { 0x010f, KEY_LANGUAGE
}, /* SAP */
235 { 0x0113, KEY_TV2
}, /* PIP */
236 { 0x001d, KEY_ZOOM
}, /* Full Screen */
237 { 0x0117, KEY_SUBTITLE
}, /* Subtitle / CC */
238 { 0x0010, KEY_MUTE
},
239 { 0x0119, KEY_AUDIO
}, /* L/R */ /* TODO better event */
240 { 0x0116, KEY_SLEEP
}, /* Hibernate */
241 { 0x0116, KEY_SWITCHVIDEOMODE
},
242 /* A/V */ /* TODO does not work */
243 { 0x0006, KEY_AGAIN
}, /* Recall */
244 { 0x0116, KEY_KPPLUS
}, /* Zoom+ */ /* TODO does not work */
245 { 0x0116, KEY_KPMINUS
}, /* Zoom- */ /* TODO does not work */
247 { 0x020a, KEY_GREEN
},
248 { 0x021c, KEY_YELLOW
},
249 { 0x0205, KEY_BLUE
},
252 static u8 af9015_ir_table_twinhan
[] = {
253 0x00, 0xff, 0x16, 0xe9, 0x3f, 0x05, 0x00,
254 0x00, 0xff, 0x07, 0xf8, 0x16, 0x01, 0x00,
255 0x00, 0xff, 0x14, 0xeb, 0x11, 0x01, 0x00,
256 0x00, 0xff, 0x1a, 0xe5, 0x4d, 0x00, 0x00,
257 0x00, 0xff, 0x4c, 0xb3, 0x17, 0x00, 0x00,
258 0x00, 0xff, 0x12, 0xed, 0x11, 0x00, 0x00,
259 0x00, 0xff, 0x40, 0xbf, 0x0c, 0x00, 0x00,
260 0x00, 0xff, 0x11, 0xee, 0x4a, 0x00, 0x00,
261 0x00, 0xff, 0x54, 0xab, 0x13, 0x00, 0x00,
262 0x00, 0xff, 0x41, 0xbe, 0x15, 0x01, 0x00,
263 0x00, 0xff, 0x42, 0xbd, 0x0e, 0x01, 0x00,
264 0x00, 0xff, 0x43, 0xbc, 0x17, 0x01, 0x00,
265 0x00, 0xff, 0x50, 0xaf, 0x0f, 0x01, 0x00,
266 0x00, 0xff, 0x4d, 0xb2, 0x1d, 0x00, 0x00,
267 0x00, 0xff, 0x47, 0xb8, 0x13, 0x01, 0x00,
268 0x00, 0xff, 0x05, 0xfa, 0x4b, 0x00, 0x00,
269 0x00, 0xff, 0x02, 0xfd, 0x4e, 0x00, 0x00,
270 0x00, 0xff, 0x0e, 0xf1, 0x06, 0x00, 0x00,
271 0x00, 0xff, 0x1e, 0xe1, 0x52, 0x02, 0x00,
272 0x00, 0xff, 0x0a, 0xf5, 0x51, 0x02, 0x00,
273 0x00, 0xff, 0x10, 0xef, 0x10, 0x00, 0x00,
274 0x00, 0xff, 0x49, 0xb6, 0x19, 0x01, 0x00,
275 0x00, 0xff, 0x15, 0xea, 0x27, 0x00, 0x00,
276 0x00, 0xff, 0x03, 0xfc, 0x1e, 0x00, 0x00,
277 0x00, 0xff, 0x01, 0xfe, 0x1f, 0x00, 0x00,
278 0x00, 0xff, 0x06, 0xf9, 0x20, 0x00, 0x00,
279 0x00, 0xff, 0x09, 0xf6, 0x21, 0x00, 0x00,
280 0x00, 0xff, 0x1d, 0xe2, 0x22, 0x00, 0x00,
281 0x00, 0xff, 0x1f, 0xe0, 0x23, 0x00, 0x00,
282 0x00, 0xff, 0x0d, 0xf2, 0x24, 0x00, 0x00,
283 0x00, 0xff, 0x19, 0xe6, 0x25, 0x00, 0x00,
284 0x00, 0xff, 0x1b, 0xe4, 0x26, 0x00, 0x00,
285 0x00, 0xff, 0x00, 0xff, 0x2b, 0x00, 0x00,
286 0x00, 0xff, 0x4a, 0xb5, 0x4c, 0x00, 0x00,
287 0x00, 0xff, 0x4b, 0xb4, 0x52, 0x00, 0x00,
288 0x00, 0xff, 0x51, 0xae, 0x51, 0x00, 0x00,
289 0x00, 0xff, 0x52, 0xad, 0x4f, 0x00, 0x00,
290 0x00, 0xff, 0x4e, 0xb1, 0x50, 0x00, 0x00,
291 0x00, 0xff, 0x0c, 0xf3, 0x29, 0x00, 0x00,
292 0x00, 0xff, 0x4f, 0xb0, 0x28, 0x00, 0x00,
293 0x00, 0xff, 0x13, 0xec, 0x2a, 0x00, 0x00,
294 0x00, 0xff, 0x17, 0xe8, 0x19, 0x00, 0x00,
295 0x00, 0xff, 0x04, 0xfb, 0x0f, 0x00, 0x00,
296 0x00, 0xff, 0x48, 0xb7, 0x0e, 0x00, 0x00,
297 0x00, 0xff, 0x0f, 0xf0, 0x04, 0x00, 0x00,
298 0x00, 0xff, 0x1c, 0xe3, 0x08, 0x00, 0x00,
299 0x00, 0xff, 0x18, 0xe7, 0x15, 0x02, 0x00,
300 0x00, 0xff, 0x53, 0xac, 0x0a, 0x02, 0x00,
301 0x00, 0xff, 0x5e, 0xa1, 0x1c, 0x02, 0x00,
302 0x00, 0xff, 0x5f, 0xa0, 0x05, 0x02, 0x00,
306 static struct dvb_usb_rc_key af9015_rc_keys_a_link
[] = {
317 { 0x002e, KEY_CHANNELUP
},
318 { 0x002d, KEY_CHANNELDOWN
},
319 { 0x0428, KEY_ZOOM
},
320 { 0x0041, KEY_MUTE
},
321 { 0x0042, KEY_VOLUMEDOWN
},
322 { 0x0043, KEY_VOLUMEUP
},
323 { 0x0044, KEY_GOTO
}, /* jump */
324 { 0x0545, KEY_POWER
},
327 static u8 af9015_ir_table_a_link
[] = {
328 0x08, 0xf7, 0x12, 0xed, 0x45, 0x05, 0x00, /* power */
329 0x08, 0xf7, 0x1a, 0xe5, 0x41, 0x00, 0x00, /* mute */
330 0x08, 0xf7, 0x01, 0xfe, 0x1e, 0x00, 0x00, /* 1 */
331 0x08, 0xf7, 0x1c, 0xe3, 0x21, 0x00, 0x00, /* 4 */
332 0x08, 0xf7, 0x03, 0xfc, 0x24, 0x00, 0x00, /* 7 */
333 0x08, 0xf7, 0x05, 0xfa, 0x28, 0x04, 0x00, /* zoom */
334 0x08, 0xf7, 0x00, 0xff, 0x43, 0x00, 0x00, /* volume up */
335 0x08, 0xf7, 0x16, 0xe9, 0x42, 0x00, 0x00, /* volume down */
336 0x08, 0xf7, 0x0f, 0xf0, 0x1f, 0x00, 0x00, /* 2 */
337 0x08, 0xf7, 0x0d, 0xf2, 0x22, 0x00, 0x00, /* 5 */
338 0x08, 0xf7, 0x1b, 0xe4, 0x25, 0x00, 0x00, /* 8 */
339 0x08, 0xf7, 0x06, 0xf9, 0x27, 0x00, 0x00, /* 0 */
340 0x08, 0xf7, 0x14, 0xeb, 0x2e, 0x00, 0x00, /* channel up */
341 0x08, 0xf7, 0x1d, 0xe2, 0x2d, 0x00, 0x00, /* channel down */
342 0x08, 0xf7, 0x02, 0xfd, 0x20, 0x00, 0x00, /* 3 */
343 0x08, 0xf7, 0x18, 0xe7, 0x23, 0x00, 0x00, /* 6 */
344 0x08, 0xf7, 0x04, 0xfb, 0x26, 0x00, 0x00, /* 9 */
345 0x08, 0xf7, 0x07, 0xf8, 0x44, 0x00, 0x00, /* jump */
348 /* MSI DIGIVOX mini II V3.0 */
349 static struct dvb_usb_rc_key af9015_rc_keys_msi
[] = {
360 { 0x030f, KEY_CHANNELUP
},
361 { 0x030e, KEY_CHANNELDOWN
},
362 { 0x0042, KEY_VOLUMEDOWN
},
363 { 0x0043, KEY_VOLUMEUP
},
364 { 0x0545, KEY_POWER
},
365 { 0x0052, KEY_UP
}, /* up */
366 { 0x0051, KEY_DOWN
}, /* down */
367 { 0x0028, KEY_ENTER
},
370 static u8 af9015_ir_table_msi
[] = {
371 0x03, 0xfc, 0x17, 0xe8, 0x45, 0x05, 0x00, /* power */
372 0x03, 0xfc, 0x0d, 0xf2, 0x51, 0x00, 0x00, /* down */
373 0x03, 0xfc, 0x03, 0xfc, 0x52, 0x00, 0x00, /* up */
374 0x03, 0xfc, 0x1a, 0xe5, 0x1e, 0x00, 0x00, /* 1 */
375 0x03, 0xfc, 0x02, 0xfd, 0x1f, 0x00, 0x00, /* 2 */
376 0x03, 0xfc, 0x04, 0xfb, 0x20, 0x00, 0x00, /* 3 */
377 0x03, 0xfc, 0x1c, 0xe3, 0x21, 0x00, 0x00, /* 4 */
378 0x03, 0xfc, 0x08, 0xf7, 0x22, 0x00, 0x00, /* 5 */
379 0x03, 0xfc, 0x1d, 0xe2, 0x23, 0x00, 0x00, /* 6 */
380 0x03, 0xfc, 0x11, 0xee, 0x24, 0x00, 0x00, /* 7 */
381 0x03, 0xfc, 0x0b, 0xf4, 0x25, 0x00, 0x00, /* 8 */
382 0x03, 0xfc, 0x10, 0xef, 0x26, 0x00, 0x00, /* 9 */
383 0x03, 0xfc, 0x09, 0xf6, 0x27, 0x00, 0x00, /* 0 */
384 0x03, 0xfc, 0x14, 0xeb, 0x43, 0x00, 0x00, /* volume up */
385 0x03, 0xfc, 0x1f, 0xe0, 0x42, 0x00, 0x00, /* volume down */
386 0x03, 0xfc, 0x15, 0xea, 0x0f, 0x03, 0x00, /* channel up */
387 0x03, 0xfc, 0x05, 0xfa, 0x0e, 0x03, 0x00, /* channel down */
388 0x03, 0xfc, 0x16, 0xe9, 0x28, 0x00, 0x00, /* enter */
392 static struct dvb_usb_rc_key af9015_rc_keys_mygictv
[] = {
393 { 0x003d, KEY_SWITCHVIDEOMODE
},
395 { 0x0545, KEY_POWER
},
406 { 0x0041, KEY_MUTE
},
407 { 0x002a, KEY_ESC
}, /* Esc */
408 { 0x002e, KEY_CHANNELUP
},
409 { 0x002d, KEY_CHANNELDOWN
},
410 { 0x0042, KEY_VOLUMEDOWN
},
411 { 0x0043, KEY_VOLUMEUP
},
412 { 0x0052, KEY_UP
}, /* up arrow */
413 { 0x0051, KEY_DOWN
}, /* down arrow */
414 { 0x004f, KEY_RIGHT
}, /* right arrow */
415 { 0x0050, KEY_LEFT
}, /* left arrow */
416 { 0x0028, KEY_ENTER
}, /* ok */
417 { 0x0115, KEY_RECORD
},
418 { 0x0313, KEY_PLAY
},
419 { 0x0113, KEY_PAUSE
},
420 { 0x0116, KEY_STOP
},
421 { 0x0307, KEY_REWIND
}, /* FR << */
422 { 0x0309, KEY_FASTFORWARD
}, /* FF >> */
423 { 0x003b, KEY_TIME
}, /* TimeShift */
424 { 0x003e, KEY_CAMERA
}, /* Snapshot */
425 { 0x0316, KEY_CYCLEWINDOWS
}, /* yellow, min / max */
426 { 0x0000, KEY_ZOOM
}, /* 'select' (?) */
427 { 0x0316, KEY_SHUFFLE
}, /* Shuffle */
428 { 0x0345, KEY_POWER
},
431 static u8 af9015_ir_table_mygictv
[] = {
432 0x02, 0xbd, 0x0c, 0xf3, 0x3d, 0x00, 0x00, /* TV / AV */
433 0x02, 0xbd, 0x14, 0xeb, 0x45, 0x05, 0x00, /* power */
434 0x02, 0xbd, 0x00, 0xff, 0x1e, 0x00, 0x00, /* 1 */
435 0x02, 0xbd, 0x01, 0xfe, 0x1f, 0x00, 0x00, /* 2 */
436 0x02, 0xbd, 0x02, 0xfd, 0x20, 0x00, 0x00, /* 3 */
437 0x02, 0xbd, 0x03, 0xfc, 0x21, 0x00, 0x00, /* 4 */
438 0x02, 0xbd, 0x04, 0xfb, 0x22, 0x00, 0x00, /* 5 */
439 0x02, 0xbd, 0x05, 0xfa, 0x23, 0x00, 0x00, /* 6 */
440 0x02, 0xbd, 0x06, 0xf9, 0x24, 0x00, 0x00, /* 7 */
441 0x02, 0xbd, 0x07, 0xf8, 0x25, 0x00, 0x00, /* 8 */
442 0x02, 0xbd, 0x08, 0xf7, 0x26, 0x00, 0x00, /* 9 */
443 0x02, 0xbd, 0x09, 0xf6, 0x27, 0x00, 0x00, /* 0 */
444 0x02, 0xbd, 0x0a, 0xf5, 0x41, 0x00, 0x00, /* mute */
445 0x02, 0xbd, 0x1c, 0xe3, 0x2a, 0x00, 0x00, /* esc */
446 0x02, 0xbd, 0x1f, 0xe0, 0x43, 0x00, 0x00, /* volume up */
447 0x02, 0xbd, 0x12, 0xed, 0x52, 0x00, 0x00, /* up arrow */
448 0x02, 0xbd, 0x11, 0xee, 0x50, 0x00, 0x00, /* left arrow */
449 0x02, 0xbd, 0x15, 0xea, 0x28, 0x00, 0x00, /* ok */
450 0x02, 0xbd, 0x10, 0xef, 0x4f, 0x00, 0x00, /* right arrow */
451 0x02, 0xbd, 0x13, 0xec, 0x51, 0x00, 0x00, /* down arrow */
452 0x02, 0xbd, 0x0e, 0xf1, 0x42, 0x00, 0x00, /* volume down */
453 0x02, 0xbd, 0x19, 0xe6, 0x15, 0x01, 0x00, /* record */
454 0x02, 0xbd, 0x1e, 0xe1, 0x13, 0x03, 0x00, /* play */
455 0x02, 0xbd, 0x16, 0xe9, 0x16, 0x01, 0x00, /* stop */
456 0x02, 0xbd, 0x0b, 0xf4, 0x28, 0x04, 0x00, /* yellow, min / max */
457 0x02, 0xbd, 0x0f, 0xf0, 0x3b, 0x00, 0x00, /* time shift */
458 0x02, 0xbd, 0x18, 0xe7, 0x2e, 0x00, 0x00, /* channel up */
459 0x02, 0xbd, 0x1a, 0xe5, 0x2d, 0x00, 0x00, /* channel down */
460 0x02, 0xbd, 0x17, 0xe8, 0x3e, 0x00, 0x00, /* snapshot */
461 0x02, 0xbd, 0x40, 0xbf, 0x13, 0x01, 0x00, /* pause */
462 0x02, 0xbd, 0x41, 0xbe, 0x09, 0x03, 0x00, /* FF >> */
463 0x02, 0xbd, 0x42, 0xbd, 0x07, 0x03, 0x00, /* FR << */
464 0x02, 0xbd, 0x43, 0xbc, 0x00, 0x00, 0x00, /* 'select' (?) */
465 0x02, 0xbd, 0x44, 0xbb, 0x16, 0x03, 0x00, /* shuffle */
466 0x02, 0xbd, 0x45, 0xba, 0x45, 0x03, 0x00, /* power */
469 /* KWorld PlusTV Dual DVB-T Stick (DVB-T 399U) */
470 static u8 af9015_ir_table_kworld
[] = {
471 0x86, 0x6b, 0x0c, 0xf3, 0x2e, 0x07, 0x00,
472 0x86, 0x6b, 0x16, 0xe9, 0x2d, 0x07, 0x00,
473 0x86, 0x6b, 0x1d, 0xe2, 0x37, 0x07, 0x00,
474 0x86, 0x6b, 0x00, 0xff, 0x1e, 0x07, 0x00,
475 0x86, 0x6b, 0x01, 0xfe, 0x1f, 0x07, 0x00,
476 0x86, 0x6b, 0x02, 0xfd, 0x20, 0x07, 0x00,
477 0x86, 0x6b, 0x03, 0xfc, 0x21, 0x07, 0x00,
478 0x86, 0x6b, 0x04, 0xfb, 0x22, 0x07, 0x00,
479 0x86, 0x6b, 0x05, 0xfa, 0x23, 0x07, 0x00,
480 0x86, 0x6b, 0x06, 0xf9, 0x24, 0x07, 0x00,
481 0x86, 0x6b, 0x07, 0xf8, 0x25, 0x07, 0x00,
482 0x86, 0x6b, 0x08, 0xf7, 0x26, 0x07, 0x00,
483 0x86, 0x6b, 0x09, 0xf6, 0x4d, 0x07, 0x00,
484 0x86, 0x6b, 0x0a, 0xf5, 0x4e, 0x07, 0x00,
485 0x86, 0x6b, 0x14, 0xeb, 0x4f, 0x07, 0x00,
486 0x86, 0x6b, 0x1e, 0xe1, 0x50, 0x07, 0x00,
487 0x86, 0x6b, 0x17, 0xe8, 0x52, 0x07, 0x00,
488 0x86, 0x6b, 0x1f, 0xe0, 0x51, 0x07, 0x00,
489 0x86, 0x6b, 0x0e, 0xf1, 0x0b, 0x07, 0x00,
490 0x86, 0x6b, 0x20, 0xdf, 0x0c, 0x07, 0x00,
491 0x86, 0x6b, 0x42, 0xbd, 0x0d, 0x07, 0x00,
492 0x86, 0x6b, 0x0b, 0xf4, 0x0e, 0x07, 0x00,
493 0x86, 0x6b, 0x43, 0xbc, 0x0f, 0x07, 0x00,
494 0x86, 0x6b, 0x10, 0xef, 0x10, 0x07, 0x00,
495 0x86, 0x6b, 0x21, 0xde, 0x11, 0x07, 0x00,
496 0x86, 0x6b, 0x13, 0xec, 0x12, 0x07, 0x00,
497 0x86, 0x6b, 0x11, 0xee, 0x13, 0x07, 0x00,
498 0x86, 0x6b, 0x12, 0xed, 0x14, 0x07, 0x00,
499 0x86, 0x6b, 0x19, 0xe6, 0x15, 0x07, 0x00,
500 0x86, 0x6b, 0x1a, 0xe5, 0x16, 0x07, 0x00,
501 0x86, 0x6b, 0x1b, 0xe4, 0x17, 0x07, 0x00,
502 0x86, 0x6b, 0x4b, 0xb4, 0x18, 0x07, 0x00,
503 0x86, 0x6b, 0x40, 0xbf, 0x19, 0x07, 0x00,
504 0x86, 0x6b, 0x44, 0xbb, 0x1a, 0x07, 0x00,
505 0x86, 0x6b, 0x41, 0xbe, 0x1b, 0x07, 0x00,
506 0x86, 0x6b, 0x22, 0xdd, 0x1c, 0x07, 0x00,
507 0x86, 0x6b, 0x15, 0xea, 0x1d, 0x07, 0x00,
508 0x86, 0x6b, 0x0f, 0xf0, 0x3f, 0x07, 0x00,
509 0x86, 0x6b, 0x1c, 0xe3, 0x40, 0x07, 0x00,
510 0x86, 0x6b, 0x4a, 0xb5, 0x41, 0x07, 0x00,
511 0x86, 0x6b, 0x48, 0xb7, 0x42, 0x07, 0x00,
512 0x86, 0x6b, 0x49, 0xb6, 0x43, 0x07, 0x00,
513 0x86, 0x6b, 0x18, 0xe7, 0x44, 0x07, 0x00,
514 0x86, 0x6b, 0x23, 0xdc, 0x45, 0x07, 0x00,
517 /* AverMedia Volar X */
518 static struct dvb_usb_rc_key af9015_rc_keys_avermedia
[] = {
519 { 0x053d, KEY_PROG1
}, /* SOURCE */
520 { 0x0512, KEY_POWER
}, /* POWER */
521 { 0x051e, KEY_1
}, /* 1 */
522 { 0x051f, KEY_2
}, /* 2 */
523 { 0x0520, KEY_3
}, /* 3 */
524 { 0x0521, KEY_4
}, /* 4 */
525 { 0x0522, KEY_5
}, /* 5 */
526 { 0x0523, KEY_6
}, /* 6 */
527 { 0x0524, KEY_7
}, /* 7 */
528 { 0x0525, KEY_8
}, /* 8 */
529 { 0x0526, KEY_9
}, /* 9 */
530 { 0x053f, KEY_LEFT
}, /* L / DISPLAY */
531 { 0x0527, KEY_0
}, /* 0 */
532 { 0x050f, KEY_RIGHT
}, /* R / CH RTN */
533 { 0x0518, KEY_PROG2
}, /* SNAP SHOT */
534 { 0x051c, KEY_PROG3
}, /* 16-CH PREV */
535 { 0x052d, KEY_VOLUMEDOWN
}, /* VOL DOWN */
536 { 0x053e, KEY_ZOOM
}, /* FULL SCREEN */
537 { 0x052e, KEY_VOLUMEUP
}, /* VOL UP */
538 { 0x0510, KEY_MUTE
}, /* MUTE */
539 { 0x0504, KEY_AUDIO
}, /* AUDIO */
540 { 0x0515, KEY_RECORD
}, /* RECORD */
541 { 0x0511, KEY_PLAY
}, /* PLAY */
542 { 0x0516, KEY_STOP
}, /* STOP */
543 { 0x050c, KEY_PLAYPAUSE
}, /* TIMESHIFT / PAUSE */
544 { 0x0505, KEY_BACK
}, /* << / RED */
545 { 0x0509, KEY_FORWARD
}, /* >> / YELLOW */
546 { 0x0517, KEY_TEXT
}, /* TELETEXT */
547 { 0x050a, KEY_EPG
}, /* EPG */
548 { 0x0513, KEY_MENU
}, /* MENU */
550 { 0x050e, KEY_CHANNELUP
}, /* CH UP */
551 { 0x050d, KEY_CHANNELDOWN
}, /* CH DOWN */
552 { 0x0519, KEY_FIRST
}, /* |<< / GREEN */
553 { 0x0508, KEY_LAST
}, /* >>| / BLUE */
556 static u8 af9015_ir_table_avermedia
[] = {
557 0x02, 0xfd, 0x00, 0xff, 0x12, 0x05, 0x00,
558 0x02, 0xfd, 0x01, 0xfe, 0x3d, 0x05, 0x00,
559 0x02, 0xfd, 0x03, 0xfc, 0x17, 0x05, 0x00,
560 0x02, 0xfd, 0x04, 0xfb, 0x0a, 0x05, 0x00,
561 0x02, 0xfd, 0x05, 0xfa, 0x1e, 0x05, 0x00,
562 0x02, 0xfd, 0x06, 0xf9, 0x1f, 0x05, 0x00,
563 0x02, 0xfd, 0x07, 0xf8, 0x20, 0x05, 0x00,
564 0x02, 0xfd, 0x09, 0xf6, 0x21, 0x05, 0x00,
565 0x02, 0xfd, 0x0a, 0xf5, 0x22, 0x05, 0x00,
566 0x02, 0xfd, 0x0b, 0xf4, 0x23, 0x05, 0x00,
567 0x02, 0xfd, 0x0d, 0xf2, 0x24, 0x05, 0x00,
568 0x02, 0xfd, 0x0e, 0xf1, 0x25, 0x05, 0x00,
569 0x02, 0xfd, 0x0f, 0xf0, 0x26, 0x05, 0x00,
570 0x02, 0xfd, 0x11, 0xee, 0x27, 0x05, 0x00,
571 0x02, 0xfd, 0x08, 0xf7, 0x04, 0x05, 0x00,
572 0x02, 0xfd, 0x0c, 0xf3, 0x3e, 0x05, 0x00,
573 0x02, 0xfd, 0x10, 0xef, 0x1c, 0x05, 0x00,
574 0x02, 0xfd, 0x12, 0xed, 0x3f, 0x05, 0x00,
575 0x02, 0xfd, 0x13, 0xec, 0x0f, 0x05, 0x00,
576 0x02, 0xfd, 0x14, 0xeb, 0x10, 0x05, 0x00,
577 0x02, 0xfd, 0x15, 0xea, 0x13, 0x05, 0x00,
578 0x02, 0xfd, 0x17, 0xe8, 0x18, 0x05, 0x00,
579 0x02, 0xfd, 0x18, 0xe7, 0x11, 0x05, 0x00,
580 0x02, 0xfd, 0x19, 0xe6, 0x15, 0x05, 0x00,
581 0x02, 0xfd, 0x1a, 0xe5, 0x0c, 0x05, 0x00,
582 0x02, 0xfd, 0x1b, 0xe4, 0x16, 0x05, 0x00,
583 0x02, 0xfd, 0x1c, 0xe3, 0x09, 0x05, 0x00,
584 0x02, 0xfd, 0x1d, 0xe2, 0x05, 0x05, 0x00,
585 0x02, 0xfd, 0x1e, 0xe1, 0x2d, 0x05, 0x00,
586 0x02, 0xfd, 0x1f, 0xe0, 0x2e, 0x05, 0x00,
587 0x03, 0xfc, 0x00, 0xff, 0x08, 0x05, 0x00,
588 0x03, 0xfc, 0x01, 0xfe, 0x19, 0x05, 0x00,
589 0x03, 0xfc, 0x02, 0xfd, 0x0d, 0x05, 0x00,
590 0x03, 0xfc, 0x03, 0xfc, 0x0e, 0x05, 0x00,
593 static u8 af9015_ir_table_avermedia_ks
[] = {
594 0x05, 0xfa, 0x01, 0xfe, 0x12, 0x05, 0x00,
595 0x05, 0xfa, 0x02, 0xfd, 0x0e, 0x05, 0x00,
596 0x05, 0xfa, 0x03, 0xfc, 0x0d, 0x05, 0x00,
597 0x05, 0xfa, 0x04, 0xfb, 0x2e, 0x05, 0x00,
598 0x05, 0xfa, 0x05, 0xfa, 0x2d, 0x05, 0x00,
599 0x05, 0xfa, 0x06, 0xf9, 0x10, 0x05, 0x00,
600 0x05, 0xfa, 0x07, 0xf8, 0x0f, 0x05, 0x00,
601 0x05, 0xfa, 0x08, 0xf7, 0x3d, 0x05, 0x00,
602 0x05, 0xfa, 0x09, 0xf6, 0x1e, 0x05, 0x00,
603 0x05, 0xfa, 0x0a, 0xf5, 0x1f, 0x05, 0x00,
604 0x05, 0xfa, 0x0b, 0xf4, 0x20, 0x05, 0x00,
605 0x05, 0xfa, 0x0c, 0xf3, 0x21, 0x05, 0x00,
606 0x05, 0xfa, 0x0d, 0xf2, 0x22, 0x05, 0x00,
607 0x05, 0xfa, 0x0e, 0xf1, 0x23, 0x05, 0x00,
608 0x05, 0xfa, 0x0f, 0xf0, 0x24, 0x05, 0x00,
609 0x05, 0xfa, 0x10, 0xef, 0x25, 0x05, 0x00,
610 0x05, 0xfa, 0x11, 0xee, 0x26, 0x05, 0x00,
611 0x05, 0xfa, 0x12, 0xed, 0x27, 0x05, 0x00,
612 0x05, 0xfa, 0x13, 0xec, 0x04, 0x05, 0x00,
613 0x05, 0xfa, 0x15, 0xea, 0x0a, 0x05, 0x00,
614 0x05, 0xfa, 0x16, 0xe9, 0x11, 0x05, 0x00,
615 0x05, 0xfa, 0x17, 0xe8, 0x15, 0x05, 0x00,
616 0x05, 0xfa, 0x18, 0xe7, 0x16, 0x05, 0x00,
617 0x05, 0xfa, 0x1c, 0xe3, 0x05, 0x05, 0x00,
618 0x05, 0xfa, 0x1d, 0xe2, 0x09, 0x05, 0x00,
619 0x05, 0xfa, 0x4d, 0xb2, 0x3f, 0x05, 0x00,
620 0x05, 0xfa, 0x56, 0xa9, 0x3e, 0x05, 0x00
623 /* Digittrade DVB-T USB Stick */
624 static struct dvb_usb_rc_key af9015_rc_keys_digittrade
[] = {
625 { 0x010f, KEY_LAST
}, /* RETURN */
626 { 0x0517, KEY_TEXT
}, /* TELETEXT */
627 { 0x0108, KEY_EPG
}, /* EPG */
628 { 0x0513, KEY_POWER
}, /* POWER */
629 { 0x0109, KEY_ZOOM
}, /* FULLSCREEN */
630 { 0x0040, KEY_AUDIO
}, /* DUAL SOUND */
631 { 0x002c, KEY_PRINT
}, /* SNAPSHOT */
632 { 0x0516, KEY_SUBTITLE
}, /* SUBTITLE */
633 { 0x0052, KEY_CHANNELUP
}, /* CH Up */
634 { 0x0051, KEY_CHANNELDOWN
},/* Ch Dn */
635 { 0x0057, KEY_VOLUMEUP
}, /* Vol Up */
636 { 0x0056, KEY_VOLUMEDOWN
}, /* Vol Dn */
637 { 0x0110, KEY_MUTE
}, /* MUTE */
648 { 0x0117, KEY_PLAYPAUSE
}, /* TIMESHIFT */
649 { 0x0115, KEY_RECORD
}, /* RECORD */
650 { 0x0313, KEY_PLAY
}, /* PLAY */
651 { 0x0116, KEY_STOP
}, /* STOP */
652 { 0x0113, KEY_PAUSE
}, /* PAUSE */
655 static u8 af9015_ir_table_digittrade
[] = {
656 0x00, 0xff, 0x06, 0xf9, 0x13, 0x05, 0x00,
657 0x00, 0xff, 0x4d, 0xb2, 0x17, 0x01, 0x00,
658 0x00, 0xff, 0x1f, 0xe0, 0x2c, 0x00, 0x00,
659 0x00, 0xff, 0x0a, 0xf5, 0x15, 0x01, 0x00,
660 0x00, 0xff, 0x0e, 0xf1, 0x16, 0x01, 0x00,
661 0x00, 0xff, 0x09, 0xf6, 0x09, 0x01, 0x00,
662 0x00, 0xff, 0x01, 0xfe, 0x08, 0x01, 0x00,
663 0x00, 0xff, 0x05, 0xfa, 0x10, 0x01, 0x00,
664 0x00, 0xff, 0x02, 0xfd, 0x56, 0x00, 0x00,
665 0x00, 0xff, 0x40, 0xbf, 0x57, 0x00, 0x00,
666 0x00, 0xff, 0x19, 0xe6, 0x52, 0x00, 0x00,
667 0x00, 0xff, 0x17, 0xe8, 0x51, 0x00, 0x00,
668 0x00, 0xff, 0x10, 0xef, 0x0f, 0x01, 0x00,
669 0x00, 0xff, 0x54, 0xab, 0x27, 0x00, 0x00,
670 0x00, 0xff, 0x1b, 0xe4, 0x1e, 0x00, 0x00,
671 0x00, 0xff, 0x11, 0xee, 0x1f, 0x00, 0x00,
672 0x00, 0xff, 0x15, 0xea, 0x20, 0x00, 0x00,
673 0x00, 0xff, 0x12, 0xed, 0x21, 0x00, 0x00,
674 0x00, 0xff, 0x16, 0xe9, 0x22, 0x00, 0x00,
675 0x00, 0xff, 0x4c, 0xb3, 0x23, 0x00, 0x00,
676 0x00, 0xff, 0x48, 0xb7, 0x24, 0x00, 0x00,
677 0x00, 0xff, 0x04, 0xfb, 0x25, 0x00, 0x00,
678 0x00, 0xff, 0x00, 0xff, 0x26, 0x00, 0x00,
679 0x00, 0xff, 0x1e, 0xe1, 0x13, 0x03, 0x00,
680 0x00, 0xff, 0x1a, 0xe5, 0x13, 0x01, 0x00,
681 0x00, 0xff, 0x03, 0xfc, 0x17, 0x05, 0x00,
682 0x00, 0xff, 0x0d, 0xf2, 0x16, 0x05, 0x00,
683 0x00, 0xff, 0x1d, 0xe2, 0x40, 0x00, 0x00,
686 /* TREKSTOR DVB-T USB Stick */
687 static struct dvb_usb_rc_key af9015_rc_keys_trekstor
[] = {
688 { 0x0704, KEY_AGAIN
}, /* Home */
689 { 0x0705, KEY_MUTE
}, /* Mute */
690 { 0x0706, KEY_UP
}, /* Up */
691 { 0x0707, KEY_DOWN
}, /* Down */
692 { 0x0709, KEY_RIGHT
}, /* Right */
693 { 0x070a, KEY_ENTER
}, /* OK */
694 { 0x070b, KEY_FASTFORWARD
}, /* Fast forward */
695 { 0x070c, KEY_REWIND
}, /* Rewind */
696 { 0x070d, KEY_PLAY
}, /* Play/Pause */
697 { 0x070e, KEY_VOLUMEUP
}, /* Volume + */
698 { 0x070f, KEY_VOLUMEDOWN
}, /* Volume - */
699 { 0x0710, KEY_RECORD
}, /* Record */
700 { 0x0711, KEY_STOP
}, /* Stop */
701 { 0x0712, KEY_ZOOM
}, /* TV */
702 { 0x0713, KEY_EPG
}, /* Info/EPG */
703 { 0x0714, KEY_CHANNELDOWN
}, /* Channel - */
704 { 0x0715, KEY_CHANNELUP
}, /* Channel + */
714 { 0x0708, KEY_LEFT
}, /* LEFT */
718 static u8 af9015_ir_table_trekstor
[] = {
719 0x00, 0xff, 0x86, 0x79, 0x04, 0x07, 0x00,
720 0x00, 0xff, 0x85, 0x7a, 0x05, 0x07, 0x00,
721 0x00, 0xff, 0x87, 0x78, 0x06, 0x07, 0x00,
722 0x00, 0xff, 0x8c, 0x73, 0x07, 0x07, 0x00,
723 0x00, 0xff, 0x89, 0x76, 0x09, 0x07, 0x00,
724 0x00, 0xff, 0x88, 0x77, 0x0a, 0x07, 0x00,
725 0x00, 0xff, 0x8a, 0x75, 0x0b, 0x07, 0x00,
726 0x00, 0xff, 0x9e, 0x61, 0x0c, 0x07, 0x00,
727 0x00, 0xff, 0x8d, 0x72, 0x0d, 0x07, 0x00,
728 0x00, 0xff, 0x8b, 0x74, 0x0e, 0x07, 0x00,
729 0x00, 0xff, 0x9b, 0x64, 0x0f, 0x07, 0x00,
730 0x00, 0xff, 0x9d, 0x62, 0x10, 0x07, 0x00,
731 0x00, 0xff, 0x8e, 0x71, 0x11, 0x07, 0x00,
732 0x00, 0xff, 0x9c, 0x63, 0x12, 0x07, 0x00,
733 0x00, 0xff, 0x8f, 0x70, 0x13, 0x07, 0x00,
734 0x00, 0xff, 0x93, 0x6c, 0x14, 0x07, 0x00,
735 0x00, 0xff, 0x97, 0x68, 0x15, 0x07, 0x00,
736 0x00, 0xff, 0x92, 0x6d, 0x1e, 0x07, 0x00,
737 0x00, 0xff, 0x96, 0x69, 0x1f, 0x07, 0x00,
738 0x00, 0xff, 0x9a, 0x65, 0x20, 0x07, 0x00,
739 0x00, 0xff, 0x91, 0x6e, 0x21, 0x07, 0x00,
740 0x00, 0xff, 0x95, 0x6a, 0x22, 0x07, 0x00,
741 0x00, 0xff, 0x99, 0x66, 0x23, 0x07, 0x00,
742 0x00, 0xff, 0x90, 0x6f, 0x24, 0x07, 0x00,
743 0x00, 0xff, 0x94, 0x6b, 0x25, 0x07, 0x00,
744 0x00, 0xff, 0x98, 0x67, 0x26, 0x07, 0x00,
745 0x00, 0xff, 0x9f, 0x60, 0x08, 0x07, 0x00,
746 0x00, 0xff, 0x84, 0x7b, 0x27, 0x07, 0x00,