summaryrefslogtreecommitdiffstats
path: root/meta-yocto/recipes-bsp
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-06-17 14:42:32 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-22 17:02:55 +0100
commit489fe5d4406410e7eae35ca7ee7be911fac938ec (patch)
tree86e11cc1bc9ecd69f6e28c9204d21ec049a39c8a /meta-yocto/recipes-bsp
parent0363835985a264458fb9432aab1f6345bb2bd424 (diff)
downloadast2050-yocto-poky-489fe5d4406410e7eae35ca7ee7be911fac938ec.zip
ast2050-yocto-poky-489fe5d4406410e7eae35ca7ee7be911fac938ec.tar.gz
beagleboard: add basic audio mixer defaults
We need a generic alsa based mechanism that we can use a bbappend to save default mixer controls per bsp. Until that is ready, this ensures the Audio Out on the Beagleboard is enabled out of the box. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'meta-yocto/recipes-bsp')
-rw-r--r--meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb30
-rw-r--r--meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio44
2 files changed, 74 insertions, 0 deletions
diff --git a/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb
new file mode 100644
index 0000000..b0c2cd7
--- /dev/null
+++ b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Provide a basic init script to enable audio"
+DESCRIPTION = "Set the volume and unmute the Front mixer setting during boot."
+SECTION = "base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+
+PR = "r4"
+
+inherit update-rc.d
+
+RDEPENDS = "alsa-utils-amixer"
+
+SRC_URI = "file://beagleboard-audio"
+
+INITSCRIPT_NAME = "beagleboard-audio"
+INITSCRIPT_PARAMS = "defaults 90"
+
+do_install() {
+ install -d ${D}${sysconfdir} \
+ ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/beagleboard-audio ${D}${sysconfdir}/init.d
+ cat ${WORKDIR}/${INITSCRIPT_NAME} | \
+ sed -e 's,/etc,${sysconfdir},g' \
+ -e 's,/usr/sbin,${sbindir},g' \
+ -e 's,/var,${localstatedir},g' \
+ -e 's,/usr/bin,${bindir},g' \
+ -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+ chmod 755 ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+}
+
diff --git a/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio
new file mode 100644
index 0000000..ed2bd50
--- /dev/null
+++ b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio
@@ -0,0 +1,44 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: beagleboard mixer setup
+# Required-Start: $syslog
+# Required-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Initialize the beagleboard audio mixer
+# Description: Unmute FRONT and set volume to ~70%.
+### END INIT INFO
+
+# Author: Darren Hart <dvhart@linux.intel.com>
+# Based on /etc/init.d/skeleton
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Audio mixer settings"
+NAME=beagleboard-audio
+AMIXER=`which amixer`
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if amixer is not installed
+[ -x "$AMIXER" ] || exit 0
+
+do_start() {
+ # Enable the Headset (Audio Out)
+ $AMIXER sset "Headset" 2 > /dev/null
+ $AMIXER sset "HeadsetL Mixer AudioL1" on > /dev/null
+ $AMIXER sset "HeadsetR Mixer AudioR1" on > /dev/null
+}
+
+case "$1" in
+start)
+ echo "$NAME: setting default mixer settings."
+ do_start
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: $SCRIPTNAME {start|stop}" >&2
+ exit 3
+ ;;
+esac
+
+exit 0
OpenPOWER on IntegriCloud