All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Härdeman" <david@hardeman.nu>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Jarod Wilson <jarod@wilsonet.com>,
	Jarod Wilson <jarod@redhat.com>,
	linux-media@vger.kernel.org
Subject: Re: [RFC PATCH 0/2] Apple remote support
Date: Wed, 17 Nov 2010 00:26:36 +0100	[thread overview]
Message-ID: <20101116232636.GA28261@hardeman.nu> (raw)
In-Reply-To: <4CE2743D.5040501@redhat.com>

On Tue, Nov 16, 2010 at 10:08:29AM -0200, Mauro Carvalho Chehab wrote:
>Em 15-11-2010 02:11, Jarod Wilson escreveu:
>> Gives us support for using the full 32-bit codes right now w/o having
>> to change any tables yet, but does require a modparam to skip the
>> checksum checks, unless its an apple remote which we already know the
>> vendor bytes for. I do think I'm ultimately leaning towards just
>> doing the full 32 bits for all nec extended though -- optionally, we
>> might include a modparam to *enable* the checksum check for those
>> that want strict compliance (but I'd still say use the full 32 bits).
>> The only issue I see with going to the full 32 right now is that we
>> have all these nec tables with only 24 bits, and we don't know ...
>> oh, wait, no, nevermind... We *do* know the missing 8 bits, since
>> they have to fulfill the checksum check for command ^ not_command. So
>> yeah, I'd say 32-bit scancodes for all nec extended, don't enforce
>> the checksum by default with a module option (or sysfs knob) to
>> enable checksum compliance.
>
>A modprobe parameter for it doesn't seem right. Users should not need to
>do any manual hack for ther RC to work, if the keycode table is ok.

Agreed. There are already too many weird driver-specific modparams in
use as is.

>Also, changing the current tables to 32 bits will break userspace API, as all
>userspace keytables for NEC will stop working, all due to a few vendors that 
>decided to abuse on the NEC protocol. This doesn't sound fair.

The NEC protocol is hardly a standard. There's lot's of variations out
there. And intentionally throwing away information inside the kernel
doesn't sound fair either.

>Considering that the new setkeycode/getkeycode ioctls support a variable
>size for scancodes, it seems to me that the proper solution is properly
>add support for variable-size scancode tables. By doing this, one of the
>properties for a scancode table is the size of the scancode. The NEC decoding
>logic can take the scancode size into account, when deciding to check checksum
>or not.

With that approach you'd have to have the same scancode mangling code in
each driver which generates NEC scancodes as well as in the nec raw
decoder.

One suggestion would be to use a full 32-bit scancode table, but use the
size from the ioctl to determine how to generate the scancode to be
inserted into the table. So if the ioctl was called with a 2 byte
scancode, assume NEC with addr(8 bits) + cmd(8 bits); 3 byte -> NEC
Extended with addr(16 bits) + cmd(8 bits); 4 byte -> 32 bit scancode.

That way the nec decoder and other scancode drivers can be kept simple,
the scancode table has a full 32 bit scancode for all keys and userspace
won't see the difference (though I still think we should use the new
large scancode API to let userspace properly indicate the protocol along
with the scancode in the future).


-- 
David Härdeman

  reply	other threads:[~2010-11-16 23:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29  3:11 [RFC PATCH 0/2] Apple remote support Jarod Wilson
2010-10-29  3:13 ` [RFC PATCH 1/2] ir-nec-decoder: decode Apple's NEC remote variant Jarod Wilson
2010-10-29 22:15   ` Andy Walls
2010-10-29  3:13 ` [RFC PATCH 2/2] IR: add Apple remote keymap Jarod Wilson
2010-10-29  3:15 ` [RFC PATCH 0/2] Apple remote support Jarod Wilson
2010-10-29 13:46   ` Mauro Carvalho Chehab
2010-10-29 15:11     ` Jarod Wilson
2010-10-29 19:17       ` David Härdeman
2010-10-29 19:27         ` Jarod Wilson
2010-10-29 19:59           ` David Härdeman
2010-10-29 20:09             ` Jarod Wilson
2010-10-30 23:36               ` David Härdeman
2010-10-31  2:32                 ` Jarod Wilson
2010-11-01 21:56                   ` David Härdeman
2010-11-02 20:42                     ` Jarod Wilson
2010-11-04 12:16                       ` David Härdeman
2010-11-04 15:54                         ` Jarod Wilson
2010-11-04 19:38                           ` David Härdeman
2010-11-04 19:43                             ` Mauro Carvalho Chehab
2010-11-05 13:27                               ` David Härdeman
2010-11-05 14:04                                 ` Christopher Harrington
2010-11-07 19:01                                   ` Jarod Wilson
2010-11-15  4:11                                 ` Jarod Wilson
2010-11-15 18:39                                   ` David Härdeman
2010-11-16 12:08                                   ` Mauro Carvalho Chehab
2010-11-16 23:26                                     ` David Härdeman [this message]
2010-11-18 16:33                                       ` Jarod Wilson
2010-11-18 20:43                                         ` David Härdeman
2010-11-18 20:49                                           ` Jarod Wilson
2010-11-18 20:59                                             ` Mauro Carvalho Chehab
2010-11-19 23:55                                               ` David Härdeman

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=20101116232636.GA28261@hardeman.nu \
    --to=david@hardeman.nu \
    --cc=jarod@redhat.com \
    --cc=jarod@wilsonet.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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.