#!/bin/sh

#debug
#HOTPLUG_LOG=/tmp/hotplug.log
#echo "!! stbhotplug:" "$@" >> $HOTPLUG_LOG
#echo "~~~~~~~~~~~~~~~~~~~~~~~~" >> $HOTPLUG_LOG

HOTPLUG_FW_DIR=/usr/lib/firmware

# userspace firmware loader
if [ "$1" = "firmware" ]; then
    if [ "$ACTION" = "add" ]; then
        echo 1 > /sys/$DEVPATH/loading
        cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
        echo 0 > /sys/$DEVPATH/loading
    fi
fi


