diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2012-04-17 14:47:42 +0200 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2012-04-18 12:19:55 -0400 |
commit | f026aa7bd09a75034b28a0aa7e750059fd2c2813 (patch) | |
tree | 9a12a1b42249fba2368f19ad298a829bd7b8b6b3 /recipes-ti/beagleboard | |
parent | 41053c22a786de9026b85b125554eea55d381a39 (diff) | |
download | meta-ti-f026aa7bd09a75034b28a0aa7e750059fd2c2813.tar.gz |
beaglebone-capes: userspace support for capes
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>
Diffstat (limited to 'recipes-ti/beagleboard')
-rw-r--r-- | recipes-ti/beagleboard/beaglebone-capes.bb | 23 | ||||
-rw-r--r-- | recipes-ti/beagleboard/beaglebone-capes/cape.service | 8 | ||||
-rwxr-xr-x | recipes-ti/beagleboard/beaglebone-capes/cape.sh | 12 |
3 files changed, 43 insertions, 0 deletions
diff --git a/recipes-ti/beagleboard/beaglebone-capes.bb b/recipes-ti/beagleboard/beaglebone-capes.bb new file mode 100644 index 00000000..88d4a173 --- /dev/null +++ b/recipes-ti/beagleboard/beaglebone-capes.bb | |||
@@ -0,0 +1,23 @@ | |||
1 | DESCRIPTION = "Userspace setup for beaglebone capes" | ||
2 | |||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" | ||
5 | |||
6 | inherit allarch | ||
7 | |||
8 | SRC_URI = "file://cape.service \ | ||
9 | file://cape.sh \ | ||
10 | " | ||
11 | |||
12 | do_install() { | ||
13 | install -d ${D}${base_libdir}/systemd/system/ | ||
14 | install -m 0644 ${WORKDIR}/cape.service ${D}${base_libdir}/systemd/system | ||
15 | |||
16 | install -d ${D}${base_libdir}/systemd/system/basic.target.wants | ||
17 | ln -sf ../cape.service ${D}${base_libdir}/systemd/system/basic.target.wants/ | ||
18 | |||
19 | install -d ${D}${bindir} | ||
20 | install -m 0755 ${WORKDIR}/cape.sh ${D}${bindir} | ||
21 | } | ||
22 | |||
23 | FILES_${PN} += "${base_libdir}/systemd/system" | ||
diff --git a/recipes-ti/beagleboard/beaglebone-capes/cape.service b/recipes-ti/beagleboard/beaglebone-capes/cape.service new file mode 100644 index 00000000..44a2a38b --- /dev/null +++ b/recipes-ti/beagleboard/beaglebone-capes/cape.service | |||
@@ -0,0 +1,8 @@ | |||
1 | [Unit] | ||
2 | Description=Beaglebone cape support | ||
3 | |||
4 | [Service] | ||
5 | ExecStart=/usr/bin/cape.sh | ||
6 | |||
7 | [Install] | ||
8 | WantedBy=basic.target | ||
diff --git a/recipes-ti/beagleboard/beaglebone-capes/cape.sh b/recipes-ti/beagleboard/beaglebone-capes/cape.sh new file mode 100755 index 00000000..69accfff --- /dev/null +++ b/recipes-ti/beagleboard/beaglebone-capes/cape.sh | |||
@@ -0,0 +1,12 @@ | |||
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 on backlight for LCD3 cape" | ||
7 | i2cset -f -y 1 0x24 0x07 0x09 | ||
8 | i2cset -f -y 1 0x24 0x08 0x60;; | ||
9 | *) | ||
10 | echo "unknown cape: $PARTNUMBER";; | ||
11 | esac | ||
12 | done | ||