From: James Hogan <james.hogan@imgtec.com>
To: "David Härdeman" <david@hardeman.nu>
Cc: <linux-media@vger.kernel.org>, <m.chehab@samsung.com>
Subject: Re: [PATCH 10/11] [RFC] rc-core: use the full 32 bits for NEC scancodes
Date: Mon, 31 Mar 2014 15:06:30 +0100 [thread overview]
Message-ID: <53397666.8090806@imgtec.com> (raw)
In-Reply-To: <37fcf3abf63e258ee29b23dc3b0f3f12@hardeman.nu>
[-- Attachment #1: Type: text/plain, Size: 2259 bytes --]
On 31/03/14 14:22, David Härdeman wrote:
> On 2014-03-31 12:56, James Hogan wrote:
>> This would mean that if the data is put in the right bit order (first
>> bit received in BIT(0), last bit received in BIT(31)), then the scancode
>> = raw, and if the data is received in the reverse bit order (like the
>> raw decoder, shifting the data left and inserting the last bit in
>> BIT(0)) then the scancode = bitrev32(raw).
>>
>> Have I missed something?
>
> I just think we have to agree to disagree :)
>
> For me, storing/presenting the scancode as 0xAAaaDDdd is "obviously" the
> clearest and least confusing interpretation. But I might have spent too
> long time using that notation in code and mentally to be able to find
> anything else intuitive :)
>
> 0xAAaaDDdd means that you read/parse/print it left to right, just as you
> would if you drew a pulse-space chart showing the received IR pulse
> (time normally progresses to the right...modulo the per-byte bitrev).
Sure, but the NEC bit order is little endian, and the scancode is a
32bit value not an array of 4 bytes, so it's artificial to expect it to
make any sense when read as big endian. E.g. if you extended the
transmission to 48 bits you'd expect the hex printed scancode to extend
to the left not the right.
The bits in the 32-bit word also become discontinuous for no good
reason, especially considering the cases we're trying to take into
account (NEC-32 and NEC-24) both effectively have 16-bit fields.
> It kind of matches the other protocol scancodes as well (the "address"
> bits high, cmd bits low, the high bits tend to remain constant for one
> given remote, the low bits change, although it's not a hard rule) and it
Very true, but you still have the low byte of the command in the 2nd
lowest byte, which is why my original suggestion was:
0xaaAAddDD
I.e. swap 16bit halves, each 16bit field intact.
> matches most software I've ever seen (AFAIK, LIRC represents NEC32
> scancodes this way, as does e.g. the Pronto software and protocol).
>
> That said...I think we at least agree that we need *a* representation
> and that it should be used consistently in all drivers, right?
Yes, that would be nice.
Cheers
James
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-03-31 14:06 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-29 16:10 [PATCH 00/11] rc-core: My current patch queue David Härdeman
2014-03-29 16:10 ` [PATCH 01/11] bt8xx: fixup RC5 decoding David Härdeman
2014-03-29 16:10 ` [PATCH 02/11] rc-core: improve ir-kbd-i2c get_key functions David Härdeman
2014-03-29 16:11 ` [PATCH 03/11] rc-core: document the protocol type David Härdeman
2014-03-31 9:54 ` James Hogan
2014-03-31 19:39 ` David Härdeman
2014-03-29 16:11 ` [PATCH 04/11] rc-core: do not change 32bit NEC scancode format for now David Härdeman
2014-03-31 9:09 ` James Hogan
2014-03-29 16:11 ` [PATCH 05/11] rc-core: split dev->s_filter David Härdeman
2014-04-03 23:27 ` James Hogan
2014-03-29 16:11 ` [PATCH 06/11] rc-core: remove generic scancode filter David Härdeman
2014-03-31 9:29 ` James Hogan
2014-03-31 19:38 ` David Härdeman
2014-03-31 22:01 ` James Hogan
2014-03-29 16:11 ` [PATCH 07/11] dib0700: NEC scancode cleanup David Härdeman
2014-03-29 16:11 ` [PATCH 08/11] lmedm04: " David Härdeman
2014-03-29 16:11 ` [PATCH 09/11] saa7134: NEC scancode fix David Härdeman
2014-03-29 16:11 ` [PATCH 10/11] [RFC] rc-core: use the full 32 bits for NEC scancodes David Härdeman
2014-03-31 9:44 ` James Hogan
2014-03-31 10:19 ` David Härdeman
2014-03-31 10:56 ` James Hogan
2014-03-31 13:22 ` David Härdeman
2014-03-31 14:06 ` James Hogan [this message]
2014-03-31 15:26 ` Mauro Carvalho Chehab
2014-03-31 16:47 ` David Härdeman
2014-03-31 12:14 ` Mauro Carvalho Chehab
2014-03-31 12:58 ` David Härdeman
2014-03-31 13:15 ` Mauro Carvalho Chehab
2014-03-31 13:54 ` David Härdeman
2014-03-29 16:11 ` [PATCH 11/11] [RFC] rc-core: don't throw away protocol information 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=53397666.8090806@imgtec.com \
--to=james.hogan@imgtec.com \
--cc=david@hardeman.nu \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.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 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).