diff options
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-input.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 112 |
1 files changed, 110 insertions, 2 deletions
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index ca50cf531f20..aba2b9de60de 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: saa7134-input.c,v 1.16 2004/12/10 12:33:39 kraxel Exp $ | 2 | * $Id: saa7134-input.c,v 1.19 2005/06/07 18:02:26 nsh Exp $ |
3 | * | 3 | * |
4 | * handle saa7134 IR remotes via linux kernel input layer. | 4 | * handle saa7134 IR remotes via linux kernel input layer. |
5 | * | 5 | * |
@@ -308,6 +308,102 @@ static IR_KEYTAB_TYPE videomate_tv_pvr_codes[IR_KEYTAB_SIZE] = { | |||
308 | [ 32 ] = KEY_LANGUAGE, | 308 | [ 32 ] = KEY_LANGUAGE, |
309 | [ 33 ] = KEY_SLEEP, | 309 | [ 33 ] = KEY_SLEEP, |
310 | }; | 310 | }; |
311 | |||
312 | /* Michael Tokarev <mjt@tls.msk.ru> | ||
313 | http://www.corpit.ru/mjt/beholdTV/remote_control.jpg | ||
314 | keytable is used by MANLI MTV00[12] and BeholdTV 40[13] at | ||
315 | least, and probably other cards too. | ||
316 | The "ascii-art picture" below (in comments, first row | ||
317 | is the keycode in hex, and subsequent row(s) shows | ||
318 | the button labels (several variants when appropriate) | ||
319 | helps to descide which keycodes to assign to the buttons. | ||
320 | */ | ||
321 | static IR_KEYTAB_TYPE manli_codes[IR_KEYTAB_SIZE] = { | ||
322 | |||
323 | /* 0x1c 0x12 * | ||
324 | * FUNCTION POWER * | ||
325 | * FM (|) * | ||
326 | * */ | ||
327 | [ 0x1c ] = KEY_RADIO, /*XXX*/ | ||
328 | [ 0x12 ] = KEY_POWER, | ||
329 | |||
330 | /* 0x01 0x02 0x03 * | ||
331 | * 1 2 3 * | ||
332 | * * | ||
333 | * 0x04 0x05 0x06 * | ||
334 | * 4 5 6 * | ||
335 | * * | ||
336 | * 0x07 0x08 0x09 * | ||
337 | * 7 8 9 * | ||
338 | * */ | ||
339 | [ 0x01 ] = KEY_KP1, | ||
340 | [ 0x02 ] = KEY_KP2, | ||
341 | [ 0x03 ] = KEY_KP3, | ||
342 | [ 0x04 ] = KEY_KP4, | ||
343 | [ 0x05 ] = KEY_KP5, | ||
344 | [ 0x06 ] = KEY_KP6, | ||
345 | [ 0x07 ] = KEY_KP7, | ||
346 | [ 0x08 ] = KEY_KP8, | ||
347 | [ 0x09 ] = KEY_KP9, | ||
348 | |||
349 | /* 0x0a 0x00 0x17 * | ||
350 | * RECALL 0 +100 * | ||
351 | * PLUS * | ||
352 | * */ | ||
353 | [ 0x0a ] = KEY_AGAIN, /*XXX KEY_REWIND? */ | ||
354 | [ 0x00 ] = KEY_KP0, | ||
355 | [ 0x17 ] = KEY_DIGITS, /*XXX*/ | ||
356 | |||
357 | /* 0x14 0x10 * | ||
358 | * MENU INFO * | ||
359 | * OSD */ | ||
360 | [ 0x14 ] = KEY_MENU, | ||
361 | [ 0x10 ] = KEY_INFO, | ||
362 | |||
363 | /* 0x0b * | ||
364 | * Up * | ||
365 | * * | ||
366 | * 0x18 0x16 0x0c * | ||
367 | * Left Ok Right * | ||
368 | * * | ||
369 | * 0x015 * | ||
370 | * Down * | ||
371 | * */ | ||
372 | [ 0x0b ] = KEY_UP, /*XXX KEY_SCROLLUP? */ | ||
373 | [ 0x18 ] = KEY_LEFT, /*XXX KEY_BACK? */ | ||
374 | [ 0x16 ] = KEY_OK, /*XXX KEY_SELECT? KEY_ENTER? */ | ||
375 | [ 0x0c ] = KEY_RIGHT, /*XXX KEY_FORWARD? */ | ||
376 | [ 0x15 ] = KEY_DOWN, /*XXX KEY_SCROLLDOWN? */ | ||
377 | |||
378 | /* 0x11 0x0d * | ||
379 | * TV/AV MODE * | ||
380 | * SOURCE STEREO * | ||
381 | * */ | ||
382 | [ 0x11 ] = KEY_TV, /*XXX*/ | ||
383 | [ 0x0d ] = KEY_MODE, /*XXX there's no KEY_STEREO */ | ||
384 | |||
385 | /* 0x0f 0x1b 0x1a * | ||
386 | * AUDIO Vol+ Chan+ * | ||
387 | * TIMESHIFT??? * | ||
388 | * * | ||
389 | * 0x0e 0x1f 0x1e * | ||
390 | * SLEEP Vol- Chan- * | ||
391 | * */ | ||
392 | [ 0x0f ] = KEY_AUDIO, | ||
393 | [ 0x1b ] = KEY_VOLUMEUP, | ||
394 | [ 0x1a ] = KEY_CHANNELUP, | ||
395 | [ 0x0e ] = KEY_SLEEP, /*XXX maybe KEY_PAUSE */ | ||
396 | [ 0x1f ] = KEY_VOLUMEDOWN, | ||
397 | [ 0x1e ] = KEY_CHANNELDOWN, | ||
398 | |||
399 | /* 0x13 0x19 * | ||
400 | * MUTE SNAPSHOT* | ||
401 | * */ | ||
402 | [ 0x13 ] = KEY_MUTE, | ||
403 | [ 0x19 ] = KEY_RECORD, /*XXX*/ | ||
404 | |||
405 | // 0x1d unused ? | ||
406 | }; | ||
311 | /* ---------------------------------------------------------------------- */ | 407 | /* ---------------------------------------------------------------------- */ |
312 | 408 | ||
313 | static int build_key(struct saa7134_dev *dev) | 409 | static int build_key(struct saa7134_dev *dev) |
@@ -379,7 +475,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
379 | switch (dev->board) { | 475 | switch (dev->board) { |
380 | case SAA7134_BOARD_FLYVIDEO2000: | 476 | case SAA7134_BOARD_FLYVIDEO2000: |
381 | case SAA7134_BOARD_FLYVIDEO3000: | 477 | case SAA7134_BOARD_FLYVIDEO3000: |
382 | case SAA7134_BOARD_FLYTVPLATINUM_FM: | 478 | case SAA7134_BOARD_FLYTVPLATINUM_FM: |
383 | ir_codes = flyvideo_codes; | 479 | ir_codes = flyvideo_codes; |
384 | mask_keycode = 0xEC00000; | 480 | mask_keycode = 0xEC00000; |
385 | mask_keydown = 0x0040000; | 481 | mask_keydown = 0x0040000; |
@@ -405,8 +501,12 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
405 | polling = 50; // ms | 501 | polling = 50; // ms |
406 | break; | 502 | break; |
407 | case SAA7134_BOARD_MD2819: | 503 | case SAA7134_BOARD_MD2819: |
504 | case SAA7134_BOARD_KWORLD_VSTREAM_XPERT: | ||
408 | case SAA7134_BOARD_AVERMEDIA_305: | 505 | case SAA7134_BOARD_AVERMEDIA_305: |
409 | case SAA7134_BOARD_AVERMEDIA_307: | 506 | case SAA7134_BOARD_AVERMEDIA_307: |
507 | case SAA7134_BOARD_AVERMEDIA_STUDIO_305: | ||
508 | case SAA7134_BOARD_AVERMEDIA_STUDIO_307: | ||
509 | case SAA7134_BOARD_AVERMEDIA_GO_007_FM: | ||
410 | ir_codes = md2819_codes; | 510 | ir_codes = md2819_codes; |
411 | mask_keycode = 0x0007C8; | 511 | mask_keycode = 0x0007C8; |
412 | mask_keydown = 0x000010; | 512 | mask_keydown = 0x000010; |
@@ -415,6 +515,14 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
415 | saa_setb(SAA7134_GPIO_GPMODE0, 0x4); | 515 | saa_setb(SAA7134_GPIO_GPMODE0, 0x4); |
416 | saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); | 516 | saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4); |
417 | break; | 517 | break; |
518 | case SAA7134_BOARD_MANLI_MTV001: | ||
519 | case SAA7134_BOARD_MANLI_MTV002: | ||
520 | ir_codes = manli_codes; | ||
521 | mask_keycode = 0x001f00; | ||
522 | mask_keyup = 0x004000; | ||
523 | mask_keydown = 0x002000; | ||
524 | polling = 50; // ms | ||
525 | break; | ||
418 | case SAA7134_BOARD_VIDEOMATE_TV_PVR: | 526 | case SAA7134_BOARD_VIDEOMATE_TV_PVR: |
419 | ir_codes = videomate_tv_pvr_codes; | 527 | ir_codes = videomate_tv_pvr_codes; |
420 | mask_keycode = 0x00003F; | 528 | mask_keycode = 0x00003F; |