linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] Teach lirc how to send and receive scancodes
@ 2017-01-06 12:49 Sean Young
  2017-01-06 12:49 ` [PATCH 1/9] [media] lirc: lirc interface should not be a raw decoder Sean Young
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Sean Young @ 2017-01-06 12:49 UTC (permalink / raw)
  To: linux-media, Hans Verkuil

This patch series introduces a new lirc mode, LIRC_MODE_SCANCODE. This
allows scancodes to be sent and received. This depends on earlier
series which introduces IR encoders.

Hans: do cec devices need a method for sending scancodes and if so,
would this be a useful interface? If not, should cec devices not have
a lirc char device? With these patches, cec devices will get a lirc 
char device too.

lirc already supports LIRC_MODE_LIRCCODE, but that mode is entirely
driver dependant and makes no provision for protocol information.

Receiving LIRC_MODE_SCANCODE
----------------------------
If a lirc device has the LIRC_CAN_REC_SCANCODE feature, LIRC_MODE_SCANCODE
can be set set using LIRC_SET_REC_MODE ioctl. Now when you read from the
device you receive struct lirc_scancode. In this structure you have
the scancode, rc_type, and flags. RC_TYPE_* is now in uapi, so now you
can see exactly which protocol variant was used. flags might contain
LIRC_SCANCODE_FLAGS_TOGGLE (rc5, rc6) or LIRC_SCANCODE_FLAGS_REPEAT (nec).

Using this interface, you can see what IR protocol a remote is using. This
was not easy to do before.

Sending LIRC_MODE_SCANCODE
--------------------------
If a lirc device has the LIRC_CAN_SEND_SCANCODE features, LIRC_MODE_SCANCODE
can be set using the LIRC_SET_SEND_MODE ioctl. Now you can write 
struct lirc_scancode. flags should be 0, rc_type to the RC_TYPE_* and
the scancode must be set. You can only tranmsit one lirc_scancode at a time.

This interface uses the in-kernel IR encoders to work. Using this interface
it will be possible to port lirc_zilog to rc-core. This device cannot send
raw IR, so it will not use the IR encoders but provide the same userspace
interface.

Other user-visible changes
--------------------------
Now all RC devices will have a lirc char device, including devices which
do not produce raw IR. They will be fixed in mode LIRC_MODE_SCANCODE.

Sean Young (9):
  [media] lirc: lirc interface should not be a raw decoder
  [media] lirc: exorcise struct irctl
  [media] lirc: use plain kfifo rather than lirc_buffer
  [media] lirc: implement scancode sending
  [media] rc: use the correct carrier for scancode transmit
  [media] rc: auto load encoder if necessary
  [media] lirc: implement reading scancode
  [media] lirc: scancode rc devices should have a lirc device too
  [media] lirc: LIRC_MODE_SCANCODE documentation

 Documentation/media/uapi/rc/lirc-dev-intro.rst    |  21 +-
 Documentation/media/uapi/rc/lirc-get-features.rst |  14 +
 drivers/media/rc/Kconfig                          |  15 +-
 drivers/media/rc/Makefile                         |   6 +-
 drivers/media/rc/ir-jvc-decoder.c                 |   1 +
 drivers/media/rc/ir-lirc-codec.c                  | 336 +++++++++++++--------
 drivers/media/rc/ir-nec-decoder.c                 |   1 +
 drivers/media/rc/ir-rc5-decoder.c                 |   1 +
 drivers/media/rc/ir-rc6-decoder.c                 |   1 +
 drivers/media/rc/ir-sanyo-decoder.c               |   1 +
 drivers/media/rc/ir-sharp-decoder.c               |   1 +
 drivers/media/rc/ir-sony-decoder.c                |   1 +
 drivers/media/rc/lirc_dev.c                       | 339 ++++++++++------------
 drivers/media/rc/rc-core-priv.h                   |  54 +++-
 drivers/media/rc/rc-ir-raw.c                      |  49 +++-
 drivers/media/rc/rc-main.c                        |  66 +++--
 drivers/staging/media/lirc/lirc_sasem.c           |   1 -
 include/media/lirc_dev.h                          |  25 ++
 include/media/rc-core.h                           |   8 +-
 include/media/rc-map.h                            |  52 +---
 include/uapi/linux/lirc.h                         |  66 +++++
 21 files changed, 639 insertions(+), 420 deletions(-)

-- 
2.9.3


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

end of thread, other threads:[~2017-01-29 22:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-06 12:49 [PATCH 0/9] Teach lirc how to send and receive scancodes Sean Young
2017-01-06 12:49 ` [PATCH 1/9] [media] lirc: lirc interface should not be a raw decoder Sean Young
2017-01-06 12:49 ` [PATCH 2/9] [media] lirc: exorcise struct irctl Sean Young
2017-01-06 12:49 ` [PATCH 3/9] [media] lirc: use plain kfifo rather than lirc_buffer Sean Young
2017-01-06 12:49 ` [PATCH 4/9] [media] lirc: implement scancode sending Sean Young
2017-01-06 12:49 ` [PATCH 5/9] [media] rc: use the correct carrier for scancode transmit Sean Young
2017-01-06 12:49 ` [PATCH 6/9] [media] rc: auto load encoder if necessary Sean Young
2017-01-06 12:49 ` [PATCH 7/9] [media] lirc: implement reading scancode Sean Young
2017-01-06 12:49 ` [PATCH 8/9] [media] lirc: scancode rc devices should have a lirc device too Sean Young
2017-01-06 12:49 ` [PATCH 9/9] [media] lirc: LIRC_MODE_SCANCODE documentation Sean Young
2017-01-29 22:35 ` [PATCH 0/9] Teach lirc how to send and receive scancodes Sean Young

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).