path: root/utils/keytable
AgeCommit message (Collapse)AuthorFilesLines
2021-06-16keytable: ensure BPF IR decoders use correct section nameSean Young10-35/+50
The convention is to have the type ("lirc_mode2/") prefixed so the BPF loader knows what type it is. Signed-off-by: Sean Young <sean@mess.org>
2021-05-27v4l-utils: sync with upstream media_tree masterHans Verkuil2-57/+2
Update to the latest kernel media headers. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-04-09keytable: restrict installation of 50-rc_keymap.confUlrich Ölmann1-0/+4
It is only needed if BPF is effectively used and the package is compiled for a systemd based target. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sean Young <sean@mess.org>
2021-03-06v4l-utils: sync with latest media kernelSean Young143-0/+160
Sync with 5.12-rc1 Signed-off-by: Sean Young <sean@mess.org>
2021-03-06keytable: fix typoUlrich Ölmann1-1/+1
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Sean Young <sean@mess.org>
2021-03-06keytable: Add source information in generated keymapsBastien Nocera1-1/+5
Add comments to mention that keymap files are generated, and list which tool was used to generate them and the kernel source filename. This should make it less likely that generated files are used as examples to contribute keymaps from, and more likely that upstream changes are channeled through the right source tree. Signed-off-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Sean Young <sean@mess.org>
2021-01-13Build with libbpf, remove local sourcesLuca Boccassi6-613/+12
libbpf is nowadays widely available in all distros that enable BPF, and it is a standalone library with a release cycle and a stable API. Remove the old sync of bpf.c/bpf.h and check for the library via pkg-config and use it instead. Only a minor modification is needed to make it compile. Signed-off-by: Luca Boccassi <bluca@debian.org> Signed-off-by: Sean Young <sean@mess.org>
2021-01-06v4l-utils: sync with latest media_tree master repoHans Verkuil4-0/+134
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-12-03v4l-utils: sync with media_tree masterHans Verkuil2-0/+5
The FWHT stateless codec API is now an official public API, so this required a few changes. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-07-29Move sync-with-kernel into dedicated shell script ./sync-with-kernel.shSean Young1-13/+0
The make sync-with-kernel target is a collection of shell fragments scattered over the tree. Collect all of them into a single shell script. This makes it is easier to see what sync-with-kernel does, and makes the move away from autotools to meson possible. Reviewed-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar> Signed-off-by: Sean Young <sean@mess.org>
2020-07-21Use standard integer typesHans Petter Selasky1-12/+12
Fixes compilation under FreeBSD. Signed-off-by: Hans Petter Selasky <hps@selasky.org> Signed-off-by: Sean Young <sean@mess.org>
2020-07-10keytable: Fix missing inclusion of argp.hIsmael Luceno1-0/+1
error_t is only defined by argp.h on non-glibc systems. Signed-off-by: Ismael Luceno <ismael@iodev.co.uk> Signed-off-by: Sean Young <sean@mess.org>
2020-05-21keytable: "-p all" should not attempt BPF decodes that don't existSean Young1-6/+12
Currently we only have a BPF decoder for xbox_dvd. Other decoders should not be attempted. Reported-by: Ralf Schmidt <rds2@gmx.de> Signed-off-by: Sean Young <sean@mess.org>
2020-04-20treewide: do not use return after elseRosen Penev1-4/+4
Found with clang-tidy's readability-else-after-return Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: split '} if () {' into two lines] [hverkuil-cisco@xs4all.nl: split 'if () continue; else return -1;' into two lines]
2020-04-17treewide: remove bzeroRosen Penev1-47/+23
bzero is gone in POSIX 2008. Replace with {} and memset. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-04-16v4l-utils: sync with latest media_tree masterHans Verkuil1-0/+1
Sync the kernel headers to the latest media_tree master. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-04-08keytable: add compatibility for input_event_secRosen Penev1-0/+4
Linux 4.16 added support for this macro. When it is not available, define it back to the previous value. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Sean Young <sean@mess.org>
2020-03-30keytable: use input_event properlyRosen Penev1-1/+1
It does not use time_t under musl when time_t is 64-bit. The struct has compatibility defines. Instead of using time_t directly, use those defines. Fixes compilation under musl 1.2.0 under 32-bit OSes. Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Sean Young <sean@mess.org>
2020-03-12Add keymap for Samsung AK59-00125A remoteSean Young1-0/+69
Signed-off-by: Sean Young <sean@mess.org>
2020-03-12keytable: new samsung36 bpf decoderSean Young2-1/+137
Signed-off-by: Sean Young <sean@mess.org>
2020-03-12keytable: support 64 bit scancodesSean Young1-25/+55
Signed-off-by: Sean Young <sean@mess.org>
2020-03-09sync with latest media_tree masterHans Verkuil4-0/+129
Sync the kernel headers to the latest media_tree master. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-01-23rc_keymap.5: improve wording around using rc_keymaps for sendingSean Young1-10/+11
Signed-off-by: Sean Young <sean@mess.org>
2019-10-2850-rc_keymap.conf prevents debian testing from bootingSean Young1-0/+2
If SystemCallFilter is not set for systemd-udevd, then 50-rc_keymap.conf restricts the service to _only_ the bpf syscall, preventing the system from booting. Tested-by: Hans Verkuil <hverkuil@xs4all.nl> Reported-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Sean Young <sean@mess.org>
2019-10-24keytable: cannot load BPF decoders from udevdSean Young2-1/+5
By default udevd is not allowed to execute BPF syscalls. Implement workaround as suggested in: https://github.com/systemd/systemd/issues/13787 Signed-off-by: Sean Young <sean@mess.org>
2019-10-21v4l-utils: sync with latest media_tree masterHans Verkuil2-0/+19
Sync the kernel headers to the latest media_tree master. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-10-20ir-keytable: bpf: improve rsc imon pointer decoderSean Young1-31/+35
Sometimes the remotes sends 4 bits rather than 5. This makes the pointer much more reliable. Signed-off-by: Sean Young <sean@mess.org>
2019-10-14keytable: do not warn if keymap not found in IR_KEYTABLE_USER_DIRSean Young1-33/+48
The following error is logged even though imon_rsc.toml is found at /lib/udev/rc_keymaps/imon_rsc.toml: $ ir-keytable -a /etc/rc_maps.cfg /etc/rc_keymaps/imon_rsc.toml: error: cannot open: No such file or directory Signed-off-by: Sean Young <sean@mess.org>
2019-10-02keytable: add new generated keymapsHans Verkuil7-0/+197
Added for: Amediatech X96-MAX HardKernel ODROID Tanix TX3 mini Khadas VIM/EDGE WeTek Hub Tanix TX5 max WeTeK Play 2 Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-10-02v4l-utils: sync with latest media_tree masterHans Verkuil1-0/+7
Sync the kernel headers to the latest media_tree master. This required some work in the cec utilities since the remote control UI commands are now autogenerated from the cec.h header instead of being hardcoded in the cec utilities. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-09-22keytable: distribute gen_input_events.plGregor Jasny1-1/+1
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2019-09-22keytable: distribute bitmap.hGregor Jasny1-1/+1
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2019-09-07keytable: kernel v5.2 does not like - in BPF nameSean Young1-1/+1
Replace with _. Signed-off-by: Sean Young <sean@mess.org>
2019-09-06keytable: improve error message if bpf loading failsSean Young2-10/+13
Signed-off-by: Sean Young <sean@mess.org>
2019-09-04ir-ctl: fix memory leaksSean Young1-5/+5
Signed-off-by: Sean Young <sean@mess.org>
2019-09-04keytable: ensure we have enough memlock pagesSean Young1-0/+14
Since kernel v5.2, BPF maps and programs are charged against RLIMT_MEMLOCK. By default this limit is 64KB however all of these are already taken (16 pages on x86) by the time we've booted on Fedora. This results in a permission denied error. The error message is confusing since it happens when running as root. systemd works around this problem by setting setrlimit(RLIMIT_MEMLOCK) to 64MB. Do the the same. Signed-off-by: Sean Young <sean@mess.org>
2019-09-02keytable fix warning when building without BPF enabledSean Young1-1/+1
CC keytable.o keytable.c:1832:76: warning: ‘struct toml_table_t’ declared inside parameter list will not be visible outside of this definition or declaration 1832 | ach_bpf(const char *lirc_name, const char *bpf_prog, struct toml_table_t *toml) | ^~~~~~~~~~~~ keytable.c: In function ‘main’: keytable.c:2108:42: warning: passing argument 3 of ‘attach_bpf’ from incompatible pointer type [-Wincompatible-pointer-types] 2108 | attach_bpf(rc_dev.lirc_name, fname, b->param); | ~^~~~~~~ | | | struct protocol_param * keytable.c:1832:90: note: expected ‘struct toml_table_t *’ but argument is of type ‘struct protocol_param *’ 1832 | char *lirc_name, const char *bpf_prog, struct toml_table_t *toml) | ~~~~~~~~~~~~~~~~~~~~~^~~~ Signed-off-by: Sean Young <sean@mess.org>
2019-08-27rc_keymap: change raw format to much more common raw stringSean Young1-4/+5
Many programs and documentation lists raw IR a list of ints: +8800 –4400 +550 –1650 +550 –1650 +550 –1650 +550 –550 +550 One example of many: http://hifi-remote.com/wiki/index.php/Infrared_Protocol_Primer The + and - are optional and are there for readability. I think this is much nicer format that 1) toml arrays and 2) lirc pulse space format. As a first start, let's update the toml rc keymap format; the existing toml raw array has not been in a release. Now the Fisher Price C0108 remote looks like: [[protocols]] name = 'Fisher_Price_C0108' protocol = 'raw' [[protocols.raw]] keycode = 'KEY_NOTA' raw = '+121 -839 +864 -824 +864 -821 +864 -822 +891' Signed-off-by: Sean Young <sean@mess.org>
2019-08-27ir-ctl: send keys based on keymapSean Young4-2510/+4
ir-ctl can now send keys based on rc keymaps. The keymap file must be specified and the keys to be sent: ir-ctl -k /lib/udev/rc_keymaps/hauppauge.toml -K KEY_VOLUMEUP Signed-off-by: Sean Young <sean@mess.org>
2019-08-27keytable: move keymap parsing into its own fileSean Young7-449/+612
We would like to reuse keymap parsing for transmitting IR based on keymap in ir-ctl. This also reduces the size of our huge keytable.c, and keeps knowledge toml localised to the keymap parser. Signed-off-by: Sean Young <sean@mess.org>
2019-08-14v4l-utils: sync with media_tree masterSean Young3-5/+12
Signed-off-by: Sean Young <sean@mess.org>
2019-08-11keytable: fix build on ubuntuSean Young2-9/+0
Signed-off-by: Sean Young <sean@mess.org>
2019-08-10keytable: fix building without HAVE_BPFSean Young4-1/+15
The struct raw_entry was defined in a BPF header file which was not included. Spin it out to its own header file. Signed-off-by: Sean Young <sean@mess.org>
2019-08-09v4l-utils: sync with media_tree masterHans Verkuil1-8/+1
Update to the latest code. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-08-08keytable: add support for keymap with raw literalsSean Young7-8/+453
These rc keymaps look like: [[protocols]] name = 'Beon_Colour_TV' protocol = 'raw' [[protocols.raw]] keycode = 'KEY_POWER' raw = [ 1324, 842, 6697, 26400, 1324, 842, 6697 ] [[protocols.raw]] keycode = 'KEY_MUTE' raw = [ 1305, 865, 2357, 931, 3411, 26400, 1305, 865, 2357, 931, 3411 ] So the incoming IR will be literally compared against the IR given, and only if the entire array matches with no leading or trailing IR will the keycode be reported. This is analogous to lircd raw_codes support, so lircd2toml.py can also convert raw_codes lircd.conf files. This means that the vast majority of lircd files can now be converted. This feature requires loops in BPF programs so this is only supported in kernel 5.3 onwards. Signed-off-by: Sean Young <sean@mess.org>
2019-08-01keytable: generate missing keys like KEY_ZOOMSean Young3-40/+103
The input-event-codes.h now contains lines like: #define KEY_ZOOM KEY_FULL_SCREEN Ensure these parsed correctly. Signed-off-by: Sean Young <sean@mess.org>
2019-07-31keytable: check keymapsSean Young2-14/+29
Signed-off-by: Sean Young <sean@mess.org>
2019-07-22v4l-utils: sync-with-kernelHans Verkuil111-1249/+1241
Sync with the latest media_tree/master branch. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-07-03gen_keytables.pl: remove duplicate scancodes from keymapSean Young1-1/+11
One scancode can only be mapped to one keycode. In addition, the toml is invalid so the keymap cannot be loaded. Cc: Bastien Nocera <hadess@hadess.net> Signed-off-by: Sean Young <sean@mess.org>
2019-07-03gen_keytables.pl: strip comments from C filesSean Young1-2/+11
Some keymaps contain mappings in comments which should have not been included. Cc: Bastien Nocera <hadess@hadess.net> Signed-off-by: Sean Young <sean@mess.org>

Privacy Policy