diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2012-05-18 16:11:39 +0200 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2012-05-21 16:53:36 -0400 |
commit | 185d6216110354cca80f27b76d78a46336dadfc1 (patch) | |
tree | 005fc668cc1c6293e0971408647f32dc89889823 /recipes-ti | |
parent | a9eca3f6f9258cba5f30b9e9bbb0e31bc5da0d77 (diff) | |
download | meta-ti-185d6216110354cca80f27b76d78a46336dadfc1.tar.gz |
beaglebone-capes: add a powerdown script as well
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>
Diffstat (limited to 'recipes-ti')
-rw-r--r-- | recipes-ti/beagleboard/beaglebone-capes.bb | 5 | ||||
-rwxr-xr-x | recipes-ti/beagleboard/beaglebone-capes/cape-stop.sh | 11 | ||||
-rw-r--r-- | recipes-ti/beagleboard/beaglebone-capes/cape.service | 3 |
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" | |||
3 | LICENSE = "MIT" | 3 | LICENSE = "MIT" |
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" | 4 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" |
5 | 5 | ||
6 | PR = "r1" | ||
7 | |||
6 | inherit allarch | 8 | inherit allarch |
7 | 9 | ||
8 | SRC_URI = "file://cape.service \ | 10 | SRC_URI = "file://cape.service \ |
9 | file://cape.sh \ | 11 | file://cape.sh \ |
12 | file://cape-stop.sh \ | ||
10 | " | 13 | " |
11 | 14 | ||
12 | do_install() { | 15 | do_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 | ||
23 | FILES_${PN} += "${base_libdir}/systemd/system" | 26 | 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 index 00000000..a08498d7 --- /dev/null +++ b/recipes-ti/beagleboard/beaglebone-capes/cape-stop.sh | |||
@@ -0,0 +1,11 @@ | |||
1 | #!/bin/sh | ||
2 | for 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 | ||
11 | done | ||
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 @@ | |||
2 | Description=Beaglebone cape support | 2 | Description=Beaglebone cape support |
3 | 3 | ||
4 | [Service] | 4 | [Service] |
5 | Type=oneshot | ||
6 | RemainAfterExit=yes | ||
5 | ExecStart=/usr/bin/cape.sh | 7 | ExecStart=/usr/bin/cape.sh |
8 | ExecStop=/usr/bin/cape-stop.sh | ||
6 | 9 | ||
7 | [Install] | 10 | [Install] |
8 | WantedBy=basic.target | 11 | WantedBy=basic.target |