[oe-commits] Ulf Samuelsson : Make atmel specific alsa configuration
git version control
git at git.openembedded.org
Wed Aug 19 10:21:11 UTC 2009
Module: openembedded.git
Branch: ulf/linux-2.6.30.2
Commit: d7ae94b22136354c50d84e6caebcb7a080f9fb18
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=d7ae94b22136354c50d84e6caebcb7a080f9fb18
Author: Ulf Samuelsson <ulf.samuelsson at atmel.com>
Date: Tue Aug 18 11:32:07 2009 +0200
Make atmel specific alsa configuration
---
recipes/alsa/alsa-state-atmel/alsa-state | 29 +++
recipes/alsa/alsa-state-atmel/asound.conf | 2 +
recipes/alsa/alsa-state-atmel/asound.state | 283 ++++++++++++++++++++++++++++
recipes/alsa/alsa-state.bb | 41 +----
4 files changed, 315 insertions(+), 40 deletions(-)
diff --git a/recipes/alsa/alsa-state-atmel/alsa-state b/recipes/alsa/alsa-state-atmel/alsa-state
new file mode 100755
index 0000000..84cdf03
--- /dev/null
+++ b/recipes/alsa/alsa-state-atmel/alsa-state
@@ -0,0 +1,29 @@
+#! /bin/sh
+#
+# Copyright Matthias Hentges <devel at hentges.net> (c) 2007
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
+#
+# Filename: alsa-state
+# Date: 20070308 (YMD)
+
+
+asound_restore(){
+ echo "ALSA: Restoring mixer settings..."
+ if test -x /usr/sbin/alsactl -a -e /etc/asound.state
+ then
+ /usr/sbin/alsactl -f /etc/asound.state restore &
+ fi
+}
+
+asound_store(){
+ echo "ALSA: Storing mixer settings..."
+ if test -x /usr/sbin/alsactl
+ then
+ /usr/sbin/alsactl -f /etc/asound.state store
+ fi
+}
+
+case "$1" in
+start) asound_restore ;;
+stop) asound_store ;;
+esac
diff --git a/recipes/alsa/alsa-state-atmel/asound.conf b/recipes/alsa/alsa-state-atmel/asound.conf
new file mode 100644
index 0000000..87bb5ec
--- /dev/null
+++ b/recipes/alsa/alsa-state-atmel/asound.conf
@@ -0,0 +1,2 @@
+pcm.!default { type hw card 0 }
+ctl.!default { type hw card 0 }
diff --git a/recipes/alsa/alsa-state-atmel/asound.state b/recipes/alsa/alsa-state-atmel/asound.state
new file mode 100644
index 0000000..ee646a1
--- /dev/null
+++ b/recipes/alsa/alsa-state-atmel/asound.state
@@ -0,0 +1,283 @@
+state.AC97 {
+ control.1 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 2
+ iface MIXER
+ name 'Master Playback Switch'
+ value.0 true
+ value.1 true
+ }
+ control.2 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 2
+ comment.range '0 - 31'
+ comment.dbmin -4650
+ comment.dbmax 0
+ iface MIXER
+ name 'Master Playback Volume'
+ value.0 22
+ value.1 22
+ }
+ control.3 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 2
+ iface MIXER
+ name 'Headphone Playback Switch'
+ value.0 true
+ value.1 true
+ }
+ control.4 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 2
+ comment.range '0 - 31'
+ comment.dbmin -4650
+ comment.dbmax 0
+ iface MIXER
+ name 'Headphone Playback Volume'
+ value.0 22
+ value.1 22
+ }
+ control.5 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 1
+ iface MIXER
+ name 'Master Mono Playback Switch'
+ value false
+ }
+ control.6 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 1
+ comment.range '0 - 31'
+ comment.dbmin -4650
+ comment.dbmax 0
+ iface MIXER
+ name 'Master Mono Playback Volume'
+ value 0
+ }
+ control.7 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 1
+ iface MIXER
+ name 'Phone Playback Switch'
+ value false
+ }
+ control.8 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 1
+ comment.range '0 - 31'
+ comment.dbmin -3450
+ comment.dbmax 1200
+ iface MIXER
+ name 'Phone Playback Volume'
+ value 0
+ }
+ control.9 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 1
+ iface MIXER
+ name 'Mic Playback Switch'
+ value false
+ }
+ control.10 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 1
+ comment.range '0 - 31'
+ comment.dbmin -3450
+ comment.dbmax 1200
+ iface MIXER
+ name 'Mic Playback Volume'
+ value 0
+ }
+ control.11 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 1
+ iface MIXER
+ name 'Mic Boost (+20dB)'
+ value false
+ }
+ control.12 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 2
+ iface MIXER
+ name 'Line Playback Switch'
+ value.0 false
+ value.1 false
+ }
+ control.13 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 2
+ comment.range '0 - 31'
+ comment.dbmin -3450
+ comment.dbmax 1200
+ iface MIXER
+ name 'Line Playback Volume'
+ value.0 0
+ value.1 0
+ }
+ control.14 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 2
+ iface MIXER
+ name 'CD Playback Switch'
+ value.0 false
+ value.1 false
+ }
+ control.15 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 2
+ comment.range '0 - 31'
+ comment.dbmin -3450
+ comment.dbmax 1200
+ iface MIXER
+ name 'CD Playback Volume'
+ value.0 0
+ value.1 0
+ }
+ control.16 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 2
+ iface MIXER
+ name 'Aux Playback Switch'
+ value.0 false
+ value.1 false
+ }
+ control.17 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 2
+ comment.range '0 - 31'
+ comment.dbmin -3450
+ comment.dbmax 1200
+ iface MIXER
+ name 'Aux Playback Volume'
+ value.0 0
+ value.1 0
+ }
+ control.18 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 2
+ iface MIXER
+ name 'PCM Playback Switch'
+ value.0 true
+ value.1 true
+ }
+ control.19 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 2
+ comment.range '0 - 31'
+ comment.dbmin -3450
+ comment.dbmax 1200
+ iface MIXER
+ name 'PCM Playback Volume'
+ value.0 22
+ value.1 22
+ }
+ control.20 {
+ comment.access 'read write'
+ comment.type ENUMERATED
+ comment.count 2
+ comment.item.0 Mic
+ comment.item.1 CD
+ comment.item.2 Video
+ comment.item.3 Aux
+ comment.item.4 Line
+ comment.item.5 Mix
+ comment.item.6 'Mix Mono'
+ comment.item.7 Phone
+ iface MIXER
+ name 'Capture Source'
+ value.0 Mic
+ value.1 Mic
+ }
+ control.21 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 2
+ iface MIXER
+ name 'Capture Switch'
+ value.0 true
+ value.1 true
+ }
+ control.22 {
+ comment.access 'read write'
+ comment.type INTEGER
+ comment.count 2
+ comment.range '0 - 15'
+ comment.dbmin 0
+ comment.dbmax 2250
+ iface MIXER
+ name 'Capture Volume'
+ value.0 11
+ value.1 11
+ }
+ control.23 {
+ comment.access 'read write'
+ comment.type ENUMERATED
+ comment.count 1
+ comment.item.0 Mix
+ comment.item.1 Mic
+ iface MIXER
+ name 'Mono Output Select'
+ value Mix
+ }
+ control.24 {
+ comment.access 'read write'
+ comment.type ENUMERATED
+ comment.count 1
+ comment.item.0 Mic1
+ comment.item.1 Mic2
+ iface MIXER
+ name 'Mic Select'
+ value Mic1
+ }
+ control.25 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 1
+ iface MIXER
+ name 'Stereo Mic'
+ value false
+ }
+ control.26 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 1
+ iface MIXER
+ name 'Headphone Jack Sense'
+ value false
+ }
+ control.27 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 1
+ iface MIXER
+ name 'Line Jack Sense'
+ value false
+ }
+ control.28 {
+ comment.access 'read write'
+ comment.type BOOLEAN
+ comment.count 1
+ iface MIXER
+ name 'External Amplifier'
+ value true
+ }
+}
diff --git a/recipes/alsa/alsa-state.bb b/recipes/alsa/alsa-state.bb
index 0963cc4..3c5c63f 100644
--- a/recipes/alsa/alsa-state.bb
+++ b/recipes/alsa/alsa-state.bb
@@ -19,43 +19,4 @@ SRC_URI_append_a780 = "file://gsmhandset.state \
file://gsmheadset.state \
file://stereoout.state"
-inherit update-rc.d
-
-INITSCRIPT_NAME = "alsa-state"
-INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
-
-do_install() {
- install -d ${D}${sysconfdir}/init.d
- install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d
-
- install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
- install -m 0644 ${WORKDIR}/*.state ${D}${sysconfdir}
-}
-
-PACKAGES += "alsa-states"
-
-RRECOMMENDS_alsa-state = "alsa-states"
-RRECOMMENDS_${PN}_om-gta01 = "openmoko-alsa-scenarios"
-RRECOMMENDS_${PN}_om-gta02 = "openmoko-alsa-scenarios"
-
-FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
-CONFFILES_${PN} = "${sysconfdir}/asound.conf"
-
-FILES_alsa-states = "${sysconfdir}/*.state"
-
-PACKAGE_ARCH = "all"
-PACKAGE_ARCH_alsa-states = "${MACHINE_ARCH}"
-
-pkg_postinst_${PN}() {
- if test -z "$D"
- then
- if test -x /usr/sbin/alsactl
- then
- /usr/sbin/alsactl -f ${sysconfdir}/asound.state restore
- fi
- # INITSCRIPT_PARAMS changed, so remove the old and
- # install the new setting.
- update-rc.d -f ${INITSCRIPT_NAME} remove
- update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
- fi
-}
+require alsa-state.inc
More information about the Openembedded-commits
mailing list