aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh')
-rw-r--r--recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh
new file mode 100644
index 0000000..0886980
--- /dev/null
+++ b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh
@@ -0,0 +1,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