aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh
blob: 0886980e52b2ebb8cf1c147dffded7bb3e469f3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -e

if [ ! -r /lib/firmware/lt9611uxc_fw.bin ] ; then
	echo "LT9611UXC firmware not found"
	exit 1
fi

if [ ! -d /sys/bus/i2c/drivers/lt9611uxc ] ; then
	modprobe lontium-lt9611uxc
	sleep 1
fi

for f in /sys/bus/i2c/drivers/lt9611uxc/* ; do
	[ -L $f ] || continue
	version=`cat $f/lt9611uxc_firmware`
	if [ "$version" -lt "43" ] ; then
		echo > $f/lt9611uxc_firmware
	fi
done