beaglebone-capes: add a powerdown script as well
PATCH 1/1 beaglebone-capes: add a powerdown script as well
The current powerdown script disables the PMIC backlight
Signed-off-by Koen Kooi <[email protected]>
--- recipes-ti/beagleboard/beaglebone-capes.bb | 5 ++++- recipes-ti/beagleboard/beaglebone-capes/cape-stop.sh | 11 +++++++++++ recipes-ti/beagleboard/beaglebone-capes/cape.service | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 recipes-ti/beagleboard/beaglebone-capes/cape-stop.sh
recipes-ti/beagleboard/beaglebone-capes.bb +4 -1
@@ -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"
recipes-ti/beagleboard/beaglebone-capes/cape-stop.sh new file +11 -0
@@ -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
recipes-ti/beagleboard/beaglebone-capes/cape.service +3 -0
@@ -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
Signature · 1 line
1.7.10