1 DESCRIPTION = "Alsa Drivers"
2 MAINTAINER = "Rene Wagner <rw@handhelds.org>"
9 DEPENDS += "fakeroot-native virtual/kernel"
11 PARALLEL_INSTALL_REPLACE_VERSIONS = "2.4.19-rmk6-pxa1-hh37 2.4.19-rmk6-pxa1-hh41.1"
13 SRC_URI = "ftp://ftp.handhelds.org/packages/alsa-driver/alsa-driver-${PV}.tar.gz \
14 file://sound.p.patch;patch=1 \
15 file://h5400.patch;patch=1 \
16 file://sa11xx.patch;patch=1 \
17 file://adriver.h.patch;patch=1"
19 inherit autotools module update-rc.d
21 RPROVIDES_${PN} += "${@linux_module_packages('h3600-uda1341 uda1341', d)}"
22 RCONFLICTS_${PN} += "${@linux_module_packages('h3600-uda1341 uda1341', d)}"
23 RREPLACES_${PN} += "${@linux_module_packages('h3600-uda1341 uda1341', d)}"
25 # the same for old style naming...
26 RPROVIDES_${PN} += "kernel-module-h3600-uda1341-2.4.19-rmk6-pxa1-hh37 kernel-module-uda1341-2.4.19-rmk6-pxa1-hh37"
27 RCONFLICTS_${PN} += "kernel-module-h3600-uda1341-2.4.19-rmk6-pxa1-hh37 kernel-module-uda1341-2.4.19-rmk6-pxa1-hh37"
28 RREPLACES_${PN} += "kernel-module-h3600-uda1341-2.4.19-rmk6-pxa1-hh37 kernel-module-uda1341-2.4.19-rmk6-pxa1-hh37"
30 INITSCRIPT_NAME = "alsa-driver"
31 INITSCRIPT_PARAMS = "start 29 S . stop 29 0 6 1 ."
33 # avoid miscompilation
34 KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_ARCH}"
36 EXTRA_OECONF = "--with-sequencer=yes \
39 --with-kernel=${STAGING_KERNEL_DIR} \
40 --with-kernel-version=${KERNEL_VERSION}"
42 PACKAGES =+ "${PN}-midi ${PN}-misc"
43 FILES_${PN} = "/lib/modules/*/misc/snd* \
44 ${sysconfdir}/init.d/${INITSCRIPT_NAME}"
45 # ${sysconfdir}/modutils/*"
46 midi_modules = "snd-seq-midi-emul.o \
47 snd-seq-midi-event.o \
51 FILES_${PN}-midi = "${@' '.join(map ((lambda x: '/lib/modules/*/misc/%s' % x), bb.data.getVar('midi_modules', d).split()))}"
52 misc_modules = "snd-gus-synth.o \
59 FILES_${PN}-misc = "${@' '.join(map ((lambda x: '/lib/modules/*/misc/%s' % x), bb.data.getVar('misc_modules', d).split()))}"
61 # put in-kernel headers first in the include search path.
62 # without this all configure checks fail
63 CFLAGS =+ "-I${STAGING_KERNEL_DIR}/include"
68 if egrep "CONFIG_SA1100_H3[168]00=y" "${STAGING_KERNEL_DIR}/.config" ; then
69 cards="$cards,sa11xx-uda1341"
72 if grep "CONFIG_ARCH_H3900=y" "${STAGING_KERNEL_DIR}/.config" ; then
73 cards="$cards,pxa-uda1380,h5400-ak4535"
76 cards="$cards,bluez-sco,pdaudiocf"
78 oe_runconf --with-cards=${cards}
81 autoload_ipaqsa = "snd-sa11xx-uda1341 snd-pcm-oss snd-mixer-oss"
82 autoload_ipaqpxa = "snd-h5400-ak4535 snd-pxa-uda1380 snd-pcm-oss snd-mixer-oss"
86 if egrep "CONFIG_SA1100_H3[168]00=y" "${STAGING_KERNEL_DIR}/.config" ; then
87 autoload="${autoload_ipaqsa}"
89 if grep "CONFIG_ARCH_H3900=y" "${STAGING_KERNEL_DIR}/.config" ; then
90 autoload="${autoload_ipaqpxa}"
93 fakeroot make -k NODEPMOD=yes DESTDIR=${D} install;
95 mkdir -p ${D}${sysconfdir}/init.d
96 cat > ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME} <<EOF
99 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
101 autoload_modules="$autoload"
105 echo -n "Loading alsa modules:"
106 for i in \$autoload_modules; do
107 modprobe \$i && echo -n " \$i"
112 echo -n "Unloading alsa modules:"
113 for i in \$autoload_modules; do
114 modprobe -r \$i && echo -n " \$i"
118 restart|force-reload)
119 echo -n "Unloading alsa modules:"
120 for i in \$autoload_modules; do
121 modprobe -r \$i && echo -n " \$i"
124 echo -n "Loading alsa modules:"
125 for i in \$autoload_modules; do
126 modprobe \$i && echo -n " \$i"
131 echo "Usage: \$0 {start|stop|restart|force-reload}" >&2
138 chmod 755 ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}