beaglebone-capes: add a powerdown script as well
authorKoen Kooi <koen@dominion.thruhere.net>
Fri, 18 May 2012 14:11:39 +0000 (16:11 +0200)
committerDenys Dmytriyenko <denys@ti.com>
Mon, 21 May 2012 20:53:36 +0000 (16:53 -0400)
The current powerdown script disables the PMIC backlight

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
recipes-ti/beagleboard/beaglebone-capes.bb
recipes-ti/beagleboard/beaglebone-capes/cape-stop.sh [new file with mode: 0755]
recipes-ti/beagleboard/beaglebone-capes/cape.service

index 88d4a1739db087f3e8c5caa1d6f55a43c00998c8..f12892476a6fecb87f46b9b50ea682c276af3d65 100644 (file)
@@ -3,10 +3,13 @@ DESCRIPTION = "Userspace setup for beaglebone capes"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
 
+PR = "r1"
+
 inherit allarch
 
 SRC_URI = "file://cape.service \
            file://cape.sh \
+           file://cape-stop.sh \
           "
 
 do_install() {
@@ -17,7 +20,7 @@ do_install() {
        ln -sf ../cape.service ${D}${base_libdir}/systemd/system/basic.target.wants/
 
        install -d ${D}${bindir}
-       install -m 0755 ${WORKDIR}/cape.sh ${D}${bindir}
+       install -m 0755 ${WORKDIR}/cape*.sh ${D}${bindir}
 }
 
 FILES_${PN} += "${base_libdir}/systemd/system"
diff --git a/recipes-ti/beagleboard/beaglebone-capes/cape-stop.sh b/recipes-ti/beagleboard/beaglebone-capes/cape-stop.sh
new file mode 100755 (executable)
index 0000000..a08498d
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+for eeprom in /sys/bus/i2c/devices/3-005*/eeprom ; do
+       PARTNUMBER=$(hexdump -e '8/1 "%c"' $eeprom -s 58 -n16)
+       case $PARTNUMBER in
+               "BB-BONE-LCD3-01.")
+                               echo "Turning off backlight for LCD3 cape"
+                               i2cset -f -y 1 0x24 0x07 0x00;;
+               *)
+                               echo "unknown cape: $PARTNUMBER";;
+       esac
+done
index 44a2a38bac7d8e08ada0d0d43394d3b9371198e8..ce0db719ecc422cc5c08ed40cee4fbf0e0ad78cf 100644 (file)
@@ -2,7 +2,10 @@
 Description=Beaglebone cape support
 
 [Service]
+Type=oneshot
+RemainAfterExit=yes
 ExecStart=/usr/bin/cape.sh
+ExecStop=/usr/bin/cape-stop.sh
 
 [Install]
 WantedBy=basic.target