aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-07-31 21:56:00 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 15:43:47 -0400
commit72b393106bddc9f0a1ab502b4c8c5793a0441a30 (patch)
tree79c11bf292f33c0ff2a3f5657e40d118ba407aea /drivers/media/dvb
parentd700226902a62a3b6f3563782d569c0e2af74397 (diff)
V4L/DVB: Port dib0700 to rc-core
Use the new rc-core handler at dvb-usb-remote for dib0700 driver. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_core.c84
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c455
2 files changed, 94 insertions, 445 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
index 527b1e69df6c..164fa9c3bec1 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -491,14 +491,11 @@ struct dib0700_rc_response {
491static void dib0700_rc_urb_completion(struct urb *purb) 491static void dib0700_rc_urb_completion(struct urb *purb)
492{ 492{
493 struct dvb_usb_device *d = purb->context; 493 struct dvb_usb_device *d = purb->context;
494 struct ir_scancode *keymap;
495 struct dib0700_state *st; 494 struct dib0700_state *st;
496 struct dib0700_rc_response poll_reply; 495 struct dib0700_rc_response poll_reply;
497 u8 *buf; 496 u8 *buf;
498 int found = 0; 497 u32 keycode;
499 u32 event; 498 u8 toggle;
500 int state;
501 int i;
502 499
503 deb_info("%s()\n", __func__); 500 deb_info("%s()\n", __func__);
504 if (d == NULL) 501 if (d == NULL)
@@ -510,7 +507,6 @@ static void dib0700_rc_urb_completion(struct urb *purb)
510 return; 507 return;
511 } 508 }
512 509
513 keymap = d->props.rc.legacy.rc_key_map;
514 st = d->priv; 510 st = d->priv;
515 buf = (u8 *)purb->transfer_buffer; 511 buf = (u8 *)purb->transfer_buffer;
516 512
@@ -525,21 +521,17 @@ static void dib0700_rc_urb_completion(struct urb *purb)
525 goto resubmit; 521 goto resubmit;
526 } 522 }
527 523
528 /* Set initial results in case we exit the function early */
529 event = 0;
530 state = REMOTE_NO_KEY_PRESSED;
531
532 deb_data("IR raw %02X %02X %02X %02X %02X %02X (len %d)\n", buf[0], 524 deb_data("IR raw %02X %02X %02X %02X %02X %02X (len %d)\n", buf[0],
533 buf[1], buf[2], buf[3], buf[4], buf[5], purb->actual_length); 525 buf[1], buf[2], buf[3], buf[4], buf[5], purb->actual_length);
534 526
535 switch (dvb_usb_dib0700_ir_proto) { 527 switch (dvb_usb_dib0700_ir_proto) {
536 case 0: 528 case 0:
537 /* NEC Protocol */ 529 /* NEC Protocol */
538 poll_reply.report_id = 0; 530 poll_reply.data_state = 0;
539 poll_reply.data_state = 1;
540 poll_reply.system = buf[2]; 531 poll_reply.system = buf[2];
541 poll_reply.data = buf[4]; 532 poll_reply.data = buf[4];
542 poll_reply.not_data = buf[5]; 533 poll_reply.not_data = buf[5];
534 toggle = 0;
543 535
544 /* NEC protocol sends repeat code as 0 0 0 FF */ 536 /* NEC protocol sends repeat code as 0 0 0 FF */
545 if ((poll_reply.system == 0x00) && (poll_reply.data == 0x00) 537 if ((poll_reply.system == 0x00) && (poll_reply.data == 0x00)
@@ -547,6 +539,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
547 poll_reply.data_state = 2; 539 poll_reply.data_state = 2;
548 break; 540 break;
549 } 541 }
542
550 break; 543 break;
551 default: 544 default:
552 /* RC5 Protocol */ 545 /* RC5 Protocol */
@@ -555,6 +548,9 @@ static void dib0700_rc_urb_completion(struct urb *purb)
555 poll_reply.system = (buf[2] << 8) | buf[3]; 548 poll_reply.system = (buf[2] << 8) | buf[3];
556 poll_reply.data = buf[4]; 549 poll_reply.data = buf[4];
557 poll_reply.not_data = buf[5]; 550 poll_reply.not_data = buf[5];
551
552 toggle = poll_reply.report_id;
553
558 break; 554 break;
559 } 555 }
560 556
@@ -570,59 +566,8 @@ static void dib0700_rc_urb_completion(struct urb *purb)
570 poll_reply.report_id, poll_reply.data_state, 566 poll_reply.report_id, poll_reply.data_state,
571 poll_reply.system, poll_reply.data, poll_reply.not_data); 567 poll_reply.system, poll_reply.data, poll_reply.not_data);
572 568
573 /* Find the key in the map */ 569 keycode = poll_reply.system << 8 | poll_reply.data;
574 for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) { 570 ir_keydown(d->rc_input_dev, keycode, toggle);
575 if (rc5_custom(&keymap[i]) == (poll_reply.system & 0xff) &&
576 rc5_data(&keymap[i]) == poll_reply.data) {
577 event = keymap[i].keycode;
578 found = 1;
579 break;
580 }
581 }
582
583 if (found == 0) {
584 err("Unknown remote controller key: %04x %02x %02x",
585 poll_reply.system, poll_reply.data, poll_reply.not_data);
586 d->last_event = 0;
587 goto resubmit;
588 }
589
590 if (poll_reply.data_state == 1) {
591 /* New key hit */
592 st->rc_counter = 0;
593 event = keymap[i].keycode;
594 state = REMOTE_KEY_PRESSED;
595 d->last_event = keymap[i].keycode;
596 } else if (poll_reply.data_state == 2) {
597 /* Key repeated */
598 st->rc_counter++;
599
600 /* prevents unwanted double hits */
601 if (st->rc_counter > RC_REPEAT_DELAY_V1_20) {
602 event = d->last_event;
603 state = REMOTE_KEY_PRESSED;
604 st->rc_counter = RC_REPEAT_DELAY_V1_20;
605 }
606 } else {
607 err("Unknown data state [%d]", poll_reply.data_state);
608 }
609
610 switch (state) {
611 case REMOTE_NO_KEY_PRESSED:
612 break;
613 case REMOTE_KEY_PRESSED:
614 deb_info("key pressed\n");
615 d->last_event = event;
616 case REMOTE_KEY_REPEAT:
617 deb_info("key repeated\n");
618 input_event(d->rc_input_dev, EV_KEY, event, 1);
619 input_sync(d->rc_input_dev);
620 input_event(d->rc_input_dev, EV_KEY, d->last_event, 0);
621 input_sync(d->rc_input_dev);
622 break;
623 default:
624 break;
625 }
626 571
627resubmit: 572resubmit:
628 /* Clean the buffer before we requeue */ 573 /* Clean the buffer before we requeue */
@@ -640,9 +585,6 @@ int dib0700_rc_setup(struct dvb_usb_device *d)
640 int ret; 585 int ret;
641 int i; 586 int i;
642 587
643 if (d->props.rc.legacy.rc_key_map == NULL)
644 return 0;
645
646 /* Set the IR mode */ 588 /* Set the IR mode */
647 i = dib0700_ctrl_wr(d, rc_setup, sizeof(rc_setup)); 589 i = dib0700_ctrl_wr(d, rc_setup, sizeof(rc_setup));
648 if (i < 0) { 590 if (i < 0) {
@@ -700,6 +642,12 @@ static int dib0700_probe(struct usb_interface *intf,
700 st->fw_version = fw_version; 642 st->fw_version = fw_version;
701 st->nb_packet_buffer_size = (u32)nb_packet_buffer_size; 643 st->nb_packet_buffer_size = (u32)nb_packet_buffer_size;
702 644
645 /* Disable polling mode on newer firmwares */
646 if (st->fw_version >= 0x10200)
647 dev->props.rc.core.bulk_mode = true;
648 else
649 dev->props.rc.core.bulk_mode = false;
650
703 dib0700_rc_setup(dev); 651 dib0700_rc_setup(dev);
704 652
705 return 0; 653 return 0;
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 2ae74ba3acbb..6e587cd1f515 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -473,15 +473,20 @@ static u8 rc_request[] = { REQUEST_POLL_RC, 0 };
473/* Number of keypresses to ignore before start repeating */ 473/* Number of keypresses to ignore before start repeating */
474#define RC_REPEAT_DELAY 6 474#define RC_REPEAT_DELAY 6
475 475
476static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) 476/*
477 * This function is used only when firmware is < 1.20 version. Newer
478 * firmwares use bulk mode, with functions implemented at dib0700_core,
479 * at dib0700_rc_urb_completion()
480 */
481static int dib0700_rc_query_old_firmware(struct dvb_usb_device *d)
477{ 482{
478 u8 key[4]; 483 u8 key[4];
484 u32 keycode;
485 u8 toggle;
479 int i; 486 int i;
480 struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map;
481 struct dib0700_state *st = d->priv; 487 struct dib0700_state *st = d->priv;
482 488
483 *event = 0; 489printk("%s\n", __func__);
484 *state = REMOTE_NO_KEY_PRESSED;
485 490
486 if (st->fw_version >= 0x10200) { 491 if (st->fw_version >= 0x10200) {
487 /* For 1.20 firmware , We need to keep the RC polling 492 /* For 1.20 firmware , We need to keep the RC polling
@@ -491,348 +496,45 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
491 return 0; 496 return 0;
492 } 497 }
493 498
494 i=dib0700_ctrl_rd(d,rc_request,2,key,4); 499 i = dib0700_ctrl_rd(d, rc_request, 2, key, 4);
495 if (i<=0) { 500 if (i <= 0) {
496 err("RC Query Failed"); 501 err("RC Query Failed");
497 return -1; 502 return -1;
498 } 503 }
499 504
500 /* losing half of KEY_0 events from Philipps rc5 remotes.. */ 505 /* losing half of KEY_0 events from Philipps rc5 remotes.. */
501 if (key[0]==0 && key[1]==0 && key[2]==0 && key[3]==0) return 0; 506 if (key[0] == 0 && key[1] == 0 && key[2] == 0 && key[3] == 0)
507 return 0;
502 508
503 /* info("%d: %2X %2X %2X %2X",dvb_usb_dib0700_ir_proto,(int)key[3-2],(int)key[3-3],(int)key[3-1],(int)key[3]); */ 509 /* info("%d: %2X %2X %2X %2X",dvb_usb_dib0700_ir_proto,(int)key[3-2],(int)key[3-3],(int)key[3-1],(int)key[3]); */
504 510
505 dib0700_rc_setup(d); /* reset ir sensor data to prevent false events */ 511 dib0700_rc_setup(d); /* reset ir sensor data to prevent false events */
506 512
513 d->last_event = 0;
507 switch (dvb_usb_dib0700_ir_proto) { 514 switch (dvb_usb_dib0700_ir_proto) {
508 case 0: { 515 case 0:
509 /* NEC protocol sends repeat code as 0 0 0 FF */ 516 /* NEC protocol sends repeat code as 0 0 0 FF */
510 if ((key[3-2] == 0x00) && (key[3-3] == 0x00) && 517 if ((key[3-2] == 0x00) && (key[3-3] == 0x00) &&
511 (key[3] == 0xFF)) { 518 (key[3] == 0xff))
512 st->rc_counter++; 519 keycode = d->last_event;
513 if (st->rc_counter > RC_REPEAT_DELAY) { 520 else {
514 *event = d->last_event; 521 keycode = key[3-2] << 8 | key[3-3];
515 *state = REMOTE_KEY_PRESSED; 522 d->last_event = keycode;
516 st->rc_counter = RC_REPEAT_DELAY;
517 }
518 return 0;
519 }
520 for (i=0;i<d->props.rc.legacy.rc_key_map_size; i++) {
521 if (rc5_custom(&keymap[i]) == key[3-2] &&
522 rc5_data(&keymap[i]) == key[3-3]) {
523 st->rc_counter = 0;
524 *event = keymap[i].keycode;
525 *state = REMOTE_KEY_PRESSED;
526 d->last_event = keymap[i].keycode;
527 return 0;
528 }
529 } 523 }
524
525 ir_keydown(d->rc_input_dev, keycode, 0);
530 break; 526 break;
531 } 527 default:
532 default: {
533 /* RC-5 protocol changes toggle bit on new keypress */ 528 /* RC-5 protocol changes toggle bit on new keypress */
534 for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) { 529 keycode = key[3-2] << 8 | key[3-3];
535 if (rc5_custom(&keymap[i]) == key[3-2] && 530 toggle = key[3-1];
536 rc5_data(&keymap[i]) == key[3-3]) { 531 ir_keydown(d->rc_input_dev, keycode, toggle);
537 if (d->last_event == keymap[i].keycode && 532
538 key[3-1] == st->rc_toggle) {
539 st->rc_counter++;
540 /* prevents unwanted double hits */
541 if (st->rc_counter > RC_REPEAT_DELAY) {
542 *event = d->last_event;
543 *state = REMOTE_KEY_PRESSED;
544 st->rc_counter = RC_REPEAT_DELAY;
545 }
546
547 return 0;
548 }
549 st->rc_counter = 0;
550 *event = keymap[i].keycode;
551 *state = REMOTE_KEY_PRESSED;
552 st->rc_toggle = key[3-1];
553 d->last_event = keymap[i].keycode;
554 return 0;
555 }
556 }
557 break; 533 break;
558 } 534 }
559 }
560 err("Unknown remote controller key: %2X %2X %2X %2X", (int) key[3-2], (int) key[3-3], (int) key[3-1], (int) key[3]);
561 d->last_event = 0;
562 return 0; 535 return 0;
563} 536}
564 537
565static struct ir_scancode ir_codes_dib0700_table[] = {
566 /* Key codes for the tiny Pinnacle remote*/
567 { 0x0700, KEY_MUTE },
568 { 0x0701, KEY_MENU }, /* Pinnacle logo */
569 { 0x0739, KEY_POWER },
570 { 0x0703, KEY_VOLUMEUP },
571 { 0x0709, KEY_VOLUMEDOWN },
572 { 0x0706, KEY_CHANNELUP },
573 { 0x070c, KEY_CHANNELDOWN },
574 { 0x070f, KEY_1 },
575 { 0x0715, KEY_2 },
576 { 0x0710, KEY_3 },
577 { 0x0718, KEY_4 },
578 { 0x071b, KEY_5 },
579 { 0x071e, KEY_6 },
580 { 0x0711, KEY_7 },
581 { 0x0721, KEY_8 },
582 { 0x0712, KEY_9 },
583 { 0x0727, KEY_0 },
584 { 0x0724, KEY_SCREEN }, /* 'Square' key */
585 { 0x072a, KEY_TEXT }, /* 'T' key */
586 { 0x072d, KEY_REWIND },
587 { 0x0730, KEY_PLAY },
588 { 0x0733, KEY_FASTFORWARD },
589 { 0x0736, KEY_RECORD },
590 { 0x073c, KEY_STOP },
591 { 0x073f, KEY_CANCEL }, /* '?' key */
592 /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */
593 { 0xeb01, KEY_POWER },
594 { 0xeb02, KEY_1 },
595 { 0xeb03, KEY_2 },
596 { 0xeb04, KEY_3 },
597 { 0xeb05, KEY_4 },
598 { 0xeb06, KEY_5 },
599 { 0xeb07, KEY_6 },
600 { 0xeb08, KEY_7 },
601 { 0xeb09, KEY_8 },
602 { 0xeb0a, KEY_9 },
603 { 0xeb0b, KEY_VIDEO },
604 { 0xeb0c, KEY_0 },
605 { 0xeb0d, KEY_REFRESH },
606 { 0xeb0f, KEY_EPG },
607 { 0xeb10, KEY_UP },
608 { 0xeb11, KEY_LEFT },
609 { 0xeb12, KEY_OK },
610 { 0xeb13, KEY_RIGHT },
611 { 0xeb14, KEY_DOWN },
612 { 0xeb16, KEY_INFO },
613 { 0xeb17, KEY_RED },
614 { 0xeb18, KEY_GREEN },
615 { 0xeb19, KEY_YELLOW },
616 { 0xeb1a, KEY_BLUE },
617 { 0xeb1b, KEY_CHANNELUP },
618 { 0xeb1c, KEY_VOLUMEUP },
619 { 0xeb1d, KEY_MUTE },
620 { 0xeb1e, KEY_VOLUMEDOWN },
621 { 0xeb1f, KEY_CHANNELDOWN },
622 { 0xeb40, KEY_PAUSE },
623 { 0xeb41, KEY_HOME },
624 { 0xeb42, KEY_MENU }, /* DVD Menu */
625 { 0xeb43, KEY_SUBTITLE },
626 { 0xeb44, KEY_TEXT }, /* Teletext */
627 { 0xeb45, KEY_DELETE },
628 { 0xeb46, KEY_TV },
629 { 0xeb47, KEY_DVD },
630 { 0xeb48, KEY_STOP },
631 { 0xeb49, KEY_VIDEO },
632 { 0xeb4a, KEY_AUDIO }, /* Music */
633 { 0xeb4b, KEY_SCREEN }, /* Pic */
634 { 0xeb4c, KEY_PLAY },
635 { 0xeb4d, KEY_BACK },
636 { 0xeb4e, KEY_REWIND },
637 { 0xeb4f, KEY_FASTFORWARD },
638 { 0xeb54, KEY_PREVIOUS },
639 { 0xeb58, KEY_RECORD },
640 { 0xeb5c, KEY_NEXT },
641
642 /* Key codes for the Haupauge WinTV Nova-TD, copied from nova-t-usb2.c (Nova-T USB2) */
643 { 0x1e00, KEY_0 },
644 { 0x1e01, KEY_1 },
645 { 0x1e02, KEY_2 },
646 { 0x1e03, KEY_3 },
647 { 0x1e04, KEY_4 },
648 { 0x1e05, KEY_5 },
649 { 0x1e06, KEY_6 },
650 { 0x1e07, KEY_7 },
651 { 0x1e08, KEY_8 },
652 { 0x1e09, KEY_9 },
653 { 0x1e0a, KEY_KPASTERISK },
654 { 0x1e0b, KEY_RED },
655 { 0x1e0c, KEY_RADIO },
656 { 0x1e0d, KEY_MENU },
657 { 0x1e0e, KEY_GRAVE }, /* # */
658 { 0x1e0f, KEY_MUTE },
659 { 0x1e10, KEY_VOLUMEUP },
660 { 0x1e11, KEY_VOLUMEDOWN },
661 { 0x1e12, KEY_CHANNEL },
662 { 0x1e14, KEY_UP },
663 { 0x1e15, KEY_DOWN },
664 { 0x1e16, KEY_LEFT },
665 { 0x1e17, KEY_RIGHT },
666 { 0x1e18, KEY_VIDEO },
667 { 0x1e19, KEY_AUDIO },
668 { 0x1e1a, KEY_MEDIA },
669 { 0x1e1b, KEY_EPG },
670 { 0x1e1c, KEY_TV },
671 { 0x1e1e, KEY_NEXT },
672 { 0x1e1f, KEY_BACK },
673 { 0x1e20, KEY_CHANNELUP },
674 { 0x1e21, KEY_CHANNELDOWN },
675 { 0x1e24, KEY_LAST }, /* Skip backwards */
676 { 0x1e25, KEY_OK },
677 { 0x1e29, KEY_BLUE},
678 { 0x1e2e, KEY_GREEN },
679 { 0x1e30, KEY_PAUSE },
680 { 0x1e32, KEY_REWIND },
681 { 0x1e34, KEY_FASTFORWARD },
682 { 0x1e35, KEY_PLAY },
683 { 0x1e36, KEY_STOP },
684 { 0x1e37, KEY_RECORD },
685 { 0x1e38, KEY_YELLOW },
686 { 0x1e3b, KEY_GOTO },
687 { 0x1e3d, KEY_POWER },
688
689 /* Key codes for the Leadtek Winfast DTV Dongle */
690 { 0x0042, KEY_POWER },
691 { 0x077c, KEY_TUNER },
692 { 0x0f4e, KEY_PRINT }, /* PREVIEW */
693 { 0x0840, KEY_SCREEN }, /* full screen toggle*/
694 { 0x0f71, KEY_DOT }, /* frequency */
695 { 0x0743, KEY_0 },
696 { 0x0c41, KEY_1 },
697 { 0x0443, KEY_2 },
698 { 0x0b7f, KEY_3 },
699 { 0x0e41, KEY_4 },
700 { 0x0643, KEY_5 },
701 { 0x097f, KEY_6 },
702 { 0x0d7e, KEY_7 },
703 { 0x057c, KEY_8 },
704 { 0x0a40, KEY_9 },
705 { 0x0e4e, KEY_CLEAR },
706 { 0x047c, KEY_CHANNEL }, /* show channel number */
707 { 0x0f41, KEY_LAST }, /* recall */
708 { 0x0342, KEY_MUTE },
709 { 0x064c, KEY_RESERVED }, /* PIP button*/
710 { 0x0172, KEY_SHUFFLE }, /* SNAPSHOT */
711 { 0x0c4e, KEY_PLAYPAUSE }, /* TIMESHIFT */
712 { 0x0b70, KEY_RECORD },
713 { 0x037d, KEY_VOLUMEUP },
714 { 0x017d, KEY_VOLUMEDOWN },
715 { 0x0242, KEY_CHANNELUP },
716 { 0x007d, KEY_CHANNELDOWN },
717
718 /* Key codes for Nova-TD "credit card" remote control. */
719 { 0x1d00, KEY_0 },
720 { 0x1d01, KEY_1 },
721 { 0x1d02, KEY_2 },
722 { 0x1d03, KEY_3 },
723 { 0x1d04, KEY_4 },
724 { 0x1d05, KEY_5 },
725 { 0x1d06, KEY_6 },
726 { 0x1d07, KEY_7 },
727 { 0x1d08, KEY_8 },
728 { 0x1d09, KEY_9 },
729 { 0x1d0a, KEY_TEXT },
730 { 0x1d0d, KEY_MENU },
731 { 0x1d0f, KEY_MUTE },
732 { 0x1d10, KEY_VOLUMEUP },
733 { 0x1d11, KEY_VOLUMEDOWN },
734 { 0x1d12, KEY_CHANNEL },
735 { 0x1d14, KEY_UP },
736 { 0x1d15, KEY_DOWN },
737 { 0x1d16, KEY_LEFT },
738 { 0x1d17, KEY_RIGHT },
739 { 0x1d1c, KEY_TV },
740 { 0x1d1e, KEY_NEXT },
741 { 0x1d1f, KEY_BACK },
742 { 0x1d20, KEY_CHANNELUP },
743 { 0x1d21, KEY_CHANNELDOWN },
744 { 0x1d24, KEY_LAST },
745 { 0x1d25, KEY_OK },
746 { 0x1d30, KEY_PAUSE },
747 { 0x1d32, KEY_REWIND },
748 { 0x1d34, KEY_FASTFORWARD },
749 { 0x1d35, KEY_PLAY },
750 { 0x1d36, KEY_STOP },
751 { 0x1d37, KEY_RECORD },
752 { 0x1d3b, KEY_GOTO },
753 { 0x1d3d, KEY_POWER },
754
755 /* Key codes for the Pixelview SBTVD remote (proto NEC) */
756 { 0x8613, KEY_MUTE },
757 { 0x8612, KEY_POWER },
758 { 0x8601, KEY_1 },
759 { 0x8602, KEY_2 },
760 { 0x8603, KEY_3 },
761 { 0x8604, KEY_4 },
762 { 0x8605, KEY_5 },
763 { 0x8606, KEY_6 },
764 { 0x8607, KEY_7 },
765 { 0x8608, KEY_8 },
766 { 0x8609, KEY_9 },
767 { 0x8600, KEY_0 },
768 { 0x860d, KEY_CHANNELUP },
769 { 0x8619, KEY_CHANNELDOWN },
770 { 0x8610, KEY_VOLUMEUP },
771 { 0x860c, KEY_VOLUMEDOWN },
772
773 { 0x860a, KEY_CAMERA },
774 { 0x860b, KEY_ZOOM },
775 { 0x861b, KEY_BACKSPACE },
776 { 0x8615, KEY_ENTER },
777
778 { 0x861d, KEY_UP },
779 { 0x861e, KEY_DOWN },
780 { 0x860e, KEY_LEFT },
781 { 0x860f, KEY_RIGHT },
782
783 { 0x8618, KEY_RECORD },
784 { 0x861a, KEY_STOP },
785
786 /* Key codes for the EvolutePC TVWay+ remote (proto NEC) */
787 { 0x7a00, KEY_MENU },
788 { 0x7a01, KEY_RECORD },
789 { 0x7a02, KEY_PLAY },
790 { 0x7a03, KEY_STOP },
791 { 0x7a10, KEY_CHANNELUP },
792 { 0x7a11, KEY_CHANNELDOWN },
793 { 0x7a12, KEY_VOLUMEUP },
794 { 0x7a13, KEY_VOLUMEDOWN },
795 { 0x7a40, KEY_POWER },
796 { 0x7a41, KEY_MUTE },
797
798 /* Key codes for the Elgato EyeTV Diversity silver remote,
799 set dvb_usb_dib0700_ir_proto=0 */
800 { 0x4501, KEY_POWER },
801 { 0x4502, KEY_MUTE },
802 { 0x4503, KEY_1 },
803 { 0x4504, KEY_2 },
804 { 0x4505, KEY_3 },
805 { 0x4506, KEY_4 },
806 { 0x4507, KEY_5 },
807 { 0x4508, KEY_6 },
808 { 0x4509, KEY_7 },
809 { 0x450a, KEY_8 },
810 { 0x450b, KEY_9 },
811 { 0x450c, KEY_LAST },
812 { 0x450d, KEY_0 },
813 { 0x450e, KEY_ENTER },
814 { 0x450f, KEY_RED },
815 { 0x4510, KEY_CHANNELUP },
816 { 0x4511, KEY_GREEN },
817 { 0x4512, KEY_VOLUMEDOWN },
818 { 0x4513, KEY_OK },
819 { 0x4514, KEY_VOLUMEUP },
820 { 0x4515, KEY_YELLOW },
821 { 0x4516, KEY_CHANNELDOWN },
822 { 0x4517, KEY_BLUE },
823 { 0x4518, KEY_LEFT }, /* Skip backwards */
824 { 0x4519, KEY_PLAYPAUSE },
825 { 0x451a, KEY_RIGHT }, /* Skip forward */
826 { 0x451b, KEY_REWIND },
827 { 0x451c, KEY_L }, /* Live */
828 { 0x451d, KEY_FASTFORWARD },
829 { 0x451e, KEY_STOP }, /* 'Reveal' for Teletext */
830 { 0x451f, KEY_MENU }, /* KEY_TEXT for Teletext */
831 { 0x4540, KEY_RECORD }, /* Font 'Size' for Teletext */
832 { 0x4541, KEY_SCREEN }, /* Full screen toggle, 'Hold' for Teletext */
833 { 0x4542, KEY_SELECT }, /* Select video input, 'Select' for Teletext */
834};
835
836/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ 538/* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
837static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = { 539static struct dibx000_agc_config stk7700p_7000m_mt2060_agc_config = {
838 BAND_UHF | BAND_VHF, 540 BAND_UHF | BAND_VHF,
@@ -2168,11 +1870,10 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2168 } 1870 }
2169 }, 1871 },
2170 1872
2171 .rc.legacy = { 1873 .rc.core = {
2172 .rc_interval = DEFAULT_RC_INTERVAL, 1874 .rc_interval = DEFAULT_RC_INTERVAL,
2173 .rc_key_map = ir_codes_dib0700_table, 1875 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2174 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 1876 .rc_query = dib0700_rc_query_old_firmware
2175 .rc_query = dib0700_rc_query
2176 }, 1877 },
2177 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 1878 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2178 1879
@@ -2199,11 +1900,10 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2199 }, 1900 },
2200 }, 1901 },
2201 1902
2202 .rc.legacy = { 1903 .rc.core = {
2203 .rc_interval = DEFAULT_RC_INTERVAL, 1904 .rc_interval = DEFAULT_RC_INTERVAL,
2204 .rc_key_map = ir_codes_dib0700_table, 1905 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2205 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 1906 .rc_query = dib0700_rc_query_old_firmware
2206 .rc_query = dib0700_rc_query
2207 }, 1907 },
2208 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 1908 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2209 1909
@@ -2255,11 +1955,10 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2255 1955
2256 }, 1956 },
2257 1957
2258 .rc.legacy = { 1958 .rc.core = {
2259 .rc_interval = DEFAULT_RC_INTERVAL, 1959 .rc_interval = DEFAULT_RC_INTERVAL,
2260 .rc_key_map = ir_codes_dib0700_table, 1960 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2261 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 1961 .rc_query = dib0700_rc_query_old_firmware
2262 .rc_query = dib0700_rc_query
2263 }, 1962 },
2264 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 1963 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2265 1964
@@ -2293,11 +1992,11 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2293 } 1992 }
2294 }, 1993 },
2295 1994
2296 .rc.legacy = { 1995 .rc.core = {
2297 .rc_interval = DEFAULT_RC_INTERVAL, 1996 .rc_interval = DEFAULT_RC_INTERVAL,
2298 .rc_key_map = ir_codes_dib0700_table, 1997 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2299 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 1998 .module_name = "dib0700",
2300 .rc_query = dib0700_rc_query 1999 .rc_query = dib0700_rc_query_old_firmware
2301 }, 2000 },
2302 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 2001 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2303 2002
@@ -2365,11 +2064,11 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2365 }, 2064 },
2366 }, 2065 },
2367 2066
2368 .rc.legacy = { 2067 .rc.core = {
2369 .rc_interval = DEFAULT_RC_INTERVAL, 2068 .rc_interval = DEFAULT_RC_INTERVAL,
2370 .rc_key_map = ir_codes_dib0700_table, 2069 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2371 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 2070 .module_name = "dib0700",
2372 .rc_query = dib0700_rc_query 2071 .rc_query = dib0700_rc_query_old_firmware
2373 }, 2072 },
2374 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 2073 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2375 2074
@@ -2405,11 +2104,11 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2405 }, 2104 },
2406 }, 2105 },
2407 2106
2408 .rc.legacy = { 2107 .rc.core = {
2409 .rc_interval = DEFAULT_RC_INTERVAL, 2108 .rc_interval = DEFAULT_RC_INTERVAL,
2410 .rc_key_map = ir_codes_dib0700_table, 2109 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2411 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 2110 .module_name = "dib0700",
2412 .rc_query = dib0700_rc_query 2111 .rc_query = dib0700_rc_query_old_firmware
2413 }, 2112 },
2414 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 2113 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2415 2114
@@ -2473,11 +2172,11 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2473 }, 2172 },
2474 }, 2173 },
2475 2174
2476 .rc.legacy = { 2175 .rc.core = {
2477 .rc_interval = DEFAULT_RC_INTERVAL, 2176 .rc_interval = DEFAULT_RC_INTERVAL,
2478 .rc_key_map = ir_codes_dib0700_table, 2177 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2479 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 2178 .module_name = "dib0700",
2480 .rc_query = dib0700_rc_query 2179 .rc_query = dib0700_rc_query_old_firmware
2481 }, 2180 },
2482 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 2181 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2483 2182
@@ -2538,11 +2237,11 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2538 }, 2237 },
2539 }, 2238 },
2540 2239
2541 .rc.legacy = { 2240 .rc.core = {
2542 .rc_interval = DEFAULT_RC_INTERVAL, 2241 .rc_interval = DEFAULT_RC_INTERVAL,
2543 .rc_key_map = ir_codes_dib0700_table, 2242 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2544 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 2243 .module_name = "dib0700",
2545 .rc_query = dib0700_rc_query 2244 .rc_query = dib0700_rc_query_old_firmware
2546 }, 2245 },
2547 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 2246 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2548 .num_adapters = 1, 2247 .num_adapters = 1,
@@ -2569,11 +2268,12 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2569 { NULL }, 2268 { NULL },
2570 }, 2269 },
2571 }, 2270 },
2572 .rc.legacy = { 2271
2272 .rc.core = {
2573 .rc_interval = DEFAULT_RC_INTERVAL, 2273 .rc_interval = DEFAULT_RC_INTERVAL,
2574 .rc_key_map = ir_codes_dib0700_table, 2274 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2575 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 2275 .module_name = "dib0700",
2576 .rc_query = dib0700_rc_query 2276 .rc_query = dib0700_rc_query_old_firmware
2577 }, 2277 },
2578 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 2278 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2579 .num_adapters = 1, 2279 .num_adapters = 1,
@@ -2632,11 +2332,12 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2632 { NULL }, 2332 { NULL },
2633 }, 2333 },
2634 }, 2334 },
2635 .rc.legacy = { 2335
2336 .rc.core = {
2636 .rc_interval = DEFAULT_RC_INTERVAL, 2337 .rc_interval = DEFAULT_RC_INTERVAL,
2637 .rc_key_map = ir_codes_dib0700_table, 2338 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2638 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 2339 .module_name = "dib0700",
2639 .rc_query = dib0700_rc_query 2340 .rc_query = dib0700_rc_query_old_firmware
2640 }, 2341 },
2641 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 2342 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2642 .num_adapters = 1, 2343 .num_adapters = 1,
@@ -2672,11 +2373,11 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2672 }, 2373 },
2673 }, 2374 },
2674 2375
2675 .rc.legacy = { 2376 .rc.core = {
2676 .rc_interval = DEFAULT_RC_INTERVAL, 2377 .rc_interval = DEFAULT_RC_INTERVAL,
2677 .rc_key_map = ir_codes_dib0700_table, 2378 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2678 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 2379 .module_name = "dib0700",
2679 .rc_query = dib0700_rc_query 2380 .rc_query = dib0700_rc_query_old_firmware
2680 }, 2381 },
2681 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 2382 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2682 .num_adapters = 2, 2383 .num_adapters = 2,
@@ -2717,11 +2418,11 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2717 }, 2418 },
2718 }, 2419 },
2719 2420
2720 .rc.legacy = { 2421 .rc.core = {
2721 .rc_interval = DEFAULT_RC_INTERVAL, 2422 .rc_interval = DEFAULT_RC_INTERVAL,
2722 .rc_key_map = ir_codes_dib0700_table, 2423 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2723 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 2424 .module_name = "dib0700",
2724 .rc_query = dib0700_rc_query 2425 .rc_query = dib0700_rc_query_old_firmware
2725 }, 2426 },
2726 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, 2427 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
2727 .num_adapters = 1, 2428 .num_adapters = 1,
@@ -2750,11 +2451,11 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2750 }, 2451 },
2751 }, 2452 },
2752 2453
2753 .rc.legacy = { 2454 .rc.core = {
2754 .rc_interval = DEFAULT_RC_INTERVAL, 2455 .rc_interval = DEFAULT_RC_INTERVAL,
2755 .rc_key_map = ir_codes_dib0700_table, 2456 .rc_codes = RC_MAP_DIB0700_BIG_TABLE,
2756 .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), 2457 .module_name = "dib0700",
2757 .rc_query = dib0700_rc_query 2458 .rc_query = dib0700_rc_query_old_firmware
2758 }, 2459 },
2759 }, 2460 },
2760}; 2461};