Antti Palosaari | 80619de | 2008-09-15 17:18:09 -0300 | [diff] [blame] | 1 | /* |
| 2 | * DVB USB Linux driver for Afatech AF9015 DVB-T USB2.0 receiver |
| 3 | * |
| 4 | * Copyright (C) 2007 Antti Palosaari <crope@iki.fi> |
| 5 | * |
| 6 | * Thanks to Afatech who kindly provided information. |
| 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., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 | * |
| 22 | */ |
| 23 | |
| 24 | #ifndef _DVB_USB_AF9015_H_ |
| 25 | #define _DVB_USB_AF9015_H_ |
| 26 | |
| 27 | #define DVB_USB_LOG_PREFIX "af9015" |
| 28 | #include "dvb-usb.h" |
| 29 | |
Antti Palosaari | 80619de | 2008-09-15 17:18:09 -0300 | [diff] [blame] | 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) |
| 36 | |
| 37 | #define AF9015_I2C_EEPROM 0xa0 |
| 38 | #define AF9015_I2C_DEMOD 0x38 |
| 39 | #define AF9015_USB_TIMEOUT 2000 |
| 40 | |
| 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 |
| 46 | |
| 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 |
| 55 | |
| 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 |
| 64 | |
| 65 | #define AF9015_EEPROM_OFFSET (AF9015_EEPROM_SAW_BW2 - AF9015_EEPROM_SAW_BW1) |
| 66 | |
| 67 | #define AF9015_GPIO_ON (1 << 0) |
| 68 | #define AF9015_GPIO_EN (1 << 1) |
| 69 | #define AF9015_GPIO_O (1 << 2) |
| 70 | #define AF9015_GPIO_I (1 << 3) |
| 71 | |
| 72 | #define AF9015_GPIO_TUNER_ON (AF9015_GPIO_ON|AF9015_GPIO_EN) |
| 73 | #define AF9015_GPIO_TUNER_OFF (AF9015_GPIO_ON|AF9015_GPIO_EN|AF9015_GPIO_O) |
| 74 | |
| 75 | struct req_t { |
| 76 | u8 cmd; /* [0] */ |
| 77 | /* seq */ /* [1] */ |
| 78 | u8 i2c_addr; /* [2] */ |
| 79 | u16 addr; /* [3|4] */ |
| 80 | u8 mbox; /* [5] */ |
| 81 | u8 addr_len; /* [6] */ |
| 82 | u8 data_len; /* [7] */ |
| 83 | u8 *data; |
| 84 | }; |
| 85 | |
| 86 | enum af9015_cmd { |
| 87 | GET_CONFIG = 0x10, |
| 88 | DOWNLOAD_FIRMWARE = 0x11, |
| 89 | BOOT = 0x13, |
| 90 | READ_MEMORY = 0x20, |
| 91 | WRITE_MEMORY = 0x21, |
| 92 | READ_WRITE_I2C = 0x22, |
| 93 | COPY_FIRMWARE = 0x23, |
| 94 | RECONNECT_USB = 0x5a, |
| 95 | WRITE_VIRTUAL_MEMORY = 0x26, |
| 96 | GET_IR_CODE = 0x27, |
| 97 | READ_I2C, |
| 98 | WRITE_I2C, |
| 99 | }; |
| 100 | |
| 101 | enum af9015_ir_mode { |
| 102 | AF9015_IR_MODE_DISABLED = 0, |
| 103 | AF9015_IR_MODE_HID, |
| 104 | AF9015_IR_MODE_RLC, |
| 105 | AF9015_IR_MODE_RC6, |
| 106 | }; |
| 107 | |
| 108 | struct af9015_state { |
| 109 | struct i2c_adapter i2c_adap; /* I2C adapter for 2nd FE */ |
| 110 | }; |
| 111 | |
| 112 | struct af9015_config { |
| 113 | u8 dual_mode:1; |
| 114 | u16 mt2060_if1[2]; |
| 115 | u16 firmware_size; |
| 116 | u16 firmware_checksum; |
| 117 | u8 *ir_table; |
| 118 | u16 ir_table_size; |
| 119 | }; |
| 120 | |
| 121 | enum af9015_remote { |
| 122 | AF9015_REMOTE_NONE = 0, |
| 123 | AF9015_REMOTE_A_LINK_DTU_M, |
| 124 | AF9015_REMOTE_MSI_DIGIVOX_MINI_II_V3, |
| 125 | AF9015_REMOTE_MYGICTV_U718, |
| 126 | }; |
| 127 | |
| 128 | /* Leadtek WinFast DTV Dongle Gold */ |
| 129 | static struct dvb_usb_rc_key af9015_rc_keys_leadtek[] = { |
| 130 | { 0x00, 0x1e, KEY_1 }, |
| 131 | { 0x00, 0x1f, KEY_2 }, |
| 132 | { 0x00, 0x20, KEY_3 }, |
| 133 | { 0x00, 0x21, KEY_4 }, |
| 134 | { 0x00, 0x22, KEY_5 }, |
| 135 | { 0x00, 0x23, KEY_6 }, |
| 136 | { 0x00, 0x24, KEY_7 }, |
| 137 | { 0x00, 0x25, KEY_8 }, |
| 138 | { 0x00, 0x26, KEY_9 }, |
| 139 | { 0x00, 0x27, KEY_0 }, |
| 140 | { 0x00, 0x28, KEY_ENTER }, |
| 141 | { 0x00, 0x4f, KEY_VOLUMEUP }, |
| 142 | { 0x00, 0x50, KEY_VOLUMEDOWN }, |
| 143 | { 0x00, 0x51, KEY_CHANNELDOWN }, |
| 144 | { 0x00, 0x52, KEY_CHANNELUP }, |
| 145 | }; |
| 146 | |
| 147 | static u8 af9015_ir_table_leadtek[] = { |
| 148 | 0x03, 0xfc, 0x00, 0xff, 0x1a, 0x01, 0x00, |
| 149 | 0x03, 0xfc, 0x56, 0xa9, 0x00, 0x00, 0x00, |
| 150 | 0x03, 0xfc, 0x4b, 0xb4, 0x00, 0x00, 0x00, |
| 151 | 0x03, 0xfc, 0x4c, 0xb3, 0xb2, 0x04, 0x00, |
| 152 | 0x03, 0xfc, 0x4d, 0xb2, 0x00, 0x00, 0x00, |
| 153 | 0x03, 0xfc, 0x4e, 0xb1, 0x00, 0x00, 0x00, |
| 154 | 0x03, 0xfc, 0x1f, 0xe0, 0x3d, 0x00, 0x00, |
| 155 | 0x03, 0xfc, 0x40, 0xbf, 0x13, 0x01, 0x00, |
| 156 | 0x03, 0xfc, 0x14, 0xeb, 0x10, 0x00, 0x00, |
| 157 | 0x03, 0xfc, 0x49, 0xb6, 0x05, 0x01, 0x00, |
| 158 | 0x03, 0xfc, 0x50, 0xaf, 0x29, 0x00, 0x00, |
| 159 | 0x03, 0xfc, 0x0c, 0xf3, 0x52, 0x00, 0x00, |
| 160 | 0x03, 0xfc, 0x03, 0xfc, 0x09, 0x00, 0x00, |
| 161 | 0x03, 0xfc, 0x08, 0xf7, 0x50, 0x00, 0x00, |
| 162 | 0x03, 0xfc, 0x13, 0xec, 0x28, 0x00, 0x00, |
| 163 | 0x03, 0xfc, 0x04, 0xfb, 0x4f, 0x00, 0x00, |
| 164 | 0x03, 0xfc, 0x4f, 0xb0, 0x0f, 0x01, 0x00, |
| 165 | 0x03, 0xfc, 0x10, 0xef, 0x51, 0x00, 0x00, |
| 166 | 0x03, 0xfc, 0x51, 0xae, 0x3f, 0x00, 0x00, |
| 167 | 0x03, 0xfc, 0x42, 0xbd, 0x13, 0x00, 0x00, |
| 168 | 0x03, 0xfc, 0x43, 0xbc, 0x00, 0x00, 0x00, |
| 169 | 0x03, 0xfc, 0x44, 0xbb, 0x11, 0x00, 0x00, |
| 170 | 0x03, 0xfc, 0x52, 0xad, 0x19, 0x00, 0x00, |
| 171 | 0x03, 0xfc, 0x54, 0xab, 0x05, 0x00, 0x00, |
| 172 | 0x03, 0xfc, 0x46, 0xb9, 0x29, 0x00, 0x00, |
| 173 | 0x03, 0xfc, 0x55, 0xaa, 0x2b, 0x00, 0x00, |
| 174 | 0x03, 0xfc, 0x53, 0xac, 0x41, 0x00, 0x00, |
| 175 | 0x03, 0xfc, 0x05, 0xfa, 0x1e, 0x00, 0x00, |
| 176 | 0x03, 0xfc, 0x06, 0xf9, 0x1f, 0x00, 0x00, |
| 177 | 0x03, 0xfc, 0x07, 0xf8, 0x20, 0x00, 0x00, |
| 178 | 0x03, 0xfc, 0x1e, 0xe1, 0x19, 0x00, 0x00, |
| 179 | 0x03, 0xfc, 0x09, 0xf6, 0x21, 0x00, 0x00, |
| 180 | 0x03, 0xfc, 0x0a, 0xf5, 0x22, 0x00, 0x00, |
| 181 | 0x03, 0xfc, 0x0b, 0xf4, 0x23, 0x00, 0x00, |
| 182 | 0x03, 0xfc, 0x1b, 0xe4, 0x16, 0x00, 0x00, |
| 183 | 0x03, 0xfc, 0x0d, 0xf2, 0x24, 0x00, 0x00, |
| 184 | 0x03, 0xfc, 0x0e, 0xf1, 0x25, 0x00, 0x00, |
| 185 | 0x03, 0xfc, 0x0f, 0xf0, 0x26, 0x00, 0x00, |
| 186 | 0x03, 0xfc, 0x16, 0xe9, 0x28, 0x00, 0x00, |
| 187 | 0x03, 0xfc, 0x41, 0xbe, 0x37, 0x00, 0x00, |
| 188 | 0x03, 0xfc, 0x12, 0xed, 0x27, 0x00, 0x00, |
| 189 | 0x03, 0xfc, 0x11, 0xee, 0x2a, 0x00, 0x00, |
| 190 | 0x03, 0xfc, 0x48, 0xb7, 0x2c, 0x00, 0x00, |
| 191 | 0x03, 0xfc, 0x4a, 0xb5, 0x3c, 0x00, 0x00, |
| 192 | 0x03, 0xfc, 0x47, 0xb8, 0x15, 0x01, 0x00, |
| 193 | 0x03, 0xfc, 0x45, 0xba, 0x0b, 0x01, 0x00, |
| 194 | 0x03, 0xfc, 0x5e, 0xa1, 0x43, 0x00, 0x00, |
| 195 | 0x03, 0xfc, 0x5a, 0xa5, 0x42, 0x00, 0x00, |
| 196 | 0x03, 0xfc, 0x5b, 0xa4, 0x4b, 0x00, 0x00, |
| 197 | 0x03, 0xfc, 0x5f, 0xa0, 0x4e, 0x00, 0x00, |
| 198 | }; |
| 199 | |
| 200 | /* TwinHan AzureWave AD-TU700(704J) */ |
| 201 | static struct dvb_usb_rc_key af9015_rc_keys_twinhan[] = { |
| 202 | { 0x05, 0x3f, KEY_POWER }, |
| 203 | { 0x00, 0x19, KEY_FAVORITES }, /* Favorite List */ |
| 204 | { 0x00, 0x04, KEY_TEXT }, /* Teletext */ |
| 205 | { 0x00, 0x0e, KEY_POWER }, |
| 206 | { 0x00, 0x0e, KEY_INFO }, /* Preview */ |
| 207 | { 0x00, 0x08, KEY_EPG }, /* Info/EPG */ |
| 208 | { 0x00, 0x0f, KEY_LIST }, /* Record List */ |
| 209 | { 0x00, 0x1e, KEY_1 }, |
| 210 | { 0x00, 0x1f, KEY_2 }, |
| 211 | { 0x00, 0x20, KEY_3 }, |
| 212 | { 0x00, 0x21, KEY_4 }, |
| 213 | { 0x00, 0x22, KEY_5 }, |
| 214 | { 0x00, 0x23, KEY_6 }, |
| 215 | { 0x00, 0x24, KEY_7 }, |
| 216 | { 0x00, 0x25, KEY_8 }, |
| 217 | { 0x00, 0x26, KEY_9 }, |
| 218 | { 0x00, 0x27, KEY_0 }, |
| 219 | { 0x00, 0x29, KEY_CANCEL }, /* Cancel */ |
| 220 | { 0x00, 0x4c, KEY_CLEAR }, /* Clear */ |
| 221 | { 0x00, 0x2a, KEY_BACK }, /* Back */ |
| 222 | { 0x00, 0x2b, KEY_TAB }, /* Tab */ |
| 223 | { 0x00, 0x52, KEY_UP }, /* up arrow */ |
| 224 | { 0x00, 0x51, KEY_DOWN }, /* down arrow */ |
| 225 | { 0x00, 0x4f, KEY_RIGHT }, /* right arrow */ |
| 226 | { 0x00, 0x50, KEY_LEFT }, /* left arrow */ |
| 227 | { 0x00, 0x28, KEY_ENTER }, /* Enter / ok */ |
| 228 | { 0x02, 0x52, KEY_VOLUMEUP }, |
| 229 | { 0x02, 0x51, KEY_VOLUMEDOWN }, |
| 230 | { 0x00, 0x4e, KEY_CHANNELDOWN }, |
| 231 | { 0x00, 0x4b, KEY_CHANNELUP }, |
| 232 | { 0x00, 0x4a, KEY_RECORD }, |
| 233 | { 0x01, 0x11, KEY_PLAY }, |
| 234 | { 0x00, 0x17, KEY_PAUSE }, |
| 235 | { 0x00, 0x0c, KEY_REWIND }, /* FR << */ |
| 236 | { 0x00, 0x11, KEY_FASTFORWARD }, /* FF >> */ |
| 237 | { 0x01, 0x15, KEY_PREVIOUS }, /* Replay */ |
| 238 | { 0x01, 0x0e, KEY_NEXT }, /* Skip */ |
| 239 | { 0x00, 0x13, KEY_CAMERA }, /* Capture */ |
| 240 | { 0x01, 0x0f, KEY_LANGUAGE }, /* SAP */ |
| 241 | { 0x01, 0x13, KEY_TV2 }, /* PIP */ |
| 242 | { 0x00, 0x1d, KEY_ZOOM }, /* Full Screen */ |
| 243 | { 0x01, 0x17, KEY_SUBTITLE }, /* Subtitle / CC */ |
| 244 | { 0x00, 0x10, KEY_MUTE }, |
| 245 | { 0x01, 0x19, KEY_AUDIO }, /* L/R */ /* TODO better event */ |
| 246 | { 0x01, 0x16, KEY_SLEEP }, /* Hibernate */ |
| 247 | { 0x01, 0x16, KEY_SWITCHVIDEOMODE }, |
| 248 | /* A/V */ /* TODO does not work */ |
| 249 | { 0x00, 0x06, KEY_AGAIN }, /* Recall */ |
| 250 | { 0x01, 0x16, KEY_KPPLUS }, /* Zoom+ */ /* TODO does not work */ |
| 251 | { 0x01, 0x16, KEY_KPMINUS }, /* Zoom- */ /* TODO does not work */ |
| 252 | { 0x02, 0x15, KEY_RED }, |
| 253 | { 0x02, 0x0a, KEY_GREEN }, |
| 254 | { 0x02, 0x1c, KEY_YELLOW }, |
| 255 | { 0x02, 0x05, KEY_BLUE }, |
| 256 | }; |
| 257 | |
| 258 | static u8 af9015_ir_table_twinhan[] = { |
| 259 | 0x00, 0xff, 0x16, 0xe9, 0x3f, 0x05, 0x00, |
| 260 | 0x00, 0xff, 0x07, 0xf8, 0x16, 0x01, 0x00, |
| 261 | 0x00, 0xff, 0x14, 0xeb, 0x11, 0x01, 0x00, |
| 262 | 0x00, 0xff, 0x1a, 0xe5, 0x4d, 0x00, 0x00, |
| 263 | 0x00, 0xff, 0x4c, 0xb3, 0x17, 0x00, 0x00, |
| 264 | 0x00, 0xff, 0x12, 0xed, 0x11, 0x00, 0x00, |
| 265 | 0x00, 0xff, 0x40, 0xbf, 0x0c, 0x00, 0x00, |
| 266 | 0x00, 0xff, 0x11, 0xee, 0x4a, 0x00, 0x00, |
| 267 | 0x00, 0xff, 0x54, 0xab, 0x13, 0x00, 0x00, |
| 268 | 0x00, 0xff, 0x41, 0xbe, 0x15, 0x01, 0x00, |
| 269 | 0x00, 0xff, 0x42, 0xbd, 0x0e, 0x01, 0x00, |
| 270 | 0x00, 0xff, 0x43, 0xbc, 0x17, 0x01, 0x00, |
| 271 | 0x00, 0xff, 0x50, 0xaf, 0x0f, 0x01, 0x00, |
| 272 | 0x00, 0xff, 0x4d, 0xb2, 0x1d, 0x00, 0x00, |
| 273 | 0x00, 0xff, 0x47, 0xb8, 0x13, 0x01, 0x00, |
| 274 | 0x00, 0xff, 0x05, 0xfa, 0x4b, 0x00, 0x00, |
| 275 | 0x00, 0xff, 0x02, 0xfd, 0x4e, 0x00, 0x00, |
| 276 | 0x00, 0xff, 0x0e, 0xf1, 0x06, 0x00, 0x00, |
| 277 | 0x00, 0xff, 0x1e, 0xe1, 0x52, 0x02, 0x00, |
| 278 | 0x00, 0xff, 0x0a, 0xf5, 0x51, 0x02, 0x00, |
| 279 | 0x00, 0xff, 0x10, 0xef, 0x10, 0x00, 0x00, |
| 280 | 0x00, 0xff, 0x49, 0xb6, 0x19, 0x01, 0x00, |
| 281 | 0x00, 0xff, 0x15, 0xea, 0x27, 0x00, 0x00, |
| 282 | 0x00, 0xff, 0x03, 0xfc, 0x1e, 0x00, 0x00, |
| 283 | 0x00, 0xff, 0x01, 0xfe, 0x1f, 0x00, 0x00, |
| 284 | 0x00, 0xff, 0x06, 0xf9, 0x20, 0x00, 0x00, |
| 285 | 0x00, 0xff, 0x09, 0xf6, 0x21, 0x00, 0x00, |
| 286 | 0x00, 0xff, 0x1d, 0xe2, 0x22, 0x00, 0x00, |
| 287 | 0x00, 0xff, 0x1f, 0xe0, 0x23, 0x00, 0x00, |
| 288 | 0x00, 0xff, 0x0d, 0xf2, 0x24, 0x00, 0x00, |
| 289 | 0x00, 0xff, 0x19, 0xe6, 0x25, 0x00, 0x00, |
| 290 | 0x00, 0xff, 0x1b, 0xe4, 0x26, 0x00, 0x00, |
| 291 | 0x00, 0xff, 0x00, 0xff, 0x2b, 0x00, 0x00, |
| 292 | 0x00, 0xff, 0x4a, 0xb5, 0x4c, 0x00, 0x00, |
| 293 | 0x00, 0xff, 0x4b, 0xb4, 0x52, 0x00, 0x00, |
| 294 | 0x00, 0xff, 0x51, 0xae, 0x51, 0x00, 0x00, |
| 295 | 0x00, 0xff, 0x52, 0xad, 0x4f, 0x00, 0x00, |
| 296 | 0x00, 0xff, 0x4e, 0xb1, 0x50, 0x00, 0x00, |
| 297 | 0x00, 0xff, 0x0c, 0xf3, 0x29, 0x00, 0x00, |
| 298 | 0x00, 0xff, 0x4f, 0xb0, 0x28, 0x00, 0x00, |
| 299 | 0x00, 0xff, 0x13, 0xec, 0x2a, 0x00, 0x00, |
| 300 | 0x00, 0xff, 0x17, 0xe8, 0x19, 0x00, 0x00, |
| 301 | 0x00, 0xff, 0x04, 0xfb, 0x0f, 0x00, 0x00, |
| 302 | 0x00, 0xff, 0x48, 0xb7, 0x0e, 0x00, 0x00, |
| 303 | 0x00, 0xff, 0x0f, 0xf0, 0x04, 0x00, 0x00, |
| 304 | 0x00, 0xff, 0x1c, 0xe3, 0x08, 0x00, 0x00, |
| 305 | 0x00, 0xff, 0x18, 0xe7, 0x15, 0x02, 0x00, |
| 306 | 0x00, 0xff, 0x53, 0xac, 0x0a, 0x02, 0x00, |
| 307 | 0x00, 0xff, 0x5e, 0xa1, 0x1c, 0x02, 0x00, |
| 308 | 0x00, 0xff, 0x5f, 0xa0, 0x05, 0x02, 0x00, |
| 309 | }; |
| 310 | |
| 311 | /* A-Link DTU(m) */ |
| 312 | static struct dvb_usb_rc_key af9015_rc_keys_a_link[] = { |
| 313 | { 0x00, 0x1e, KEY_1 }, |
| 314 | { 0x00, 0x1f, KEY_2 }, |
| 315 | { 0x00, 0x20, KEY_3 }, |
| 316 | { 0x00, 0x21, KEY_4 }, |
| 317 | { 0x00, 0x22, KEY_5 }, |
| 318 | { 0x00, 0x23, KEY_6 }, |
| 319 | { 0x00, 0x24, KEY_7 }, |
| 320 | { 0x00, 0x25, KEY_8 }, |
| 321 | { 0x00, 0x26, KEY_9 }, |
| 322 | { 0x00, 0x27, KEY_0 }, |
| 323 | { 0x00, 0x2e, KEY_CHANNELUP }, |
| 324 | { 0x00, 0x2d, KEY_CHANNELDOWN }, |
| 325 | { 0x04, 0x28, KEY_ZOOM }, |
| 326 | { 0x00, 0x41, KEY_MUTE }, |
| 327 | { 0x00, 0x42, KEY_VOLUMEDOWN }, |
| 328 | { 0x00, 0x43, KEY_VOLUMEUP }, |
| 329 | { 0x00, 0x44, KEY_GOTO }, /* jump */ |
| 330 | { 0x05, 0x45, KEY_POWER }, |
| 331 | }; |
| 332 | |
| 333 | static u8 af9015_ir_table_a_link[] = { |
| 334 | 0x08, 0xf7, 0x12, 0xed, 0x45, 0x05, 0x00, /* power */ |
| 335 | 0x08, 0xf7, 0x1a, 0xe5, 0x41, 0x00, 0x00, /* mute */ |
| 336 | 0x08, 0xf7, 0x01, 0xfe, 0x1e, 0x00, 0x00, /* 1 */ |
| 337 | 0x08, 0xf7, 0x1c, 0xe3, 0x21, 0x00, 0x00, /* 4 */ |
| 338 | 0x08, 0xf7, 0x03, 0xfc, 0x24, 0x00, 0x00, /* 7 */ |
| 339 | 0x08, 0xf7, 0x05, 0xfa, 0x28, 0x04, 0x00, /* zoom */ |
| 340 | 0x08, 0xf7, 0x00, 0xff, 0x43, 0x00, 0x00, /* volume up */ |
| 341 | 0x08, 0xf7, 0x16, 0xe9, 0x42, 0x00, 0x00, /* volume down */ |
| 342 | 0x08, 0xf7, 0x0f, 0xf0, 0x1f, 0x00, 0x00, /* 2 */ |
| 343 | 0x08, 0xf7, 0x0d, 0xf2, 0x22, 0x00, 0x00, /* 5 */ |
| 344 | 0x08, 0xf7, 0x1b, 0xe4, 0x25, 0x00, 0x00, /* 8 */ |
| 345 | 0x08, 0xf7, 0x06, 0xf9, 0x27, 0x00, 0x00, /* 0 */ |
| 346 | 0x08, 0xf7, 0x14, 0xeb, 0x2e, 0x00, 0x00, /* channel up */ |
| 347 | 0x08, 0xf7, 0x1d, 0xe2, 0x2d, 0x00, 0x00, /* channel down */ |
| 348 | 0x08, 0xf7, 0x02, 0xfd, 0x20, 0x00, 0x00, /* 3 */ |
| 349 | 0x08, 0xf7, 0x18, 0xe7, 0x23, 0x00, 0x00, /* 6 */ |
| 350 | 0x08, 0xf7, 0x04, 0xfb, 0x26, 0x00, 0x00, /* 9 */ |
| 351 | 0x08, 0xf7, 0x07, 0xf8, 0x44, 0x00, 0x00, /* jump */ |
| 352 | }; |
| 353 | |
| 354 | /* MSI DIGIVOX mini II V3.0 */ |
| 355 | static struct dvb_usb_rc_key af9015_rc_keys_msi[] = { |
| 356 | { 0x00, 0x1e, KEY_1 }, |
| 357 | { 0x00, 0x1f, KEY_2 }, |
| 358 | { 0x00, 0x20, KEY_3 }, |
| 359 | { 0x00, 0x21, KEY_4 }, |
| 360 | { 0x00, 0x22, KEY_5 }, |
| 361 | { 0x00, 0x23, KEY_6 }, |
| 362 | { 0x00, 0x24, KEY_7 }, |
| 363 | { 0x00, 0x25, KEY_8 }, |
| 364 | { 0x00, 0x26, KEY_9 }, |
| 365 | { 0x00, 0x27, KEY_0 }, |
| 366 | { 0x03, 0x0f, KEY_CHANNELUP }, |
| 367 | { 0x03, 0x0e, KEY_CHANNELDOWN }, |
| 368 | { 0x00, 0x42, KEY_VOLUMEDOWN }, |
| 369 | { 0x00, 0x43, KEY_VOLUMEUP }, |
| 370 | { 0x05, 0x45, KEY_POWER }, |
| 371 | { 0x00, 0x52, KEY_UP }, /* up */ |
| 372 | { 0x00, 0x51, KEY_DOWN }, /* down */ |
| 373 | { 0x00, 0x28, KEY_ENTER }, |
| 374 | }; |
| 375 | |
| 376 | static u8 af9015_ir_table_msi[] = { |
| 377 | 0x03, 0xfc, 0x17, 0xe8, 0x45, 0x05, 0x00, /* power */ |
| 378 | 0x03, 0xfc, 0x0d, 0xf2, 0x51, 0x00, 0x00, /* down */ |
| 379 | 0x03, 0xfc, 0x03, 0xfc, 0x52, 0x00, 0x00, /* up */ |
| 380 | 0x03, 0xfc, 0x1a, 0xe5, 0x1e, 0x00, 0x00, /* 1 */ |
| 381 | 0x03, 0xfc, 0x02, 0xfd, 0x1f, 0x00, 0x00, /* 2 */ |
| 382 | 0x03, 0xfc, 0x04, 0xfb, 0x20, 0x00, 0x00, /* 3 */ |
| 383 | 0x03, 0xfc, 0x1c, 0xe3, 0x21, 0x00, 0x00, /* 4 */ |
| 384 | 0x03, 0xfc, 0x08, 0xf7, 0x22, 0x00, 0x00, /* 5 */ |
| 385 | 0x03, 0xfc, 0x1d, 0xe2, 0x23, 0x00, 0x00, /* 6 */ |
| 386 | 0x03, 0xfc, 0x11, 0xee, 0x24, 0x00, 0x00, /* 7 */ |
| 387 | 0x03, 0xfc, 0x0b, 0xf4, 0x25, 0x00, 0x00, /* 8 */ |
| 388 | 0x03, 0xfc, 0x10, 0xef, 0x26, 0x00, 0x00, /* 9 */ |
| 389 | 0x03, 0xfc, 0x09, 0xf6, 0x27, 0x00, 0x00, /* 0 */ |
| 390 | 0x03, 0xfc, 0x14, 0xeb, 0x43, 0x00, 0x00, /* volume up */ |
| 391 | 0x03, 0xfc, 0x1f, 0xe0, 0x42, 0x00, 0x00, /* volume down */ |
| 392 | 0x03, 0xfc, 0x15, 0xea, 0x0f, 0x03, 0x00, /* channel up */ |
| 393 | 0x03, 0xfc, 0x05, 0xfa, 0x0e, 0x03, 0x00, /* channel down */ |
| 394 | 0x03, 0xfc, 0x16, 0xe9, 0x28, 0x00, 0x00, /* enter */ |
| 395 | }; |
| 396 | |
| 397 | /* MYGICTV U718 */ |
| 398 | static struct dvb_usb_rc_key af9015_rc_keys_mygictv[] = { |
| 399 | { 0x00, 0x3d, KEY_SWITCHVIDEOMODE }, |
| 400 | /* TV / AV */ |
| 401 | { 0x05, 0x45, KEY_POWER }, |
| 402 | { 0x00, 0x1e, KEY_1 }, |
| 403 | { 0x00, 0x1f, KEY_2 }, |
| 404 | { 0x00, 0x20, KEY_3 }, |
| 405 | { 0x00, 0x21, KEY_4 }, |
| 406 | { 0x00, 0x22, KEY_5 }, |
| 407 | { 0x00, 0x23, KEY_6 }, |
| 408 | { 0x00, 0x24, KEY_7 }, |
| 409 | { 0x00, 0x25, KEY_8 }, |
| 410 | { 0x00, 0x26, KEY_9 }, |
| 411 | { 0x00, 0x27, KEY_0 }, |
| 412 | { 0x00, 0x41, KEY_MUTE }, |
| 413 | { 0x00, 0x2a, KEY_ESC }, /* Esc */ |
| 414 | { 0x00, 0x2e, KEY_CHANNELUP }, |
| 415 | { 0x00, 0x2d, KEY_CHANNELDOWN }, |
| 416 | { 0x00, 0x42, KEY_VOLUMEDOWN }, |
| 417 | { 0x00, 0x43, KEY_VOLUMEUP }, |
| 418 | { 0x00, 0x52, KEY_UP }, /* up arrow */ |
| 419 | { 0x00, 0x51, KEY_DOWN }, /* down arrow */ |
| 420 | { 0x00, 0x4f, KEY_RIGHT }, /* right arrow */ |
| 421 | { 0x00, 0x50, KEY_LEFT }, /* left arrow */ |
| 422 | { 0x00, 0x28, KEY_ENTER }, /* ok */ |
| 423 | { 0x01, 0x15, KEY_RECORD }, |
| 424 | { 0x03, 0x13, KEY_PLAY }, |
| 425 | { 0x01, 0x13, KEY_PAUSE }, |
| 426 | { 0x01, 0x16, KEY_STOP }, |
| 427 | { 0x03, 0x07, KEY_REWIND }, /* FR << */ |
| 428 | { 0x03, 0x09, KEY_FASTFORWARD }, /* FF >> */ |
| 429 | { 0x00, 0x3b, KEY_TIME }, /* TimeShift */ |
| 430 | { 0x00, 0x3e, KEY_CAMERA }, /* Snapshot */ |
| 431 | { 0x03, 0x16, KEY_CYCLEWINDOWS }, /* yellow, min / max */ |
| 432 | { 0x00, 0x00, KEY_ZOOM }, /* 'select' (?) */ |
| 433 | { 0x03, 0x16, KEY_SHUFFLE }, /* Shuffle */ |
| 434 | { 0x03, 0x45, KEY_POWER }, |
| 435 | }; |
| 436 | |
| 437 | static u8 af9015_ir_table_mygictv[] = { |
| 438 | 0x02, 0xbd, 0x0c, 0xf3, 0x3d, 0x00, 0x00, /* TV / AV */ |
| 439 | 0x02, 0xbd, 0x14, 0xeb, 0x45, 0x05, 0x00, /* power */ |
| 440 | 0x02, 0xbd, 0x00, 0xff, 0x1e, 0x00, 0x00, /* 1 */ |
| 441 | 0x02, 0xbd, 0x01, 0xfe, 0x1f, 0x00, 0x00, /* 2 */ |
| 442 | 0x02, 0xbd, 0x02, 0xfd, 0x20, 0x00, 0x00, /* 3 */ |
| 443 | 0x02, 0xbd, 0x03, 0xfc, 0x21, 0x00, 0x00, /* 4 */ |
| 444 | 0x02, 0xbd, 0x04, 0xfb, 0x22, 0x00, 0x00, /* 5 */ |
| 445 | 0x02, 0xbd, 0x05, 0xfa, 0x23, 0x00, 0x00, /* 6 */ |
| 446 | 0x02, 0xbd, 0x06, 0xf9, 0x24, 0x00, 0x00, /* 7 */ |
| 447 | 0x02, 0xbd, 0x07, 0xf8, 0x25, 0x00, 0x00, /* 8 */ |
| 448 | 0x02, 0xbd, 0x08, 0xf7, 0x26, 0x00, 0x00, /* 9 */ |
| 449 | 0x02, 0xbd, 0x09, 0xf6, 0x27, 0x00, 0x00, /* 0 */ |
| 450 | 0x02, 0xbd, 0x0a, 0xf5, 0x41, 0x00, 0x00, /* mute */ |
| 451 | 0x02, 0xbd, 0x1c, 0xe3, 0x2a, 0x00, 0x00, /* esc */ |
| 452 | 0x02, 0xbd, 0x1f, 0xe0, 0x43, 0x00, 0x00, /* volume up */ |
| 453 | 0x02, 0xbd, 0x12, 0xed, 0x52, 0x00, 0x00, /* up arrow */ |
| 454 | 0x02, 0xbd, 0x11, 0xee, 0x50, 0x00, 0x00, /* left arrow */ |
| 455 | 0x02, 0xbd, 0x15, 0xea, 0x28, 0x00, 0x00, /* ok */ |
| 456 | 0x02, 0xbd, 0x10, 0xef, 0x4f, 0x00, 0x00, /* right arrow */ |
| 457 | 0x02, 0xbd, 0x13, 0xec, 0x51, 0x00, 0x00, /* down arrow */ |
| 458 | 0x02, 0xbd, 0x0e, 0xf1, 0x42, 0x00, 0x00, /* volume down */ |
| 459 | 0x02, 0xbd, 0x19, 0xe6, 0x15, 0x01, 0x00, /* record */ |
| 460 | 0x02, 0xbd, 0x1e, 0xe1, 0x13, 0x03, 0x00, /* play */ |
| 461 | 0x02, 0xbd, 0x16, 0xe9, 0x16, 0x01, 0x00, /* stop */ |
| 462 | 0x02, 0xbd, 0x0b, 0xf4, 0x28, 0x04, 0x00, /* yellow, min / max */ |
| 463 | 0x02, 0xbd, 0x0f, 0xf0, 0x3b, 0x00, 0x00, /* time shift */ |
| 464 | 0x02, 0xbd, 0x18, 0xe7, 0x2e, 0x00, 0x00, /* channel up */ |
| 465 | 0x02, 0xbd, 0x1a, 0xe5, 0x2d, 0x00, 0x00, /* channel down */ |
| 466 | 0x02, 0xbd, 0x17, 0xe8, 0x3e, 0x00, 0x00, /* snapshot */ |
| 467 | 0x02, 0xbd, 0x40, 0xbf, 0x13, 0x01, 0x00, /* pause */ |
| 468 | 0x02, 0xbd, 0x41, 0xbe, 0x09, 0x03, 0x00, /* FF >> */ |
| 469 | 0x02, 0xbd, 0x42, 0xbd, 0x07, 0x03, 0x00, /* FR << */ |
| 470 | 0x02, 0xbd, 0x43, 0xbc, 0x00, 0x00, 0x00, /* 'select' (?) */ |
| 471 | 0x02, 0xbd, 0x44, 0xbb, 0x16, 0x03, 0x00, /* shuffle */ |
| 472 | 0x02, 0xbd, 0x45, 0xba, 0x45, 0x03, 0x00, /* power */ |
| 473 | }; |
| 474 | |
| 475 | /* KWorld PlusTV Dual DVB-T Stick (DVB-T 399U) */ |
| 476 | static u8 af9015_ir_table_kworld[] = { |
| 477 | 0x86, 0x6b, 0x0c, 0xf3, 0x2e, 0x07, 0x00, |
| 478 | 0x86, 0x6b, 0x16, 0xe9, 0x2d, 0x07, 0x00, |
| 479 | 0x86, 0x6b, 0x1d, 0xe2, 0x37, 0x07, 0x00, |
| 480 | 0x86, 0x6b, 0x00, 0xff, 0x1e, 0x07, 0x00, |
| 481 | 0x86, 0x6b, 0x01, 0xfe, 0x1f, 0x07, 0x00, |
| 482 | 0x86, 0x6b, 0x02, 0xfd, 0x20, 0x07, 0x00, |
| 483 | 0x86, 0x6b, 0x03, 0xfc, 0x21, 0x07, 0x00, |
| 484 | 0x86, 0x6b, 0x04, 0xfb, 0x22, 0x07, 0x00, |
| 485 | 0x86, 0x6b, 0x05, 0xfa, 0x23, 0x07, 0x00, |
| 486 | 0x86, 0x6b, 0x06, 0xf9, 0x24, 0x07, 0x00, |
| 487 | 0x86, 0x6b, 0x07, 0xf8, 0x25, 0x07, 0x00, |
| 488 | 0x86, 0x6b, 0x08, 0xf7, 0x26, 0x07, 0x00, |
| 489 | 0x86, 0x6b, 0x09, 0xf6, 0x4d, 0x07, 0x00, |
| 490 | 0x86, 0x6b, 0x0a, 0xf5, 0x4e, 0x07, 0x00, |
| 491 | 0x86, 0x6b, 0x14, 0xeb, 0x4f, 0x07, 0x00, |
| 492 | 0x86, 0x6b, 0x1e, 0xe1, 0x50, 0x07, 0x00, |
| 493 | 0x86, 0x6b, 0x17, 0xe8, 0x52, 0x07, 0x00, |
| 494 | 0x86, 0x6b, 0x1f, 0xe0, 0x51, 0x07, 0x00, |
| 495 | 0x86, 0x6b, 0x0e, 0xf1, 0x0b, 0x07, 0x00, |
| 496 | 0x86, 0x6b, 0x20, 0xdf, 0x0c, 0x07, 0x00, |
| 497 | 0x86, 0x6b, 0x42, 0xbd, 0x0d, 0x07, 0x00, |
| 498 | 0x86, 0x6b, 0x0b, 0xf4, 0x0e, 0x07, 0x00, |
| 499 | 0x86, 0x6b, 0x43, 0xbc, 0x0f, 0x07, 0x00, |
| 500 | 0x86, 0x6b, 0x10, 0xef, 0x10, 0x07, 0x00, |
| 501 | 0x86, 0x6b, 0x21, 0xde, 0x11, 0x07, 0x00, |
| 502 | 0x86, 0x6b, 0x13, 0xec, 0x12, 0x07, 0x00, |
| 503 | 0x86, 0x6b, 0x11, 0xee, 0x13, 0x07, 0x00, |
| 504 | 0x86, 0x6b, 0x12, 0xed, 0x14, 0x07, 0x00, |
| 505 | 0x86, 0x6b, 0x19, 0xe6, 0x15, 0x07, 0x00, |
| 506 | 0x86, 0x6b, 0x1a, 0xe5, 0x16, 0x07, 0x00, |
| 507 | 0x86, 0x6b, 0x1b, 0xe4, 0x17, 0x07, 0x00, |
| 508 | 0x86, 0x6b, 0x4b, 0xb4, 0x18, 0x07, 0x00, |
| 509 | 0x86, 0x6b, 0x40, 0xbf, 0x19, 0x07, 0x00, |
| 510 | 0x86, 0x6b, 0x44, 0xbb, 0x1a, 0x07, 0x00, |
| 511 | 0x86, 0x6b, 0x41, 0xbe, 0x1b, 0x07, 0x00, |
| 512 | 0x86, 0x6b, 0x22, 0xdd, 0x1c, 0x07, 0x00, |
| 513 | 0x86, 0x6b, 0x15, 0xea, 0x1d, 0x07, 0x00, |
| 514 | 0x86, 0x6b, 0x0f, 0xf0, 0x3f, 0x07, 0x00, |
| 515 | 0x86, 0x6b, 0x1c, 0xe3, 0x40, 0x07, 0x00, |
| 516 | 0x86, 0x6b, 0x4a, 0xb5, 0x41, 0x07, 0x00, |
| 517 | 0x86, 0x6b, 0x48, 0xb7, 0x42, 0x07, 0x00, |
| 518 | 0x86, 0x6b, 0x49, 0xb6, 0x43, 0x07, 0x00, |
| 519 | 0x86, 0x6b, 0x18, 0xe7, 0x44, 0x07, 0x00, |
| 520 | 0x86, 0x6b, 0x23, 0xdc, 0x45, 0x07, 0x00, |
| 521 | }; |
| 522 | |
| 523 | #endif |