summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 41053c2)
raw | patch | inline | side by side (parent: 41053c2)
author | Koen Kooi <koen@dominion.thruhere.net> | |
Tue, 17 Apr 2012 12:47:42 +0000 (14:47 +0200) | ||
committer | Denys Dmytriyenko <denys@ti.com> | |
Wed, 18 Apr 2012 16:19:55 +0000 (12:19 -0400) |
Not everything can be done inside the kernel yet, so have a script that does the userspace portion.
Only the LCD3 cape is supported currently, more will follow later.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Only the LCD3 cape is supported currently, more will follow later.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
recipes-ti/beagleboard/beaglebone-capes.bb | [new file with mode: 0644] | patch | blob |
recipes-ti/beagleboard/beaglebone-capes/cape.service | [new file with mode: 0644] | patch | blob |
recipes-ti/beagleboard/beaglebone-capes/cape.sh | [new file with mode: 0755] | patch | blob |
diff --git a/recipes-ti/beagleboard/beaglebone-capes.bb b/recipes-ti/beagleboard/beaglebone-capes.bb
--- /dev/null
@@ -0,0 +1,23 @@
+DESCRIPTION = "Userspace setup for beaglebone capes"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+
+inherit allarch
+
+SRC_URI = "file://cape.service \
+ file://cape.sh \
+ "
+
+do_install() {
+ install -d ${D}${base_libdir}/systemd/system/
+ install -m 0644 ${WORKDIR}/cape.service ${D}${base_libdir}/systemd/system
+
+ install -d ${D}${base_libdir}/systemd/system/basic.target.wants
+ ln -sf ../cape.service ${D}${base_libdir}/systemd/system/basic.target.wants/
+
+ install -d ${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.service b/recipes-ti/beagleboard/beaglebone-capes/cape.service
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Beaglebone cape support
+
+[Service]
+ExecStart=/usr/bin/cape.sh
+
+[Install]
+WantedBy=basic.target
diff --git a/recipes-ti/beagleboard/beaglebone-capes/cape.sh b/recipes-ti/beagleboard/beaglebone-capes/cape.sh
--- /dev/null
@@ -0,0 +1,12 @@
+#!/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 on backlight for LCD3 cape"
+ i2cset -f -y 1 0x24 0x07 0x09
+ i2cset -f -y 1 0x24 0x08 0x60;;
+ *)
+ echo "unknown cape: $PARTNUMBER";;
+ esac
+done