public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/9] rc: Add IR encode based wakeup filtering
@ 2014-03-14 23:04 James Hogan
  2014-03-14 23:04 ` [PATCH v2 1/9] rc: ir-raw: Add scancode encoder callback James Hogan
                   ` (10 more replies)
  0 siblings, 11 replies; 24+ messages in thread
From: James Hogan @ 2014-03-14 23:04 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Antti Seppälä
  Cc: linux-media, James Hogan, David Härdeman, Jarod Wilson,
	Wei Yongjun, Hans Verkuil

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.

Changes in v2:

Patchset:
 - Alter encode API to return -ENOBUFS when there isn't enough buffer
   space. When this occurs all buffer contents must have been written
   with the partial encoding of the scancode. This is to allow drivers
   such as nuvoton-cir to provide a shorter buffer and still get a
   useful partial encoding for the wakeup pattern.
 - Added RC-5 & RC-5X encoder.
 - Add encode_wakeup support which keeps allowed wakeup protocols in
   sync with registered encoders.

Pulse-distance modulation helper:
 - Update ir_raw_gen_pd() with a kerneldoc comment and individual buffer
   full checks rather than a single one at the beginning, in order to
   support -ENOBUFS properly.
 - Update ir_raw_gen_pulse_space() to check the number of free slots and
   fill as many as possible before returning -ENOBUFS.
 - Fix brace placement for timings struct.

Manchester encoding helper:
 - Add kerneldoc comment.
 - Add individual buffer full checks, in order to support -ENOBUFS
   properly.
 - Make i unsigned to theoretically support all 32bits of data.
 - Increment *ev at end so caller can calculate correct number of
   events (during the loop *ev points to the last written event to allow
   it to be extended in length).
 - Make start/leader pulse optional, continuing from (*ev)[-1] if
   disabled. This helps support rc-5x which has a space in the middle of
   the bits.

rc5-sz encoder:
 - Turn ir_rc5_sz_encode() comment into kerneldoc and update to reflect
   new API.
 - Be more flexible around accepted scancode masks, as long as all the
   important bits are set (0x2fff) and none of the unimportant bits are
   set in the data. Also mask off the unimportant bits before passing to
   ir_raw_gen_manchester().
 - Explicitly enable leader bit in Manchester modulation timings.

rc-loopback:
 - Move img-ir-raw test code to rc-loopback.
 - Set encode_wakeup so that the set of allowed wakeup protocols matches
   the set of raw IR encoders.

nuvoton-cir:
 - Change reference to rc_dev::enabled_protocols to
   enabled_protocols[type] since it has been converted to an array.
 - Fix IR encoding buffer loop condition to be i < ret rather than i <=
   ret. The return value of ir_raw_encode_scancode is the number of
   events rather than the last event.
 - Set encode_wakeup so that the set of allowed wakeup protocols matches
   the set of raw IR encoders.

Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Antti Seppälä <a.seppala@gmail.com>
Cc: David Härdeman <david@hardeman.nu>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: Hans Verkuil <hans.verkuil@cisco.com>

Antti Seppälä (3):
  rc: ir-raw: Add Manchester encoder (phase encoder) helper
  rc: ir-rc5-sz-decoder: Add ir encoding support
  rc: nuvoton-cir: Add support for writing wakeup samples via sysfs
    filter callback

James Hogan (6):
  rc: ir-raw: Add scancode encoder callback
  rc: ir-raw: Add pulse-distance modulation helper
  rc: ir-nec-decoder: Add encode capability
  rc: ir-rc5-decoder: Add encode capability
  rc: rc-core: Add support for encode_wakeup drivers
  rc: rc-loopback: Add loopback of filter scancodes

 drivers/media/rc/ir-nec-decoder.c    |  93 +++++++++++++++++
 drivers/media/rc/ir-raw.c            | 191 +++++++++++++++++++++++++++++++++++
 drivers/media/rc/ir-rc5-decoder.c    | 103 +++++++++++++++++++
 drivers/media/rc/ir-rc5-sz-decoder.c |  45 +++++++++
 drivers/media/rc/nuvoton-cir.c       | 123 ++++++++++++++++++++++
 drivers/media/rc/nuvoton-cir.h       |   1 +
 drivers/media/rc/rc-core-priv.h      |  85 ++++++++++++++++
 drivers/media/rc/rc-loopback.c       |  39 +++++++
 drivers/media/rc/rc-main.c           |  11 +-
 include/media/rc-core.h              |   7 ++
 10 files changed, 695 insertions(+), 3 deletions(-)

-- 
1.8.3.2


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2014-07-25 20:47 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-07-23 19:39 ` Mauro Carvalho Chehab
2014-07-25 20:46   ` James Hogan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox