summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-ti/beagleboard/beaglebone-capes.bb5
-rwxr-xr-xrecipes-ti/beagleboard/beaglebone-capes/cape-stop.sh11
-rw-r--r--recipes-ti/beagleboard/beaglebone-capes/cape.service3
3 files changed, 18 insertions, 1 deletions
diff --git a/recipes-ti/beagleboard/beaglebone-capes.bb b/recipes-ti/beagleboard/beaglebone-capes.bb
index 88d4a173..f1289247 100644
--- a/recipes-ti/beagleboard/beaglebone-capes.bb
+++ b/recipes-ti/beagleboard/beaglebone-capes.bb
@@ -3,10 +3,13 @@ DESCRIPTION = "Userspace setup for beaglebone capes"
3LICENSE = "MIT" 3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" 4LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
5 5
6PR = "r1"
7
6inherit allarch 8inherit allarch
7 9
8SRC_URI = "file://cape.service \ 10SRC_URI = "file://cape.service \
9 file://cape.sh \ 11 file://cape.sh \
12 file://cape-stop.sh \
10 " 13 "
11 14
12do_install() { 15do_install() {
@@ -17,7 +20,7 @@ do_install() {
17 ln -sf ../cape.service ${D}${base_libdir}/systemd/system/basic.target.wants/ 20 ln -sf ../cape.service ${D}${base_libdir}/systemd/system/basic.target.wants/
18 21
19 install -d ${D}${bindir} 22 install -d ${D}${bindir}
20 install -m 0755 ${WORKDIR}/cape.sh ${D}${bindir} 23 install -m 0755 ${WORKDIR}/cape*.sh ${D}${bindir}
21} 24}
22 25
23FILES_${PN} += "${base_libdir}/systemd/system" 26FILES_${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
index 00000000..a08498d7
--- /dev/null
+++ b/recipes-ti/beagleboard/beaglebone-capes/cape-stop.sh
@@ -0,0 +1,11 @@
1#!/bin/sh
2for eeprom in /sys/bus/i2c/devices/3-005*/eeprom ; do
3 PARTNUMBER=$(hexdump -e '8/1 "%c"' $eeprom -s 58 -n16)
4 case $PARTNUMBER in
5 "BB-BONE-LCD3-01.")
6 echo "Turning off backlight for LCD3 cape"
7 i2cset -f -y 1 0x24 0x07 0x00;;
8 *)
9 echo "unknown cape: $PARTNUMBER";;
10 esac
11done
diff --git a/recipes-ti/beagleboard/beaglebone-capes/cape.service b/recipes-ti/beagleboard/beaglebone-capes/cape.service
index 44a2a38b..ce0db719 100644
--- a/recipes-ti/beagleboard/beaglebone-capes/cape.service
+++ b/recipes-ti/beagleboard/beaglebone-capes/cape.service
@@ -2,7 +2,10 @@
2Description=Beaglebone cape support 2Description=Beaglebone cape support
3 3
4[Service] 4[Service]
5Type=oneshot
6RemainAfterExit=yes
5ExecStart=/usr/bin/cape.sh 7ExecStart=/usr/bin/cape.sh
8ExecStop=/usr/bin/cape-stop.sh
6 9
7[Install] 10[Install]
8WantedBy=basic.target 11WantedBy=basic.target