From: Sean Young <sean@mess.org>
To: linux-media@vger.kernel.org
Subject: [PATCH v3 00/19] Teach lirc how to send and receive scancodes
Date: Sat, 25 Feb 2017 11:51:15 +0000 [thread overview]
Message-ID: <cover.1488023302.git.sean@mess.org> (raw)
This patch series has some general cleanup work, then the lirc scancode
interface (v3) and lirc documentation fixes. The cleanups are needed for
the new scancode interface.
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.
Changes v2 -> v3:
- add timestamp to lirc_scancode struct to record when scancode was
decoded in ktime (CLOCK_MONOTONIC)
- Rather than add more members to rc_dev and ir_raw_event_ctrl, now
we have all the lirc settings for rc-core in lirc_node
- Various small fixes.
Changes v1 -> v2:
- changed the scancode to 64 bit. There are many IR protocols which encode
more than 32 bits; we don't support any at the moment but might as
well future-proof it
http://www.hifi-remote.com/wiki/index.php?title=DecodeIR
- Various small fixes.
- Added documentation
Sean Young (19):
[media] lirc: document lirc modes better
[media] lirc: return ENOTTY when ioctl is not supported
[media] lirc: return ENOTTY when device does support ioctl
[media] winbond: allow timeout to be set
[media] gpio-ir: do not allow a timeout of 0
[media] rc: lirc keymap no longer makes any sense
[media] lirc: advertise LIRC_CAN_GET_REC_RESOLUTION and improve
[media] mce_kbd: add encoder
[media] serial_ir: iommap is a memory address, not bool
[media] lirc: use refcounting for lirc devices
[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: document LIRC_MODE_SCANCODE
Documentation/media/lirc.h.rst.exceptions | 50 ++-
Documentation/media/uapi/rc/lirc-dev-intro.rst | 78 +++-
Documentation/media/uapi/rc/lirc-get-features.rst | 28 +-
Documentation/media/uapi/rc/lirc-get-length.rst | 3 +-
Documentation/media/uapi/rc/lirc-get-rec-mode.rst | 8 +-
Documentation/media/uapi/rc/lirc-get-send-mode.rst | 8 +-
Documentation/media/uapi/rc/lirc-read.rst | 22 +-
.../media/uapi/rc/lirc-set-rec-carrier-range.rst | 2 +-
.../media/uapi/rc/lirc-set-rec-timeout-reports.rst | 2 +
Documentation/media/uapi/rc/lirc-write.rst | 25 +-
drivers/media/rc/Kconfig | 15 +-
drivers/media/rc/Makefile | 6 +-
drivers/media/rc/gpio-ir-recv.c | 2 +-
drivers/media/rc/igorplugusb.c | 2 +-
drivers/media/rc/ir-jvc-decoder.c | 1 +
drivers/media/rc/ir-lirc-codec.c | 367 ++++++++++++------
drivers/media/rc/ir-mce_kbd-decoder.c | 56 ++-
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/keymaps/Makefile | 1 -
drivers/media/rc/keymaps/rc-lirc.c | 42 --
drivers/media/rc/lirc_dev.c | 431 +++++++++------------
drivers/media/rc/rc-core-priv.h | 61 ++-
drivers/media/rc/rc-ir-raw.c | 55 ++-
drivers/media/rc/rc-main.c | 73 ++--
drivers/media/rc/serial_ir.c | 4 +-
drivers/media/rc/st_rc.c | 2 +-
drivers/media/rc/winbond-cir.c | 4 +-
drivers/staging/media/lirc/lirc_sasem.c | 3 +-
drivers/staging/media/lirc/lirc_zilog.c | 167 ++++----
include/media/lirc_dev.h | 33 +-
include/media/rc-core.h | 3 +
include/media/rc-map.h | 109 ++----
include/uapi/linux/lirc.h | 76 ++++
38 files changed, 1069 insertions(+), 676 deletions(-)
delete mode 100644 drivers/media/rc/keymaps/rc-lirc.c
--
2.9.3
next reply other threads:[~2017-02-25 11:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-25 11:51 Sean Young [this message]
2017-02-25 11:51 ` [PATCH v3 01/19] [media] lirc: document lirc modes better Sean Young
2017-02-25 11:51 ` [PATCH v3 02/19] [media] lirc: return ENOTTY when ioctl is not supported Sean Young
2017-02-25 11:51 ` [PATCH v3 03/19] [media] lirc: return ENOTTY when device does support ioctl Sean Young
2017-02-25 11:51 ` [PATCH v3 04/19] [media] winbond: allow timeout to be set Sean Young
2017-02-25 11:51 ` [PATCH v3 05/19] [media] gpio-ir: do not allow a timeout of 0 Sean Young
2017-02-25 11:51 ` [PATCH v3 06/19] [media] rc: lirc keymap no longer makes any sense Sean Young
2017-02-25 11:51 ` [PATCH v3 07/19] [media] lirc: advertise LIRC_CAN_GET_REC_RESOLUTION and improve Sean Young
2017-02-25 11:51 ` [PATCH v3 08/19] [media] mce_kbd: add encoder Sean Young
2017-02-25 11:51 ` [PATCH v3 09/19] [media] serial_ir: iommap is a memory address, not bool Sean Young
2017-02-25 11:51 ` [PATCH v3 10/19] [media] lirc: use refcounting for lirc devices Sean Young
2017-02-25 11:51 ` [PATCH v3 11/19] [media] lirc: lirc interface should not be a raw decoder Sean Young
2017-02-25 11:51 ` [PATCH v3 12/19] [media] lirc: exorcise struct irctl Sean Young
2017-02-25 11:51 ` [PATCH v3 13/19] [media] lirc: use plain kfifo rather than lirc_buffer Sean Young
2017-02-25 11:51 ` [PATCH v3 14/19] [media] lirc: implement scancode sending Sean Young
2017-02-25 11:51 ` [PATCH v3 15/19] [media] rc: use the correct carrier for scancode transmit Sean Young
2017-02-25 11:51 ` [PATCH v3 16/19] [media] rc: auto load encoder if necessary Sean Young
2017-02-25 11:51 ` [PATCH v3 17/19] [media] lirc: implement reading scancode Sean Young
2017-03-02 13:31 ` Sean Young
2017-03-06 16:16 ` [PATCH] [media] lirc: introduce LIRC_SET_POLL_MODE Sean Young
2017-02-25 11:51 ` [PATCH v3 18/19] [media] lirc: scancode rc devices should have a lirc device too Sean Young
2017-02-25 11:51 ` [PATCH v3 19/19] [media] lirc: document LIRC_MODE_SCANCODE Sean Young
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=cover.1488023302.git.sean@mess.org \
--to=sean@mess.org \
--cc=linux-media@vger.kernel.org \
/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).