aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2021-02-09 16:15:34 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2021-02-11 19:30:58 +0300
commit0d5c133a0a92a420ceb9b91e856c6cdecc53a663 (patch)
treed52c284161e1f34030d8544be22d86931f86bdad
parent2d776710ea99ed0206e7d8d08ccd8278aeac6a74 (diff)
downloadmeta-qcom-0d5c133a0a92a420ceb9b91e856c6cdecc53a663.tar.gz
meta-qcom-0d5c133a0a92a420ceb9b91e856c6cdecc53a663.tar.bz2
meta-qcom-0d5c133a0a92a420ceb9b91e856c6cdecc53a663.zip
lt9611uxc-upgrade: provide a script to autoupgrae lt9611uxc firmware
There are several reports of lt9611uxc failing to display an image when used with older firmware (0x40). If detected during the bootup upgrade that firmware to the latest provided version. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> (cherry picked from commit 63503f74bb1153b6d7a2c57d9ff848261ffc6433)
-rw-r--r--recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb19
-rw-r--r--recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh21
-rw-r--r--recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service11
3 files changed, 51 insertions, 0 deletions
diff --git a/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb
new file mode 100644
index 0000000..e6ae271
--- /dev/null
+++ b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Upgrade Lontium LT9611UXC firmware to the latest image"
+
+SRC_URI = "file://lt9611uxc.service file://lt9611uxc-upgrade.sh"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit systemd
+
+RDEPENDS_${PN} += "linux-firmware-lt9611uxc"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/lt9611uxc-upgrade.sh ${D}${bindir}
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/lt9611uxc.service ${D}${systemd_system_unitdir}
+}
+
+SYSTEMD_SERVICE_${PN} = "lt9611uxc.service"
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
diff --git a/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service
new file mode 100644
index 0000000..c55e8ff
--- /dev/null
+++ b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Update LT9611UXC Firmware
+ConditionOnFirstBoot=true
+After=systemd-udev-settle.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/lt9611uxc-upgrade.sh
+
+[Install]
+WantedBy=getty.target