From: James Hogan <james@albanarts.com>
To: "Antti Seppälä" <a.seppala@gmail.com>
Cc: "Mauro Carvalho Chehab" <m.chehab@samsung.com>,
linux-media@vger.kernel.org, "David Härdeman" <david@hardeman.nu>,
"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: Sun, 16 Mar 2014 22:41:26 +0000 [thread overview]
Message-ID: <2300906.aKyjnYIEg7@radagast> (raw)
In-Reply-To: <CAKv9HNav3DYRcX8B_N5db012-ShoGVc7rbLW1oWV-rgcwDaGmg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3737 bytes --]
On Sunday 16 March 2014 10:22:02 Antti Seppälä wrote:
> On 15 March 2014 01:04, James Hogan <james@albanarts.com> wrote:
> > A recent discussion about proposed interfaces for setting up the
> > hardware wakeup filter lead to the conclusion that it could help to have
> > the generic capability to encode and modulate scancodes into raw IR
> > events so that drivers for hardware with a low level wake filter (on the
> > level of pulse/space durations) can still easily implement the higher
> > level scancode interface that is proposed.
> >
> > I posted an RFC patchset showing how this could work, and Antti Seppälä
> > posted additional patches to support rc5-sz and nuvoton-cir. This
> > patchset improves the original RFC patches and combines & updates
> > Antti's patches.
> >
> > I'm happy these patches are a good start at tackling the problem, as
> > long as Antti is happy with them and they work for him of course.
> >
> > Future work could include:
> > - Encoders for more protocols.
> > - Carrier signal events (no use unless a driver makes use of it).
> >
> > Patch 1 adds the new encode API.
> > Patches 2-3 adds some modulation helpers.
> > Patches 4-6 adds some raw encode implementations.
> > Patch 7 adds some rc-core support for encode based wakeup filtering.
> > Patch 8 adds debug loopback of encoded scancode when filter set.
> > Patch 9 (untested) adds encode based wakeup filtering to nuvoton-cir.
>
> Hi James.
>
> This is looking very good. I've reviewed the series and have only
> minor comments to some of the patches which I'll post individually
> shortly.
>
> I've also tested the nuvoton with actual hardware with rc-5-sz and nec
> encoders and both generate wakeup samples correctly and can wake the
> system.
Thanks for reviewing and testing!
> While doing my tests I also noticed that there is a small bug in the
> wakeup_protocols handling where one can enable multiple protocols with
> the + -notation. E.g. echo "+nec +rc-5" >
> /sys/class/rc/rc0/wakeup_protocols shouldn't probably succeed.
Yeh I'm in two minds about this now. It's actually a little awkward since some
of the protocols have multiple variants (i.e. "rc-5" = RC5+RC5X), but an
encoded message is only ever a single variant, so technically if you're going
to draw the line for wakeup protocols it should probably be at one enabled
variant, which isn't always convenient or necessary.
Note, ATM even disallowing "+proto" and "-proto" we would already have to
guess which variant is desired from the scancode data, which in the case of
NEC scancodes is a bit horrid since NEC scancodes are ambiguous. This actually
means it's driver specific whether a filter mask of 0x0000ffff filters out
NEC32/NEC-X messages (scancode/encode driver probably will since it needs to
pick a variant, but software fallback won't).
Ideally there'd now be a way to specify the protocol variants exactly as well
as whole protocols groups through this sysfs interface (and probably NEC
should have protocol bits for each variant too, which is tricky ATM since
keymaps can use scancodes of multiple variants and it's hard to guarantee
which variant was intended for each key mapping by reading it).
Adding proto_names entries for each variant is easy enough, though I'm not
sure what you'd call the one for RC_BIT_RC5 (since "rc-5" is taken to mean
both RC5 and RC5X). We could then check that the enabled wakeup protocols fit
entirely within one of the proto_names entry's proto mask if we think it's
helpful (which would allow you to specify e.g. "sony12", or "sony" (sony
12,15,20), or "sony -sony12" (sony 15,20), but not "+sony +nec").
Cheers
James
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-03-16 22:41 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 [this message]
2014-03-17 17:01 ` Antti Seppälä
2014-03-17 22:34 ` James Hogan
2014-03-25 0:15 ` David Härdeman
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=2300906.aKyjnYIEg7@radagast \
--to=james@albanarts.com \
--cc=a.seppala@gmail.com \
--cc=david@hardeman.nu \
--cc=hans.verkuil@cisco.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