diff options
author | Sean Young <sean@mess.org> | 2018-12-06 13:01:03 +0000 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-12-09 14:37:18 -0800 |
commit | 01d3240a04f4c09392e13c77b54d4423ebce2d72 (patch) | |
tree | 429aa466773d2210b59d0b5eaa68c418b211aafd /tools/testing/selftests/bpf/test_lirc_mode2_kern.c | |
parent | Merge branch 'bpf_line_info' (diff) | |
download | wireguard-linux-01d3240a04f4c09392e13c77b54d4423ebce2d72.tar.xz wireguard-linux-01d3240a04f4c09392e13c77b54d4423ebce2d72.zip |
media: bpf: add bpf function to report mouse movement
Some IR remotes have a directional pad or other pointer-like thing that
can be used as a mouse. Make it possible to decode these types of IR
protocols in BPF.
Cc: netdev@vger.kernel.org
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_lirc_mode2_kern.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_lirc_mode2_kern.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_lirc_mode2_kern.c b/tools/testing/selftests/bpf/test_lirc_mode2_kern.c index ba26855563a5..4147130cc3b7 100644 --- a/tools/testing/selftests/bpf/test_lirc_mode2_kern.c +++ b/tools/testing/selftests/bpf/test_lirc_mode2_kern.c @@ -15,6 +15,9 @@ int bpf_decoder(unsigned int *sample) if (duration & 0x10000) bpf_rc_keydown(sample, 0x40, duration & 0xffff, 0); + if (duration & 0x20000) + bpf_rc_pointer_rel(sample, (duration >> 8) & 0xff, + duration & 0xff); } return 0; |