From: "David Härdeman" <david@hardeman.nu>
To: James Hogan <james@albanarts.com>
Cc: "Antti Seppälä" <a.seppala@gmail.com>,
"Mauro Carvalho Chehab" <m.chehab@samsung.com>,
linux-media@vger.kernel.org, "Jarod Wilson" <jarod@redhat.com>,
"Wei Yongjun" <yongjun_wei@trendmicro.com.cn>,
"Hans Verkuil" <hans.verkuil@cisco.com>
Subject: Re: [PATCH v2 0/9] rc: Add IR encode based wakeup filtering
Date: Tue, 25 Mar 2014 01:15:32 +0100 [thread overview]
Message-ID: <20140325001532.GB25627@hardeman.nu> (raw)
In-Reply-To: <1894298.cUReo31JQU@radagast>
On Mon, Mar 17, 2014 at 10:34:25PM +0000, James Hogan wrote:
>It's ambiguous the other way too (which is probably a strong point against
>having actual protocol bits for each NEC variant, since they only differ in
>how the scancode is constructed). E.g. the Tivo keymap is 32-bit NEC, but has
>extended NEC scancodes where the bytes of the command are complements (i.e.
>the extended NEC command checksum passes). This makes it hard to filter on at
>the scancode level (the drivers will probably get it right for the hardware
>filters, but the software filter will likely get it wrong in those corner
>cases since it knows nothing of NEC).
>
>There's multiple ways the NEC scancode formats could be improved
>(incompatibly!) to reduce the problems, but none are perfect.
>
>E.g. one possibility is to scrap the NEC and extended NEC scancodes and just
>use 32-bit NEC scancodes format throughout:
YES!
All the "knowledge" of "original" NEC (16 bit), "extended" NEC, etc that
have multiplied over both drivers and in various parts of rc-core is a
big mistake IMHO. The only sane way of handling NEC is to always treat
it as a 32 bit scancode (and only in cases where e.g. the hardware
returns or expects a 16 bit value should the scancode be converted
to/from the canonical 32 bit format). There is absolutely no advantages
in trying to parse or "understand" the NEC format unless it absolutely
cannot be avoided.
I haven't had the time to really review your patches in depth, but
whatever you do, please try to keep any knowledge of NEC 16/24/32 bit
distinction out of any functionality you add.
I had a suggested patch before which would also make the keymap handling
32-bit centric...essentially by redefining the set/get keymap ioctls a
bit (with backwards compatibility that guesses if the scancode is
16/24/32 bit based). It's been on my todo list for a long time to dust it
off...(yeah...I know)...
>0x[16-bit-address][16-bit-command]
>
>which encodes scancodes for extended NEC like this:
>0x[16-bit-address][~8-bit-command][8-bit-command]
>
>and normal NEC like this:
>0x[~8-bit-address][8-bit-address][~8-bit-command][8-bit-command]
>
>Thanks
>James
--
David Härdeman
next prev parent reply other threads:[~2014-03-25 0:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 23:04 [PATCH v2 0/9] rc: Add IR encode based wakeup filtering James Hogan
2014-03-14 23:04 ` [PATCH v2 1/9] rc: ir-raw: Add scancode encoder callback James Hogan
2014-03-14 23:04 ` [PATCH v2 2/9] rc: ir-raw: Add pulse-distance modulation helper James Hogan
2014-03-14 23:04 ` [PATCH v2 3/9] rc: ir-raw: Add Manchester encoder (phase encoder) helper James Hogan
2014-03-14 23:04 ` [PATCH v2 4/9] rc: ir-nec-decoder: Add encode capability James Hogan
2014-03-14 23:04 ` [PATCH v2 5/9] rc: ir-rc5-decoder: " James Hogan
2014-03-14 23:04 ` [PATCH v2 6/9] rc: ir-rc5-sz-decoder: Add ir encoding support James Hogan
2014-03-16 8:34 ` Antti Seppälä
2014-03-16 11:50 ` James Hogan
2014-03-16 12:14 ` Antti Seppälä
2014-03-16 21:18 ` James Hogan
2014-03-17 16:34 ` Antti Seppälä
2014-03-14 23:04 ` [PATCH v2 7/9] rc: rc-core: Add support for encode_wakeup drivers James Hogan
2014-03-14 23:04 ` [PATCH v2 8/9] rc: rc-loopback: Add loopback of filter scancodes James Hogan
2014-03-14 23:04 ` [PATCH v2 9/9] rc: nuvoton-cir: Add support for writing wakeup samples via sysfs filter callback James Hogan
2014-03-16 8:39 ` Antti Seppälä
2014-03-16 11:52 ` James Hogan
2014-03-16 8:22 ` [PATCH v2 0/9] rc: Add IR encode based wakeup filtering Antti Seppälä
2014-03-16 22:41 ` James Hogan
2014-03-17 17:01 ` Antti Seppälä
2014-03-17 22:34 ` James Hogan
2014-03-25 0:15 ` David Härdeman [this message]
2014-07-23 19:39 ` Mauro Carvalho Chehab
2014-07-25 20:46 ` James Hogan
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=20140325001532.GB25627@hardeman.nu \
--to=david@hardeman.nu \
--cc=a.seppala@gmail.com \
--cc=hans.verkuil@cisco.com \
--cc=james@albanarts.com \
--cc=jarod@redhat.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=yongjun_wei@trendmicro.com.cn \
/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