aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ir-kbd-gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ir-kbd-gpio.c')
-rw-r--r--drivers/media/video/ir-kbd-gpio.c99
1 files changed, 85 insertions, 14 deletions
diff --git a/drivers/media/video/ir-kbd-gpio.c b/drivers/media/video/ir-kbd-gpio.c
index 234151e48ed..ed81934ef3c 100644
--- a/drivers/media/video/ir-kbd-gpio.c
+++ b/drivers/media/video/ir-kbd-gpio.c
@@ -156,6 +156,71 @@ static IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE] = {
156 156
157/* ---------------------------------------------------------------------- */ 157/* ---------------------------------------------------------------------- */
158 158
159/* Ricardo Cerqueira <v4l@cerqueira.org> */
160/* Weird matching, since the remote has "uncommon" keys */
161
162static IR_KEYTAB_TYPE ir_codes_conceptronic[IR_KEYTAB_SIZE] = {
163
164 [ 30 ] = KEY_POWER, // power
165 [ 7 ] = KEY_MEDIA, // source
166 [ 28 ] = KEY_SEARCH, // scan
167
168/* FIXME: duplicate keycodes?
169 *
170 * These four keys seem to share the same GPIO as CH+, CH-, <<< and >>>
171 * The GPIO values are
172 * 6397fb for both "Scan <" and "CH -",
173 * 639ffb for "Scan >" and "CH+",
174 * 6384fb for "Tune <" and "<<<",
175 * 638cfb for "Tune >" and ">>>", regardless of the mask.
176 *
177 * [ 23 ] = KEY_BACK, // fm scan <<
178 * [ 31 ] = KEY_FORWARD, // fm scan >>
179 *
180 * [ 4 ] = KEY_LEFT, // fm tuning <
181 * [ 12 ] = KEY_RIGHT, // fm tuning >
182 *
183 * For now, these four keys are disabled. Pressing them will generate
184 * the CH+/CH-/<<</>>> events
185 */
186
187 [ 3 ] = KEY_TUNER, // TV/FM
188
189 [ 0 ] = KEY_RECORD,
190 [ 8 ] = KEY_STOP,
191 [ 17 ] = KEY_PLAY,
192
193 [ 26 ] = KEY_PLAYPAUSE, // freeze
194 [ 25 ] = KEY_ZOOM, // zoom
195 [ 15 ] = KEY_TEXT, // min
196
197 [ 1 ] = KEY_KP1,
198 [ 11 ] = KEY_KP2,
199 [ 27 ] = KEY_KP3,
200 [ 5 ] = KEY_KP4,
201 [ 9 ] = KEY_KP5,
202 [ 21 ] = KEY_KP6,
203 [ 6 ] = KEY_KP7,
204 [ 10 ] = KEY_KP8,
205 [ 18 ] = KEY_KP9,
206 [ 2 ] = KEY_KP0,
207 [ 16 ] = KEY_LAST, // +100
208 [ 19 ] = KEY_LIST, // recall
209
210 [ 31 ] = KEY_CHANNELUP, // chn down
211 [ 23 ] = KEY_CHANNELDOWN, // chn up
212 [ 22 ] = KEY_VOLUMEUP, // vol down
213 [ 20 ] = KEY_VOLUMEDOWN, // vol up
214
215 [ 4 ] = KEY_KPMINUS, // <<<
216 [ 14 ] = KEY_SETUP, // function
217 [ 12 ] = KEY_KPPLUS, // >>>
218
219 [ 13 ] = KEY_GOTO, // mts
220 [ 29 ] = KEY_REFRESH, // reset
221 [ 24 ] = KEY_MUTE // mute/unmute
222};
223
159struct IR { 224struct IR {
160 struct bttv_sub_device *sub; 225 struct bttv_sub_device *sub;
161 struct input_dev *input; 226 struct input_dev *input;
@@ -282,53 +347,59 @@ static int ir_probe(struct device *dev)
282 347
283 /* detect & configure */ 348 /* detect & configure */
284 switch (sub->core->type) { 349 switch (sub->core->type) {
285 case BTTV_AVERMEDIA: 350 case BTTV_BOARD_AVERMEDIA:
286 case BTTV_AVPHONE98: 351 case BTTV_BOARD_AVPHONE98:
287 case BTTV_AVERMEDIA98: 352 case BTTV_BOARD_AVERMEDIA98:
288 ir_codes = ir_codes_avermedia; 353 ir_codes = ir_codes_avermedia;
289 ir->mask_keycode = 0xf88000; 354 ir->mask_keycode = 0xf88000;
290 ir->mask_keydown = 0x010000; 355 ir->mask_keydown = 0x010000;
291 ir->polling = 50; // ms 356 ir->polling = 50; // ms
292 break; 357 break;
293 358
294 case BTTV_AVDVBT_761: 359 case BTTV_BOARD_AVDVBT_761:
295 case BTTV_AVDVBT_771: 360 case BTTV_BOARD_AVDVBT_771:
296 ir_codes = ir_codes_avermedia_dvbt; 361 ir_codes = ir_codes_avermedia_dvbt;
297 ir->mask_keycode = 0x0f00c0; 362 ir->mask_keycode = 0x0f00c0;
298 ir->mask_keydown = 0x000020; 363 ir->mask_keydown = 0x000020;
299 ir->polling = 50; // ms 364 ir->polling = 50; // ms
300 break; 365 break;
301 366
302 case BTTV_PXELVWPLTVPAK: 367 case BTTV_BOARD_PXELVWPLTVPAK:
303 ir_codes = ir_codes_pixelview; 368 ir_codes = ir_codes_pixelview;
304 ir->mask_keycode = 0x003e00; 369 ir->mask_keycode = 0x003e00;
305 ir->mask_keyup = 0x010000; 370 ir->mask_keyup = 0x010000;
306 ir->polling = 50; // ms 371 ir->polling = 50; // ms
307 break; 372 break;
308 case BTTV_PV_BT878P_9B: 373 case BTTV_BOARD_PV_BT878P_9B:
309 case BTTV_PV_BT878P_PLUS: 374 case BTTV_BOARD_PV_BT878P_PLUS:
310 ir_codes = ir_codes_pixelview; 375 ir_codes = ir_codes_pixelview;
311 ir->mask_keycode = 0x001f00; 376 ir->mask_keycode = 0x001f00;
312 ir->mask_keyup = 0x008000; 377 ir->mask_keyup = 0x008000;
313 ir->polling = 50; // ms 378 ir->polling = 50; // ms
314 break; 379 break;
315 380
316 case BTTV_WINFAST2000: 381 case BTTV_BOARD_WINFAST2000:
317 ir_codes = ir_codes_winfast; 382 ir_codes = ir_codes_winfast;
318 ir->mask_keycode = 0x1f8; 383 ir->mask_keycode = 0x1f8;
319 break; 384 break;
320 case BTTV_MAGICTVIEW061: 385 case BTTV_BOARD_MAGICTVIEW061:
321 case BTTV_MAGICTVIEW063: 386 case BTTV_BOARD_MAGICTVIEW063:
322 ir_codes = ir_codes_winfast; 387 ir_codes = ir_codes_winfast;
323 ir->mask_keycode = 0x0008e000; 388 ir->mask_keycode = 0x0008e000;
324 ir->mask_keydown = 0x00200000; 389 ir->mask_keydown = 0x00200000;
325 break; 390 break;
326 case BTTV_APAC_VIEWCOMP: 391 case BTTV_BOARD_APAC_VIEWCOMP:
327 ir_codes = ir_codes_apac_viewcomp; 392 ir_codes = ir_codes_apac_viewcomp;
328 ir->mask_keycode = 0x001f00; 393 ir->mask_keycode = 0x001f00;
329 ir->mask_keyup = 0x008000; 394 ir->mask_keyup = 0x008000;
330 ir->polling = 50; // ms 395 ir->polling = 50; // ms
331 break; 396 break;
397 case BTTV_BOARD_CONCEPTRONIC_CTVFMI2:
398 ir_codes = ir_codes_conceptronic;
399 ir->mask_keycode = 0x001F00;
400 ir->mask_keyup = 0x006000;
401 ir->polling = 50; // ms
402 break;
332 } 403 }
333 if (NULL == ir_codes) { 404 if (NULL == ir_codes) {
334 kfree(ir); 405 kfree(ir);