#!/bin/sh

# check if we have a WCNSS available on the platform
found=0
for f in $(ls /sys/kernel/debug/remoteproc/*/name 2> /dev/null); do
    name=$(cat "$f")
    if [ "${name%.wcnss}" != "$name" ] ; then
        f=$(dirname "$f")
        if [ -f "$f"/state ]; then
            echo "Found WCN at $f"
            found=1
            break
        fi
    fi
done

# no WCNSS, then move on..
[ $found -eq 0 ] && exit

modprobe wcn36xx
echo start > "$f"/state
