From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Chris Rankin <rankincj@yahoo.com>
Cc: "Frank Schäfer" <fschaefer.oss@googlemail.com>,
"Linux Media Mailing List" <linux-media@vger.kernel.org>
Subject: Re: 3.9.2 kernel - IR / em28xx_rc broken?
Date: Thu, 13 Jun 2013 07:39:03 -0300 [thread overview]
Message-ID: <20130613073903.77ea9c84@redhat.com> (raw)
In-Reply-To: <519A430E.4080006@googlemail.com>
Hi,
Sorry for not getting into it earlier... too much work those days.
Em Mon, 20 May 2013 17:36:46 +0200
Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:
> Am 20.05.2013 16:51, schrieb Chris Rankin:
> > ----- Original Message -----
> >
> >> If I had to guess, I would say you should check your rc_maps.cfg / keytable. ;)
> > This is unchanged between 3.8.x and 3.9.x, and so is correct by definition.
>
> No, just because it didn't change it isn't automatically correct. ;)
> Which protocol type does you keytable specify/select ?
> It should be RC5. If it's none or unknown, it's just dump luck that
> things are working (because the driver fortunately configures the device
> for RC5 in case of RC_BIT_UNKNOWN).
The RC_BIT_UNKNOWN has 3 usages:
1) when the protocol is unknown;
2) on legacy tables, when the full scancode is unknown;
3) on broken devices where just the command part of the scancode
(7 or 8 bits) is known.
In the case of em28xx, only (2) applies.
So, the behavior on em28xx is to support legacy IR tables written using
the legacy input layer, that use to support only 8 bits for keycodes.
So, we don't know the address bits of the keycodes.
The expected behavior on em28xx when RC_BIT_UNKNOWN is used, is that
the keycode tables would be 8-bits masked, and the same mask should
also be applied to the received keycodes. This is done by the RC core.
That is used only by a very few set of em28xx cards:
$ for i in $(git grep RC_MAP_ $(git grep -l _UNKNOWN drivers/media/rc/keymaps/)|perl -ne 'print "$1\n" if (m/(RC_MAP_[\w\d\_]+)/)');do git grep $i drivers/media/usb/em28xx/; done
drivers/media/usb/em28xx/em28xx-cards.c: .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
drivers/media/usb/em28xx/em28xx-input.c: rc->map_name = RC_MAP_EM_TERRATEC;
drivers/media/usb/em28xx/em28xx-cards.c: .ir_codes = RC_MAP_EVGA_INDTUBE,
drivers/media/usb/em28xx/em28xx-cards.c: .ir_codes = RC_MAP_GADMEI_RM008Z,
drivers/media/usb/em28xx/em28xx-cards.c: .ir_codes = RC_MAP_KAIOMY,
drivers/media/usb/em28xx/em28xx-input.c: rc->map_name = RC_MAP_PINNACLE_GREY;
drivers/media/usb/em28xx/em28xx-cards.c: .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
drivers/media/usb/em28xx/em28xx-cards.c: .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
drivers/media/usb/em28xx/em28xx-input.c: rc->map_name = RC_MAP_WINFAST_USBII_DELUXE;
drivers/media/usb/em28xx/em28xx-input.c: rc->map_name = RC_MAP_WINFAST_USBII_DELUXE;
Patches are welcome to replace the above scancode tables by one with
the full code, as we want to use RC_BIT_UNKNOWN only on broken hardware
where the scancode is only partially filled.
Btw, the bits that handles the masks are at rc-main.c, at
ir_establish_scancode():
if (dev->scanmask)
scancode &= dev->scanmask;
A quick look at em28xx shows that it is not using it anymore, so some
patch likely broke support for RC_BIT_UNKNOWN there.
So, a fix is needed there to fill dev->scanmask if a RC_BIT_UNKNOWN
table is used.
It should be noticed that tables with RC_BIT_UNKNOWN are generally
not portable among devices, as some of those tables have the command
bits inverted.
>
> > Kernel Upgrades Do Not Break Userspace.
>
> Right.
> That's why I would say the third (scancode) change is problematic.
> Let's see what Mauro thinks about this.
For legacy tables, only 16 bits are needed (as all those tables are
for either RC5 or NEC), in the form of <addr><cmd> and dev->scanmask
should be 0xff.
The rationale to not mask the scancode to contain just the <cmd> part
is that the produced debug messages could be used by someone to
identify the address for those broken IR keytables and write a patch
for us fixing it.
Regards,
Mauro
next prev parent reply other threads:[~2013-06-13 10:39 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-18 13:57 3.9.2 kernel - IR / em28xx_rc broken? Chris Rankin
2013-05-18 14:36 ` Frank Schäfer
2013-05-18 15:17 ` Chris Rankin
2013-05-18 16:58 ` Frank Schäfer
2013-05-18 21:02 ` Chris Rankin
2013-05-19 13:40 ` Frank Schäfer
2013-05-19 14:11 ` Chris Rankin
2013-05-19 17:26 ` Frank Schäfer
2013-05-19 19:59 ` Chris Rankin
2013-05-19 21:02 ` Frank Schäfer
2013-05-19 22:36 ` Chris Rankin
2013-05-19 23:04 ` Chris Rankin
2013-05-20 12:38 ` Frank Schäfer
2013-05-20 12:47 ` Frank Schäfer
2013-05-20 13:01 ` Chris Rankin
2013-05-20 13:43 ` Frank Schäfer
2013-05-20 14:51 ` Chris Rankin
2013-05-20 15:36 ` Frank Schäfer
2013-05-20 16:02 ` Chris Rankin
2013-06-13 10:39 ` Mauro Carvalho Chehab [this message]
2013-06-13 10:50 ` Mauro Carvalho Chehab
2013-05-20 0:45 ` Chris Rankin
2013-05-20 12:40 ` Frank Schäfer
2013-05-20 12:48 ` Chris Rankin
2013-05-18 21:11 ` Chris Rankin
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=20130613073903.77ea9c84@redhat.com \
--to=mchehab@redhat.com \
--cc=fschaefer.oss@googlemail.com \
--cc=linux-media@vger.kernel.org \
--cc=rankincj@yahoo.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.