Mailing List archive

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

[linux-dvb] cinergyT2 remote, repeat handling, keycodes WAS:(Re: Re: cinergyT2: which kernel/usb module to use?)



On Montag, 29. November 2004 10:40, Holger Waechtler wrote:
> Stefan Lucke wrote:
> 
> >Yes IR works. Key repeat rate is much to high. Pressing "1" and to "2" is
> >written multiple times upon a short hit.
> >  
> >
> 
> The device should just report the raw keycodes it receives from the 
> remote control without touching them. Please read the comment in the 
> code about the sketchy keyrepeat implementation, if you want a 
> host-controllable keyrepeat rate you just need to properly implement the 
> input-device keyrepeat timer initialisation and then report keyrepeat 
> events instead of repeating up/down events to the applications.

I just worked around that, by ignoring the first few repeat event codes,
see attached file.

So i tried to teach the remote keys to vdr, but many keys didn't arrive.
They are:OSD, EPG, TXT, i, AV,  REFRESH, RED, GREEN, ...

In /var/log/messages they are all reported:
Dec 13 22:11:23 jarada kernel: got key (type 1, value 0xf20deb04
Dec 13 22:11:23 jarada kernel: got key (type 1, value 0xffffffff

Stefan Lucke
? cinergyT2.c.test01
? cinergy_key_repeat_handling.diff
? event_fake.diff
? loop.diff
Index: cinergyT2.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/cinergyT2/cinergyT2.c,v
retrieving revision 1.15.2.5
diff -p -U3 -r1.15.2.5 cinergyT2.c
--- cinergyT2.c	3 Dec 2004 09:13:29 -0000	1.15.2.5
+++ cinergyT2.c	13 Dec 2004 21:02:23 -0000
@@ -186,6 +186,7 @@ struct cinergyt2 {
 	struct input_dev rc_input_dev;
 	struct work_struct rc_query_work;
 	int rc_input_event;
+	int rc_repeat_count;
 #endif
 };
 
@@ -772,6 +773,13 @@ printk("got key (type %d, value 0x%08x\n
 			 * and no other driver does this, so we simply
 			 * emit the last key up/down sequence again.
 			 */
+
+			/**
+			 * try to work around: just skip the first few
+			 * repeat events.
+			 */
+			if (cinergyt2->rc_repeat_count++ < 3)
+				continue;
 		} else {
 			cinergyt2->rc_input_event = KEY_MAX;
 			for (i=0; i<sizeof(rc_keys)/sizeof(rc_keys[0]); i+=3) {
@@ -779,6 +787,7 @@ printk("got key (type %d, value 0x%08x\n
 				    rc_keys[i+1] == rc_events[n].value)
 				{
 					cinergyt2->rc_input_event = rc_keys[i+2];
+					cinergyt2->rc_repeat_count = 0;
 					break;
 				}
 			}
@@ -903,6 +912,7 @@ void* cinergyt2_probe (struct usb_device
 	input_register_device(&cinergyt2->rc_input_dev);
 
 	cinergyt2->rc_input_event = KEY_MAX;
+	cinergyt2->rc_repeat_count = 0;
 
 	INIT_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc, cinergyt2);
 	schedule_delayed_work(&cinergyt2->rc_query_work, HZ/2);

Home | Main Index | Thread Index