1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4# Kselftest framework requirement - SKIP code is 4.
5ksft_skip=4
6
7if ! /sbin/modprobe -q -n rc-loopback; then
8        echo "ir_loopback: module rc-loopback is not found [SKIP]"
9        exit $ksft_skip
10fi
11
12/sbin/modprobe rc-loopback
13if [ $? -ne 0 ]; then
14	exit
15fi
16
17RCDEV=$(grep -l DRV_NAME=rc-loopback /sys/class/rc/rc*/uevent | grep -o 'rc[0-9]\+')
18
19./ir_loopback $RCDEV $RCDEV
20exit
21