#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
# Select the HAT after probe completes; preserve the driver's quality = 1.
set -eu
case "${1-}" in
    *-0040) ;;
    *) exit 1 ;;
esac
test -d "/sys/bus/i2c/devices/$1/of_node"
test "$(tr -d '\000' < /proc/device-tree/hat/product)" = 'R90-HAT RNG90 random source and RTC'
printf 'rng90-%s\n' "$1" > /sys/class/misc/hw_random/rng_current
