linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Dorozel Csaba <mrjuuzer@upcmail.hu>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: ir-kbd-i2c / rc-hauppauge / linux-3.x broken
Date: Fri, 30 Dec 2011 15:17:29 -0200	[thread overview]
Message-ID: <4EFDF229.8090103@redhat.com> (raw)
In-Reply-To: <20111230120658.DXPH19694.viefep13-int.chello.at@edge04.upcmail.net>

On 30-12-2011 10:06, Dorozel Csaba wrote:
> Hi!
> 
> After kernel upgrade from 2.6.38 to any of the 3.x.x series my remote is partly broken (Hauppauge
> WinTV-HVR1110 DVB-T/Hybrid with gray remote (A415-HPG-WE-A)).

(c/c linux-media ML)

> user juuzer # ir-keytable 
> Found /sys/class/rc/rc0/ (/dev/input/event6) with:
>         Driver ir-kbd-i2c, table rc-hauppauge
>         Supported protocols: RC-5 
>         Enabled protocols: RC-5 
>         Repeat delay = 500 ms, repeat period = 125 ms
> user juuzer # ir-keytable -t
> Testing events. Please, press CTRL-C to abort.
> 1325171356.344341: event MSC: scancode = 3b
> 1325171356.344343: event sync
> 1325171356.447358: event MSC: scancode = 3b
> 1325171356.447359: event sync
> 1325171357.786360: event MSC: scancode = 3d
> 1325171357.786362: event sync
> 1325171357.889359: event MSC: scancode = 3d
> 1325171357.889360: event sync
> 1325171363.039366: event MSC: scancode = 01
> 1325171363.039369: event key down: KEY_1 (0x0002)
> 1325171363.039370: event sync
> 11325171363.289389: event key up: KEY_1 (0x0002)
> 1325171363.289390: event sync
> 1325171364.584360: event MSC: scancode = 02
> 1325171364.584364: event key down: KEY_2 (0x0003)
> 1325171364.584365: event sync
> 21325171364.687351: event MSC: scancode = 02
> 1325171364.687353: event sync
> 1325171364.937382: event key up: KEY_2 (0x0003)
> 1325171364.937383: event sync
> 
> So i made some changes in rc-hauppauge.c file. Add/rename/replace some keycodes started with 0x00
> address which keep the compatibility with old black remote and work with my gray one.
> 
> ser juuzer # ir-keytable   
> Found /sys/class/rc/rc0/ (/dev/input/event6) with:
>         Driver ir-kbd-i2c, table rc-hauppauge
>         Supported protocols: RC-5 
>         Enabled protocols: RC-5 
>         Repeat delay = 500 ms, repeat period = 125 ms
> user juuzer # ir-keytable -t
> Testing events. Please, press CTRL-C to abort.
> 1325171718.396566: event MSC: scancode = 3b
> 1325171718.396569: event key down: KEY_SELECT (0x0161)
> 1325171718.396570: event sync
> 1325171718.499571: event MSC: scancode = 3b
> 1325171718.499572: event sync
> 1325171718.749585: event key up: KEY_SELECT (0x0161)
> 1325171718.749586: event sync
> 1325171721.180564: event MSC: scancode = 3d
> 1325171721.180567: event key down: KEY_POWER2 (0x0164)
> 1325171721.180568: event sync
> 1325171721.283562: event MSC: scancode = 3d
> 1325171721.283563: event sync
> 1325171721.533585: event key up: KEY_POWER2 (0x0164)
> 1325171721.533586: event sync
> 1325171731.070564: event MSC: scancode = 01
> 1325171731.070567: event key down: KEY_1 (0x0002)
> 1325171731.070569: event sync
> 11325171731.173562: event MSC: scancode = 01
> 1325171731.173563: event sync
> 1325171731.423587: event key up: KEY_1 (0x0002)
> 1325171731.423588: event sync
> 1325171732.203561: event MSC: scancode = 02
> 1325171732.203565: event key down: KEY_2 (0x0003)
> 1325171732.203566: event sync
> 21325171732.306567: event MSC: scancode = 02
> 1325171732.306569: event sync
> 1325171732.556586: event key up: KEY_2 (0x0003)
> 1325171732.556587: event sync
> 
> Some of  the keycodes have different function on black and gray:
> 
> 0x001f  KEY_TV on black - KEY_EXIT on gray
> 0x002e  KEY_ZOOM on black - KEY_GREEN on gray
> 0x000d  KEY_MUTE on black – KEY_MENU on gray
> 0x001e  KEY_RED on black – KEY_NEXTSONG on gray

Sorry, but your fix is at the wrong place ;) The bug is not inside
the ir-hauppage.c table.

Basically, the bridge driver is not sending the complete RC-5
keycode to the IR core, but just the 8 least siginificant bits.
So, it is loosing the 0x1e00 code for the Hauppauge grey remote.

The fix should be at saa7134-input. It should be something like
the enclosed patch (I'm just guessing there that code3 contains
the MSB bits - you may need to adjust it to match the IR decoder
there):

saa7134-input: Fix get_key_hvr1110() handling

Instead of returning just 8 bits, return the full RC-5 code

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index d4ee24b..29c8efd 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -249,8 +249,8 @@ static int get_key_hvr1110(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 		return 0;
 
 	/* return key */
-	*ir_key = code4;
-	*ir_raw = code4;
+	*ir_key = code4 | code3 << 8;
+	*ir_raw = *ir_key;
 	return 1;
 }
 

       reply	other threads:[~2011-12-30 17:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20111230120658.DXPH19694.viefep13-int.chello.at@edge04.upcmail.net>
2011-12-30 17:17 ` Mauro Carvalho Chehab [this message]
2011-12-31 10:15   ` ir-kbd-i2c / rc-hauppauge / linux-3.x broken Dorozel Csaba
2011-12-31 11:07     ` Mauro Carvalho Chehab
2011-12-31 11:17       ` Patrick Dickey
2011-12-31 12:04         ` Mauro Carvalho Chehab
2011-12-31 11:47       ` Dorozel Csaba
2011-12-31 12:15         ` Mauro Carvalho Chehab
2011-12-31 13:22           ` Dorozel Csaba
2011-12-31 20:44             ` Mauro Carvalho Chehab
2011-12-31 20:58             ` [PATCH] [media] saa7134: fix IR handling for HVR-1110 Mauro Carvalho Chehab
2012-01-01  9:57               ` Dorozel Csaba
2012-01-01 14:14               ` Dorozel Csaba
2012-01-01 18:47                 ` Mauro Carvalho Chehab
2012-01-01 19:17                   ` Dorozel Csaba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EFDF229.8090103@redhat.com \
    --to=mchehab@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mrjuuzer@upcmail.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).