Teach lirc how to send and receive scancodes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest19 patches 1 replyIn review
- v219 patches 1 replySuperseded
- v19 patches 1 replySuperseded
Changes in v3 from the cover letter
- 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.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/19 | lirc: document lirc modes betterDocumentation/ Documentation/ Documentation/ +7 more | +86 | 0 replies | |
| 2/19 | lirc: return ENOTTY when ioctl is not supporteddrivers/ drivers/ | +11 | 0 replies | |
| 3/19 | lirc: return ENOTTY when device does support ioctldrivers/ | +6 | 0 replies | |
| 4/19 | winbond: allow timeout to be setdrivers/ | +3 | 0 replies | |
| 5/19 | gpio-ir: do not allow a timeout of 0drivers/ | +1 | 0 replies | |
| 6/19 | rc: lirc keymap no longer makes any sensedrivers/ drivers/ drivers/ +1 more | +1 | 0 replies | |
| 7/19 | lirc: advertise LIRC_CAN_GET_REC_RESOLUTION and improvedrivers/ | +7 | 0 replies | |
| 8/19 | mce_kbd: add encoderdrivers/ drivers/ drivers/ +3 more | +99 | 0 replies | |
| 9/19 | serial_ir: iommap is a memory address, not booldrivers/ | +2 | 0 replies | |
| 10/19 | lirc: use refcounting for lirc devicesdrivers/ | +51 | 0 replies | |
| 11/19 | lirc: lirc interface should not be a raw decoderdrivers/ drivers/ drivers/ +4 more | +71 | 0 replies | |
| 12/19 | lirc: exorcise struct irctldrivers/ drivers/ drivers/ +2 more | +288 | 0 replies | |
| 13/19 | lirc: use plain kfifo rather than lirc_bufferdrivers/ drivers/ drivers/ +1 more | +107 | 0 replies | |
| 14/19 | lirc: implement scancode sendingdrivers/ drivers/ include/ +1 more | +130 | 0 replies | |
| 15/19 | rc: use the correct carrier for scancode transmitdrivers/ drivers/ drivers/ +9 more | +56 | 0 replies | |
| 16/19 | rc: auto load encoder if necessarydrivers/ drivers/ drivers/ | +4 | 0 replies | |
| 17/19 | lirc: implement reading scancodedrivers/ drivers/ drivers/ +1 more | +118 | 2 replies | |
| 18/19 | lirc: scancode rc devices should have a lirc device toodrivers/ | +2 | 0 replies | |
| 19/19 | lirc: document LIRC_MODE_SCANCODEDocumentation/ Documentation/ Documentation/ +4 more | +110 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 00/19] Teach lirc how to send and receive scancodes
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
Signature · 1 line
2.9.3