Partial success with Avermedia 777 remote

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are some problems.
Not mask_keyup bit.
Not mask_keydown bit.
When the card is working some bits of the read gpio  are changing.

With the attached patch, all key works, but when one key is pressed twice or 
more it is only recogniced one time.(You can not press the same key twice).

Jose Alberto
diff -r c83aa04419b7 linux/drivers/media/video/saa7134/saa7134-cards.c
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c	Tue Apr  4 13:41:47 2006 +0100
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c	Wed Apr  5 11:09:57 2006 +0200
@@ -3555,6 +3555,7 @@ int saa7134_board_init1(struct saa7134_d
 	case SAA7134_BOARD_AVERMEDIA_STUDIO_307:
 	case SAA7134_BOARD_AVERMEDIA_307:
 	case SAA7134_BOARD_AVERMEDIA_GO_007_FM:
+	case SAA7134_BOARD_AVERMEDIA_777:
 /*      case SAA7134_BOARD_SABRENT_SBTTVFM:  */ /* not finished yet */
 	case SAA7134_BOARD_VIDEOMATE_TV_PVR:
 	case SAA7134_BOARD_VIDEOMATE_GOLD_PLUS:
diff -r c83aa04419b7 linux/drivers/media/video/saa7134/saa7134-input.c
--- a/linux/drivers/media/video/saa7134/saa7134-input.c	Tue Apr  4 13:41:47 2006 +0100
+++ b/linux/drivers/media/video/saa7134/saa7134-input.c	Wed Apr  5 11:09:57 2006 +0200
@@ -57,9 +57,16 @@ static int build_key(struct saa7134_dev 
 
 	gpio = saa_readl(SAA7134_GPIO_GPSTATUS0 >> 2);
 	if (ir->polling) {
-		if (ir->last_gpio == gpio)
-			return 0;
-		ir->last_gpio = gpio;
+		if ((ir->mask_keydown == 0) && (ir->mask_keyup == 0)) {
+			if (ir->last_gpio == (gpio & ir->mask_keycode))
+				return 0;
+			ir->last_gpio = gpio & ir->mask_keycode;
+		}
+		else {
+			if (ir->last_gpio == gpio)
+				return 0;
+			ir->last_gpio = gpio;
+		}
 	}
 
 	data = ir_extract_bits(gpio, ir->mask_keycode);
@@ -70,6 +77,9 @@ static int build_key(struct saa7134_dev 
 		if ((ir->mask_keydown  &&  (0 != (gpio & ir->mask_keydown))) ||
 		    (ir->mask_keyup    &&  (0 == (gpio & ir->mask_keyup)))) {
 			ir_input_keydown(ir->dev, &ir->ir, data, data);
+		} else if ((ir->mask_keydown == 0) && (ir->mask_keyup == 0)) {
+			ir_input_keydown(ir->dev, &ir->ir, data, data);
+			ir_input_nokey(ir->dev, &ir->ir);
 		} else {
 			ir_input_nokey(ir->dev, &ir->ir);
 		}
@@ -190,6 +200,11 @@ int saa7134_input_init1(struct saa7134_d
 		/* Set GPIO pin2 to high to enable the IR controller */
 		saa_setb(SAA7134_GPIO_GPMODE0, 0x4);
 		saa_setb(SAA7134_GPIO_GPSTATUS0, 0x4);
+		break;
+	case SAA7134_BOARD_AVERMEDIA_777:
+		ir_codes     = ir_codes_avermedia;
+		mask_keycode = 0x02F200;
+		polling      = 50; // ms
 		break;
 	case SAA7134_BOARD_KWORLD_TERMINATOR:
 		ir_codes     = ir_codes_pixelview;
_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux