From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Antti Palosaari <crope@iki.fi>
Cc: "Frank Schäfer" <fschaefer.oss@googlemail.com>,
"Devin Heitmueller" <dheitmueller@kernellabs.com>,
"Matthew Gyurgyik" <matthew@pyther.net>,
"Linux Media Mailing List" <linux-media@vger.kernel.org>,
"David Härdeman" <david@hardeman.nu>
Subject: Re: em28xx: msi Digivox ATSC board id [0db0:8810]
Date: Thu, 13 Dec 2012 18:23:36 -0200 [thread overview]
Message-ID: <20121213182336.2cca9da6@redhat.com> (raw)
In-Reply-To: <50C79E9A.3050301@iki.fi>
Em Tue, 11 Dec 2012 22:59:06 +0200
Antti Palosaari <crope@iki.fi> escreveu:
> On 12/11/2012 10:51 PM, Frank Schäfer wrote:
> > Am 10.12.2012 21:48, schrieb Antti Palosaari:
> >> On 12/10/2012 09:24 PM, Frank Schäfer wrote:
> >>> Am 10.12.2012 18:57, schrieb Antti Palosaari:
> >>>> On 12/10/2012 06:13 PM, Devin Heitmueller wrote:
> >>>>> On Mon, Dec 10, 2012 at 11:01 AM, Frank Schäfer
> >>>>>> Adding a new property to the RC profile certainly seems to be the
> >>>>>> cleanest solution.
> >>>>>> Do all protocols have paritiy checking ? Otherwise we could add a new
> >>>>>> type RC_TYPE_NEC_NO_PARITY.
> >>>>>> OTOH, introducing a new bitfield in struct rc_map might be usefull
> >>>>>> for
> >>>>>> other flags, too, in the future...
> >>>>>
> >>>>> It's probably also worth mentioning that in that mode the device
> >>>>> reports four bytes, not two. I guess perhaps if parity is ignored it
> >>>>> reports the data in some other format? You will probably have to do
> >>>>> some experimentation there.
> >
> > ...
> >
> >>>>
> >>>> Uh, current em28xx NEC implementation is locked to traditional 16 bit
> >>>> NEC, where is hw checksum used.
> >>>>
> >>>> Implementation should be changed to more general to support 24 and 32
> >>>> bit NEC too. There is multiple drivers doing already that, for example
> >>>> AF9015.
> >>>>
> >>>
> >>> Hmm... are there and documents (, links, books, ...) where I can learn
> >>> more about all those RC protocols ?
> >>
> >> Specification comes here:
> >> NEC send always 32 bit, 4 bytes. There is 3 different "sub" protocols:
> >>
> >> 1) 16bit NEC standard, 1 byte address code, 1 byte key code
> >> full 4 byte code: AA BB CC DD
> >> where:
> >> AA = address code
> >> BB = ~address code
> >> CC = key code
> >> DD = ~key code
> >>
> >> checksum:
> >> AA + BB = 0xff
> >> CC + DD = 0xff
> >>
> >> 2) 24bit NEC extended, 2 byte address code, 1 byte key code
> >> full 4 byte code: AA BB CC DD
> >> where:
> >> AA = address code (MSB)
> >> BB = address code (LSB)
> >> CC = key code
> >> DD = ~key code
> >>
> >> 3) 32bit NEC full, 4 byte key code
> >> full 4 byte code: AA BB CC DD
> >> where:
> >> AA =
> >> BB =
> >> CC =
> >> DD =
> >>
> >> I am not sure if there is separate parts for address and key code in
> >> case of 32bit NEC. See some existing remote keytables if there is any
> >> such table. It is very rare protocol. 1) and 2) are much more common.
> >>
> >
> > Many thanks.
> > So the problem is, that we have only a single RC_TYPE for all 3 protocol
> > variants and need a method to distinguish between them, right ?
This is not actually needed, as it is very easy to distinguish them when
doing the table lookups. Take a look at v4l-utils, at /utils/keytable/rc_keymaps:
A 16-bits NEC table:
# table kworld_315u, type: NEC
0x6143 KEY_POWER
0x6101 KEY_VIDEO
...
A 24-bits NEC table:
# table pixelview_002t, type: NEC
0x866b13 KEY_MUTE
0x866b12 KEY_POWER2
...
A 32-bits NEC table:
# table tivo, type: NEC
0xa10c900f KEY_MEDIA
0xa10c0807 KEY_POWER2
...
If you see there, there's no way for the Kernel to handle it wrong, as
there's an implicit rule when dealing with "extended NEC" protocols:
Being the IR code being given by: AA BB CC DD
On a 24-bit NEC table: AA is always different than ~BB, otherwise, it would
be a 16-bit NEC.
On a 32-bit NEC table: CC is always different than ~DD, otherwise, it would be
a 24-bit NEC.
> Yes, that is. I have said it "million" times I would like to see that
> implemented as a one single 4 byte NEC, but it is currently what it is.
The hard thing is that, if this is changed upstream, existing
tools/keytables will break. So, regressions will be introduced.
> What I understand David Härdeman has done some work toward that too, but
> it is not ready.
One alternative would be to add some compatibility code at the table
read function that would convert a 16 bits or 24 bits NEC keycode table
into a 32 bits one, but doing it right can be a problem.
> See current af9015 driver as example how driver makes decision which
> variant of NEC is used. You will need something similar. Read all 4 NEC
> bytes from the hardware and then use driver to make decision which
> variant it is. I am quite sure em28xx hardware supports reading all 4
> bytes, but if not, you will need to do some other tricks.
>
> regards
> Antti
>
Regards,
Mauro
next prev parent reply other threads:[~2012-12-13 20:24 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-28 2:31 em28xx: msi Digivox ATSC board id [0db0:8810] Matthew Gyurgyik
2012-11-28 20:47 ` Frank Schäfer
2012-11-28 22:29 ` Matthew Gyurgyik
2012-11-28 22:55 ` Antti Palosaari
2012-11-29 2:05 ` Matthew Gyurgyik
2012-11-29 2:15 ` Antti Palosaari
2012-11-29 19:28 ` Frank Schäfer
2012-11-29 19:46 ` Antti Palosaari
2012-11-30 1:45 ` Matthew Gyurgyik
2012-12-02 11:44 ` Frank Schäfer
2012-12-02 14:23 ` Antti Palosaari
2012-12-02 17:18 ` Frank Schäfer
2012-12-03 18:16 ` Frank Schäfer
2012-12-04 2:15 ` Matthew Gyurgyik
2012-12-04 2:29 ` Devin Heitmueller
2012-12-04 2:42 ` Matthew Gyurgyik
2012-12-04 2:58 ` Devin Heitmueller
2012-12-04 21:06 ` Frank Schäfer
2012-12-05 3:41 ` Matthew Gyurgyik
2012-12-05 12:35 ` Antti Palosaari
2012-12-05 21:35 ` Matthew Gyurgyik
2012-12-05 22:01 ` Antti Palosaari
2012-12-05 22:33 ` Matthew Gyurgyik
2012-12-06 0:55 ` Antti Palosaari
2012-12-06 2:16 ` Matthew Gyurgyik
2012-12-06 21:49 ` Frank Schäfer
2012-12-06 21:57 ` Devin Heitmueller
2012-12-06 22:01 ` Frank Schäfer
2012-12-06 22:03 ` Devin Heitmueller
2012-12-06 22:12 ` Frank Schäfer
2012-12-06 22:41 ` Matthew Gyurgyik
2012-12-06 22:58 ` Matthew Gyurgyik
2012-12-07 1:40 ` Matthew Gyurgyik
2012-12-07 3:21 ` Devin Heitmueller
2012-12-07 11:49 ` Matthew Gyurgyik
2012-12-08 13:52 ` Frank Schäfer
2012-12-08 14:10 ` Matthew Gyurgyik
2012-12-08 15:20 ` Frank Schäfer
[not found] ` <50C3701D.9000700@pyther .net>
[not found] ` <50C37DA8.4080608@googlemai l.com>
[not found] ` <50C3B3EB.40606@pyther .net>
[not found] ` <50C3B567.3070300@i ki.fi>
2012-12-08 16:51 ` Matthew Gyurgyik
2012-12-08 17:49 ` Frank Schäfer
2012-12-08 21:40 ` Matthew Gyurgyik
2012-12-08 21:47 ` Antti Palosaari
2012-12-08 22:04 ` Matthew Gyurgyik
2012-12-09 12:48 ` Frank Schäfer
2012-12-09 14:50 ` Matthew Gyurgyik
2012-12-09 15:46 ` Devin Heitmueller
2012-12-09 16:19 ` Frank Schäfer
2012-12-09 16:23 ` Frank Schäfer
2012-12-09 17:06 ` Frank Schäfer
2012-12-09 17:53 ` Matthew Gyurgyik
2012-12-10 15:39 ` Frank Schäfer
2012-12-10 15:46 ` Devin Heitmueller
2012-12-10 16:01 ` Frank Schäfer
2012-12-10 16:13 ` Devin Heitmueller
2012-12-10 17:57 ` Antti Palosaari
2012-12-10 19:24 ` Frank Schäfer
2012-12-10 20:48 ` Antti Palosaari
2012-12-11 20:51 ` Frank Schäfer
2012-12-11 20:59 ` Antti Palosaari
2012-12-12 21:25 ` Frank Schäfer
2012-12-12 21:34 ` Frank Schäfer
2012-12-13 15:09 ` Antti Palosaari
2012-12-13 16:02 ` Frank Schäfer
2012-12-13 20:23 ` Mauro Carvalho Chehab [this message]
2012-12-14 15:33 ` Frank Schäfer
2012-12-14 16:32 ` Antti Palosaari
2012-12-14 16:40 ` Antti Palosaari
2012-12-14 19:39 ` Mauro Carvalho Chehab
2012-12-15 0:26 ` Mauro Carvalho Chehab
2012-12-15 0:34 ` Mauro Carvalho Chehab
2012-12-15 0:56 ` Antti Palosaari
2012-12-15 1:03 ` Mauro Carvalho Chehab
2012-12-15 1:12 ` Antti Palosaari
2012-12-15 1:39 ` Mauro Carvalho Chehab
2012-12-15 1:54 ` Mauro Carvalho Chehab
2012-12-15 13:11 ` Frank Schäfer
2012-12-15 13:34 ` Mauro Carvalho Chehab
2012-12-15 13:38 ` Antti Palosaari
2012-12-15 16:21 ` Frank Schäfer
2012-12-15 16:51 ` Antti Palosaari
2012-12-16 18:15 ` Frank Schäfer
2012-12-17 1:09 ` Matthew Gyurgyik
2012-12-17 1:26 ` Antti Palosaari
2012-12-17 1:37 ` Matthew Gyurgyik
2012-12-17 9:33 ` Antti Palosaari
2012-12-17 11:08 ` Antti Palosaari
2012-12-17 11:17 ` Matthew Gyurgyik
2012-12-17 12:30 ` Antti Palosaari
2012-12-17 15:53 ` Mauro Carvalho Chehab
2012-12-17 16:14 ` Mauro Carvalho Chehab
2012-12-18 2:27 ` Matthew Gyurgyik
2012-12-18 3:08 ` Matthew Gyurgyik
2013-01-02 20:59 ` Antti Palosaari
2013-01-03 2:53 ` Matthew Gyurgyik
2013-01-20 14:40 ` Matthew Gyurgyik
2013-01-20 17:46 ` Antti Palosaari
2013-02-16 23:38 ` Matthew Gyurgyik
2013-02-24 22:23 ` Antti Palosaari
2013-02-25 1:58 ` Matthew Gyurgyik
2013-01-03 0:18 ` David Härdeman
2012-12-13 20:07 ` Mauro Carvalho Chehab
2012-12-13 20:36 ` Mauro Carvalho Chehab
2012-12-13 19:57 ` Mauro Carvalho Chehab
2012-12-13 20:04 ` Mauro Carvalho Chehab
2012-12-10 16:01 ` Matthew Gyurgyik
2012-12-06 2:32 ` Matthew Gyurgyik
2012-12-06 21:52 ` Frank Schäfer
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=20121213182336.2cca9da6@redhat.com \
--to=mchehab@redhat.com \
--cc=crope@iki.fi \
--cc=david@hardeman.nu \
--cc=dheitmueller@kernellabs.com \
--cc=fschaefer.oss@googlemail.com \
--cc=linux-media@vger.kernel.org \
--cc=matthew@pyther.net \
/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).