media: rc: self test for IR encoders and decoders
Subsystems (2)
sean at mess.org (Sean Young)
PATCH 1/1 media: rc: self test for IR encoders and decoders
ir-loopback can transmit IR on one rc device and check the correct scancode and protocol is decoded on a different rc device. This can be used to check IR transmission between two rc devices. Using rc-loopback, we use it to check the IR encoders and decoders themselves.
No hardware is required for this test.
--- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/ir/.gitignore | 1 + tools/testing/selftests/ir/Makefile | 5 + tools/testing/selftests/ir/ir_loopback.c | 199 ++++++++++++++++++++++ tools/testing/selftests/ir/ir_loopback.sh | 20 +++ 5 files changed, 226 insertions(+) create mode 100644 tools/testing/selftests/ir/.gitignore create mode 100644 tools/testing/selftests/ir/Makefile create mode 100644 tools/testing/selftests/ir/ir_loopback.c create mode 100755 tools/testing/selftests/ir/ir_loopback.sh
tools/testing/selftests/Makefile +1 -0
@@ -15,6 +15,7 @@ TARGETS += futex TARGETS += gpio TARGETS += intel_pstate TARGETS += ipc +TARGETS += ir TARGETS += kcmp TARGETS += kvm TARGETS += lib
tools/testing/selftests/ir/.gitignore new file +1 -0
@@ -0,0 +1 @@ +ir_loopback
tools/testing/selftests/ir/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 +TEST_PROGS := ir_loopback.sh +TEST_GEN_PROGS_EXTENDED := ir_loopback + +include ../lib.mk
tools/testing/selftests/ir/ir_loopback.c new file +199 -0
199 lines not on this page · raw message
tools/testing/selftests/ir/ir_loopback.sh new file +20 -0
@@ -0,0 +1,20 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + +if ! /sbin/modprobe -q -n rc-loopback; then + echo "ir_loopback: module rc-loopback is not found [SKIP]" + exit $ksft_skip +fi + +/sbin/modprobe rc-loopback +if [ $? -ne 0 ]; then + exit +fi + +RCDEV=$(grep -l DRV_NAME=rc-loopback /sys/class/rc/rc*/uevent | grep -o 'rc[0-9]\+') + +./ir_loopback $RCDEV $RCDEV +exit
Signature · 1 line
2.17.2
shuah at kernel.org (Shuah Khan)
PATCH 1/1 media: rc: self test for IR encoders and decoders
Quoted 9 lines · Sean Young
ir-loopback can transmit IR on one rc device and check the correct scancode and protocol is decoded on a different rc device. This can be used to check IR transmission between two rc devices. Using rc-loopback, we use it to check the IR encoders and decoders themselves.
No hardware is required for this test.
Signed-off-by Sean Young <sean at mess.org>Cc Shuah Khan <shuah at kernel.org>
Hi Sean,
This looks good. I will get this into the next release. It will show up in linux-kselftest next after 4.20-rc1 comes out.
thanks,
-- Shuah
sean at mess.org (Sean Young)
PATCH 1/1 media: rc: self test for IR encoders and decoders
Hi Shuah,
Quoted 8 lines · Shuah Khan
Quoted 7 lines · Sean Young
ir-loopback can transmit IR on one rc device and check the correct scancode and protocol is decoded on a different rc device. This can be used to check IR transmission between two rc devices. Using rc-loopback, we use it to check the IR encoders and decoders themselves.
No hardware is required for this test.
Quoted 7 lines
Quoted 2 lines
Signed-off-by Sean Young <sean at mess.org>Cc Shuah Khan <shuah at kernel.org>Hi Sean,
This looks good. I will get this into the next release. It will show up in linux-kselftest next after 4.20-rc1 comes out.
Great, thank you very much.
Regards,
Sean