diff options
author | 2007-10-03 13:50:22 +0000 | |
---|---|---|
committer | 2007-10-03 13:50:22 +0000 | |
commit | 2adbe1dacd66d56a265da18c1452eea635af27a4 (patch) | |
tree | 1ff5ef71244bdeac5e17399fe78f085e9aa9d237 | |
parent | Forgot to commit mask change for bug-buddy (diff) | |
download | historical-2adbe1dacd66d56a265da18c1452eea635af27a4.tar.gz historical-2adbe1dacd66d56a265da18c1452eea635af27a4.tar.bz2 historical-2adbe1dacd66d56a265da18c1452eea635af27a4.zip |
Revision bump, containing a fix for #193796.
Package-Manager: portage-2.1.3.9
-rw-r--r-- | media-sound/alsa-driver/ChangeLog | 8 | ||||
-rw-r--r-- | media-sound/alsa-driver/Manifest | 27 | ||||
-rw-r--r-- | media-sound/alsa-driver/alsa-driver-1.0.14-r1.ebuild | 180 | ||||
-rw-r--r-- | media-sound/alsa-driver/files/alsa-driver-1.0.14-seq_file.patch | 316 | ||||
-rw-r--r-- | media-sound/alsa-driver/files/digest-alsa-driver-1.0.14-r1 | 3 |
5 files changed, 525 insertions, 9 deletions
diff --git a/media-sound/alsa-driver/ChangeLog b/media-sound/alsa-driver/ChangeLog index f38ed16de7c4..bf9cc9f278d5 100644 --- a/media-sound/alsa-driver/ChangeLog +++ b/media-sound/alsa-driver/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for media-sound/alsa-driver # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/ChangeLog,v 1.275 2007/09/17 17:32:37 phreak Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/ChangeLog,v 1.276 2007/10/03 13:50:21 phreak Exp $ + +*alsa-driver-1.0.14-r1 (03 Oct 2007) + + 03 Oct 2007; Christian Heim <phreak@gentoo.org> + +files/alsa-driver-1.0.14-seq_file.patch, +alsa-driver-1.0.14-r1.ebuild: + Revision bump, containing a fix for #193796. *alsa-driver-1.0.15_rc2 (17 Sep 2007) diff --git a/media-sound/alsa-driver/Manifest b/media-sound/alsa-driver/Manifest index 8f651d363c08..f331a96a9cd2 100644 --- a/media-sound/alsa-driver/Manifest +++ b/media-sound/alsa-driver/Manifest @@ -9,6 +9,10 @@ AUX alsa-driver-1.0.11-kernel-2.6.17.patch 953 RMD160 8790da12c78912a4dec53f2878 MD5 5e6246cc8148d4938810985fef9fc6c2 files/alsa-driver-1.0.11-kernel-2.6.17.patch 953 RMD160 8790da12c78912a4dec53f287838846e303a18dd files/alsa-driver-1.0.11-kernel-2.6.17.patch 953 SHA256 517f494c5fe3039d62a18268f2c3d03cbcd6b2bff09771bfaafd439c39642c2c files/alsa-driver-1.0.11-kernel-2.6.17.patch 953 +AUX alsa-driver-1.0.14-seq_file.patch 10470 RMD160 5a0c3d066211ef7597c9c5ed8c232f27183a1244 SHA1 70bde8e7ba010f77eb7bbd1ac3510d410ace7203 SHA256 39543da8f308c05af2f4507b75b9d8a353b7bc24c8c96e0b64e8e25e58e78564 +MD5 cc40f799d1e16222a9fb621bf9237b2c files/alsa-driver-1.0.14-seq_file.patch 10470 +RMD160 5a0c3d066211ef7597c9c5ed8c232f27183a1244 files/alsa-driver-1.0.14-seq_file.patch 10470 +SHA256 39543da8f308c05af2f4507b75b9d8a353b7bc24c8c96e0b64e8e25e58e78564 files/alsa-driver-1.0.14-seq_file.patch 10470 AUX alsa-driver-1.0.14_rc2-tumbler-ppc.patch 1105 RMD160 ae270a067ba51e4e580373465d698dd8aa872c5f SHA1 c4dd46e302417272b1123fc435d742e89677ee8d SHA256 1c154e2235697383fae4b06a0d3ec9e5c437188481711e639a186d0d920aeb76 MD5 e755c981c442750f6ecbc088ba86d9ba files/alsa-driver-1.0.14_rc2-tumbler-ppc.patch 1105 RMD160 ae270a067ba51e4e580373465d698dd8aa872c5f files/alsa-driver-1.0.14_rc2-tumbler-ppc.patch 1105 @@ -23,6 +27,10 @@ EBUILD alsa-driver-1.0.13.ebuild 5053 RMD160 b545351412e7222692d3e4746ff23fc2937 MD5 76be0e2298225b626343ad9c17d672ca alsa-driver-1.0.13.ebuild 5053 RMD160 b545351412e7222692d3e4746ff23fc29377a32a alsa-driver-1.0.13.ebuild 5053 SHA256 1f85e1013ebc73b71be96b2e0b9c78aa81a466d8d188483e43591bf84e513821 alsa-driver-1.0.13.ebuild 5053 +EBUILD alsa-driver-1.0.14-r1.ebuild 7047 RMD160 085a9db0d4b08117546d0ef9b10c1794be6c556f SHA1 58fa4cd8c211b758ee127a83481cd3a4813255f1 SHA256 27628c21ebf8fbc75071ecfe301418a27e213f8536fa9bd1ef6a9904563392d2 +MD5 74ba14ae9d4fb809ecd314c3b9693bc7 alsa-driver-1.0.14-r1.ebuild 7047 +RMD160 085a9db0d4b08117546d0ef9b10c1794be6c556f alsa-driver-1.0.14-r1.ebuild 7047 +SHA256 27628c21ebf8fbc75071ecfe301418a27e213f8536fa9bd1ef6a9904563392d2 alsa-driver-1.0.14-r1.ebuild 7047 EBUILD alsa-driver-1.0.14.ebuild 6967 RMD160 95858f2bdbcc02248477919570f77ecfa169681a SHA1 cd2bb07cd25974dd26f24444b420715f742a20c9 SHA256 61e8bf2156648de11183d2ebf7ff7369bc764e27dcba5486c593247749657e0b MD5 d21e8f309f09e3238f5bdeb36344cfaa alsa-driver-1.0.14.ebuild 6967 RMD160 95858f2bdbcc02248477919570f77ecfa169681a alsa-driver-1.0.14.ebuild 6967 @@ -51,10 +59,10 @@ EBUILD alsa-driver-9999.ebuild 6607 RMD160 c9ba6d45ef438a5c0e3c7033001f807006d35 MD5 a848bdd54e898bd3a9328968f56e236c alsa-driver-9999.ebuild 6607 RMD160 c9ba6d45ef438a5c0e3c7033001f807006d355c9 alsa-driver-9999.ebuild 6607 SHA256 21f7540dd1a8c7ba197fc739ef9e252c572449f76bf7ba2eefd9e2460465dd22 alsa-driver-9999.ebuild 6607 -MISC ChangeLog 47449 RMD160 96ce00f1ff6c269c1680c9b6f3f1000fe2bee2ec SHA1 a5217c63f52e4825e9067408b3d53077ff48b932 SHA256 5c64b756d5b2a94b0d16aa1f8e67363ed8507632919c7998af7c6db0feb1d0a9 -MD5 8cd44e7434eeb5dd5cb45a6abae8b5d4 ChangeLog 47449 -RMD160 96ce00f1ff6c269c1680c9b6f3f1000fe2bee2ec ChangeLog 47449 -SHA256 5c64b756d5b2a94b0d16aa1f8e67363ed8507632919c7998af7c6db0feb1d0a9 ChangeLog 47449 +MISC ChangeLog 47660 RMD160 0ecd285d622933851ed6c4c77909690dea62c7ed SHA1 361ef5d3f6827e245e8e031e77c37a108bf486ef SHA256 a1a80580fe705b0179ea6f35a864d7913f756ca6ef0f64777c37cbd9a6090c5f +MD5 21494dda2e44640a788a2757f17592e2 ChangeLog 47660 +RMD160 0ecd285d622933851ed6c4c77909690dea62c7ed ChangeLog 47660 +SHA256 a1a80580fe705b0179ea6f35a864d7913f756ca6ef0f64777c37cbd9a6090c5f ChangeLog 47660 MISC metadata.xml 220 RMD160 e49f8bb330d1798cd2c8ee5335cef1784f0d7ccb SHA1 1b895fe6cae4b8eab08ba1a6a1212baf4b4b4105 SHA256 8570ef11cd59b0d8edb71e78eecaec423616836b10eacb86bee0de941f0ae054 MD5 7c52acc7d4fe40bac97d3198a43dcbd6 metadata.xml 220 RMD160 e49f8bb330d1798cd2c8ee5335cef1784f0d7ccb metadata.xml 220 @@ -65,6 +73,9 @@ SHA256 45a8c562fbfcf8f05cb4ff799d55c3aa6506ef33539cbfd159a9d24bd634f553 files/di MD5 0344afd7bf64fd13878a008e3d520555 files/digest-alsa-driver-1.0.14 262 RMD160 0d55c65feb917aa6b96030d863773f01309d8235 files/digest-alsa-driver-1.0.14 262 SHA256 8a989ed4567638f0374445a4eba48f5b5a9bb29b6c28aa043687e9f55c20ebb3 files/digest-alsa-driver-1.0.14 262 +MD5 0344afd7bf64fd13878a008e3d520555 files/digest-alsa-driver-1.0.14-r1 262 +RMD160 0d55c65feb917aa6b96030d863773f01309d8235 files/digest-alsa-driver-1.0.14-r1 262 +SHA256 8a989ed4567638f0374445a4eba48f5b5a9bb29b6c28aa043687e9f55c20ebb3 files/digest-alsa-driver-1.0.14-r1 262 MD5 28d9b8b0d667802a060f3d2619046d22 files/digest-alsa-driver-1.0.14_rc1 271 RMD160 b09664e66f08a3af26e8c36ce1c03eba90c06704 files/digest-alsa-driver-1.0.14_rc1 271 SHA256 2fcc9c3a03d7cb5056f3254204a82ed8d48ff5c5c58a8447ebeeb609654fb4c8 files/digest-alsa-driver-1.0.14_rc1 271 @@ -84,9 +95,9 @@ MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-alsa-driver-9999 0 RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-alsa-driver-9999 0 SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-alsa-driver-9999 0 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.6 (GNU/Linux) +Version: GnuPG v1.4.7 (GNU/Linux) -iD8DBQFG7rpCyuNVb5qfaOYRAgsIAJ9BMMlWdjuKJ22UYUophrr0yp34eACdHyPV -Gc0I3jMIui/ySnpY9YliOvA= -=0D8a +iD8DBQFHA54iyuNVb5qfaOYRAlOnAKCOYhR1dBtdgCyOewKr04MCLUMIqQCfVkws +9UGbC4cYw0AbOl3F3sbB7GM= +=9PnM -----END PGP SIGNATURE----- diff --git a/media-sound/alsa-driver/alsa-driver-1.0.14-r1.ebuild b/media-sound/alsa-driver/alsa-driver-1.0.14-r1.ebuild new file mode 100644 index 000000000000..0234de192004 --- /dev/null +++ b/media-sound/alsa-driver/alsa-driver-1.0.14-r1.ebuild @@ -0,0 +1,180 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/alsa-driver-1.0.14-r1.ebuild,v 1.1 2007/10/03 13:50:21 phreak Exp $ + +inherit autotools linux-mod flag-o-matic eutils multilib + +MY_P="${P/_rc/rc}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="Advanced Linux Sound Architecture kernel modules" +HOMEPAGE="http://www.alsa-project.org/" + +if [[ ${MY_P} == ${MY_P/_p*/} ]]; then + SRC_URI="mirror://alsaproject/driver/${MY_P}.tar.bz2" +else # Gentoo snapshots + SRC_URI="mirror://gentoo/${MY_P}.tar.bz2" +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" + +KEYWORDS="~alpha ~amd64 ~ia64 ~mips ~ppc ~ppc64 ~x86" +IUSE="oss debug midi" + +IUSE_CARDS="seq-dummy dummy virmidi mtpav mts64 serial-u16550 mpu401 +loopback portman2x4 pcsp ad1848-lib cs4231-lib adlib ad1816a ad1848 +als100 azt2320 cmi8330 cs4231 cs4232 cs4236 dt019x es968 es1688 es18xx +gusclassic gusextreme gusmax interwave interwave-stb opl3sa2 +opti92x-ad1848 opti92x-cs4231 opti93x miro sb8 sb16 sbawe sgalaxy +sscape wavefront pc98-cs4232 msnd-pinnacle ad1889 als300 als4000 +ali5451 atiixp atiixp-modem au8810 au8820 au8830 azt3328 bt87x ca0106 +cmipci cs4281 cs46xx cs5535audio darla20 gina20 layla20 darla24 gina24 +layla24 mona mia echo3g indigo indigoio indigodj emu10k1 emu10k1x +ens1370 ens1371 es1938 es1968 fm801 fm801-tea575x hda-intel hdsp hdspm +ice1712 ice1724 intel8x0 intel8x0m korg1212 maestro3 mixart nm256 +pcxhr riptide rme32 rme96 rme9652 sonicvibes trident via82xx +via82xx-modem vx222 ymfpci pdplus asihpi powermac aoa +aoa-fabric-layout aoa-onyx aoa-tas aoa-toonie aoa-soundbus +aoa-soundbus-i2s sa11xx-uda1341 armaaci s3c2410 pxa2xx-i2sound au1x00 +usb-audio usb-usx2y vxpocket pdaudiocf sun-amd7930 sun-cs4231 sun-dbri +harmony soc at91-soc at91-soc-eti-b1-wm8731 pxa2xx-soc +pxa2xx-soc-corgi pxa2xx-soc-spitz pxa2xx-soc-poodle pxa2xx-soc-tosa" + +for iuse_card in ${IUSE_CARDS}; do + IUSE="${IUSE} alsa_cards_${iuse_card}" +done + +RDEPEND="virtual/modutils + !media-sound/snd-aoa" +DEPEND="${RDEPEND} + ~media-sound/alsa-headers-${PV} + virtual/linux-sources + sys-apps/debianutils" + +PROVIDE="virtual/alsa" + +pkg_setup() { + # By default, drivers for all supported cards will be compiled. + # If you want to only compile for specific card(s), set ALSA_CARDS + # environment to a space-separated list of drivers that you want to build. + # For example: + # + # env ALSA_CARDS='emu10k1 intel8x0 ens1370' emerge alsa-driver + # + ALSA_CARDS=${ALSA_CARDS:-${IUSE_ALSA_CARDS}} + + local PNP_DRIVERS="interwave interwave-stb" + local PNP_ERROR="Some of the drivers you selected require PnP support in your kernel (${PNP_DRIVERS}). Either enable PnP in your kernel or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf." + + local ISA_DRIVERS="cs4232 msnd-pinnacle cs4231-lib adlib ad1816a ad1848 als100 azt2320 + cmi8330 cs4231 cs4236 dt019x es968 es1688 es18xx gusclassic gusextreme gusmax + interwave interwave-stb opl3sa2 opti92x-ad1848 opti92x-cs4231 opti93x miro sb8 + sb16 sbawe sb16_csp sgalaxy sscape wavefront" + local ISA_ERROR="Some of the drivers you selected require ISA support in your kernel ($(echo $ISA_DRIVERS)). Either enable ISA in your kernel or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf." + + local FW_DRIVERS="darla20 gina20 layla20 darla24 gina24 layla24 mona mia echo3g indigo + indigoio indigodj emu10k1 korg1212 maestro3 riptide ymfpci asihpi" + local FW_LOADER_ERROR="Some of the drivers you selected require 'Userspace firmware loading support' in your kernel (${FW_DRIVERS}). Either enable that feature or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf." + + local PARPORT_DRIVERS="portman2x4" + local PARPORT_ERROR="Some if the drivers you selected require Parallel Port support (${PARPORT_DRIVERS}). Either enable that feature or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf." + + local TMP_ALSA_CARDS + local CHECK_PNP + local CHECK_ISA + local CHECK_FW + local CHECK_PARPORT + for card in ${ALSA_CARDS}; do + if has alsa_cards_${card} ${IUSE} && use alsa_cards_${card}; then + TMP_ALSA_CARDS="${TMP_ALSA_CARDS} ${card}" + has ${card} ${PNP_DRIVERS} && CHECK_PNP="PNP" + has ${card} ${ISA_DRIVERS} && CHECK_ISA="ISA" + has ${card} ${FW_DRIVERS} && CHECK_FW="FW_LOADER" + has ${card} ${PARPORT_DRIVERS} && CHECK_PARPORT="PARPORT" + fi + done + ALSA_CARDS="${TMP_ALSA_CARDS}" + + local CONFIG_CHECK="!SND SOUND ${CHECK_PNP} ${CHECK_ISA} ${CHECK_FW} ${CHECK_PARPORT}" + local SND_ERROR="ALSA is already compiled into the kernel. This is the recommended configuration, don't emerge alsa-driver." + local SOUND_ERROR="Your kernel doesn't have sound support enabled." + local SOUND_PRIME_ERROR="Your kernel is configured to use the deprecated OSS drivers. Please disable them and re-emerge alsa-driver." + + linux-mod_pkg_setup + + if [[ ${PROFILE_ARCH} == "sparc64" ]] ; then + export CBUILD=${CBUILD-${CHOST}} + export CHOST="sparc64-unknown-linux-gnu" + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-seq_file.patch + rm "${S}"/acore/memalloc.patch + + convert_to_m "${S}/Makefile" + sed -i -e 's:\(.*depmod\):#\1:' "${S}/Makefile" + eautoconf +} + +src_compile() { + local myABI=${ABI:-${DEFAULT_ABI}} + + # Should fix bug #46901 + is-flag "-malign-double" && filter-flags "-fomit-frame-pointer" + append-flags "-I${KV_DIR}/arch/$(tc-arch-kernel)/include" + + econf $(use_with oss) \ + $(use_with debug debug full) \ + --with-kernel="${KV_DIR}" \ + --with-build="${KV_OUT_DIR}" \ + --with-isapnp=yes \ + $(use_with midi sequencer) \ + --with-cards="${ALSA_CARDS}" || die "econf failed" + + # linux-mod_src_compile doesn't work well with alsa + + ARCH=$(tc-arch-kernel) + ABI=${KERNEL_ABI} + emake LDFLAGS="$(raw-ldflags)" HOSTCC="$(tc-getBUILD_CC)" CC="$(tc-getCC)" || die "Make Failed" + ARCH=$(tc-arch) + ABI=${myABI} +} + +src_install() { + emake DESTDIR="${D}" install-modules || die "make install failed" + + dodoc CARDS-STATUS FAQ README WARNING TODO + + if kernel_is 2 6; then + # mv the drivers somewhere they won't be killed by the kernel's make modules_install + mv "${D}/lib/modules/${KV_FULL}/kernel/sound" "${D}/lib/modules/${KV_FULL}/${PN}" + rmdir "${D}/lib/modules/${KV_FULL}/kernel" &> /dev/null + fi +} + +pkg_postinst() { + elog + elog "Remember that all mixer channels will be MUTED by default." + elog "Use the 'alsamixer' program to unmute them, then save your" + elog "mixer settings with /etc/init.d/alsasound save" + elog + elog "If you experience problems, please try building the in-kernel" + elog "ALSA drivers instead. This ebuild is not recommended and is" + elog "likely to be removed from portage at a later date." + elog + + linux-mod_pkg_postinst + + if kernel_is 2 6 && [ -e "${ROOT}/lib/modules/${KV_FULL}/kernel/sound" ]; then + # Cleanup if they had older alsa installed + for file in $(find "${ROOT}/lib/modules/${KV_FULL}/${PN}" -type f); do + rm -f ${file//${KV_FULL}\/${PN}/${KV_FULL}\/kernel\/sound} + done + + find "${ROOT}/lib/modules/${KV_FULL}/kernel/sound" -type d -print0 | xargs --null rmdir + fi +} diff --git a/media-sound/alsa-driver/files/alsa-driver-1.0.14-seq_file.patch b/media-sound/alsa-driver/files/alsa-driver-1.0.14-seq_file.patch new file mode 100644 index 000000000000..974f638a6a92 --- /dev/null +++ b/media-sound/alsa-driver/files/alsa-driver-1.0.14-seq_file.patch @@ -0,0 +1,316 @@ +--- a/acore/Makefile ++++ b/acore/Makefile +@@ -36,5 +36,5 @@ init.c: init.patch $(SND_TOPDIR)/alsa-ke + rawmidi.c: rawmidi.patch $(SND_TOPDIR)/alsa-kernel/core/rawmidi.c + sound.c: sound.patch $(SND_TOPDIR)/alsa-kernel/core/sound.c + timer.c: timer.patch $(SND_TOPDIR)/alsa-kernel/core/timer.c +-memalloc.c: memalloc.patch memalloc.inc memalloc.inc1 $(SND_TOPDIR)/alsa-kernel/core/memalloc.c ++memalloc.c: memalloc.inc memalloc.inc1 $(SND_TOPDIR)/alsa-kernel/core/memalloc.c + misc.c: misc.patch $(SND_TOPDIR)/alsa-kernel/core/misc.c +--- a/alsa-kernel/core/memalloc.c ++++ b/alsa-kernel/core/memalloc.c +@@ -1,3 +1,4 @@ ++#include "memalloc.inc" + /* + * Copyright (c) by Jaroslav Kysela <perex@suse.cz> + * Takashi Iwai <tiwai@suse.de> +@@ -82,7 +83,50 @@ struct snd_mem_list { + * Hacks + */ + +-#if defined(__i386__) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 5) ++static void *snd_dma_alloc_coherent1(struct device *dev, size_t size, ++ dma_addr_t *dma_handle, int flags) ++{ ++ if (dev) ++ return dma_alloc_coherent(dev, size, dma_handle, flags); ++ else /* FIXME: dma_alloc_coherent does't always accept dev=NULL */ ++ return pci_alloc_consistent(NULL, size, dma_handle); ++} ++ ++static void snd_dma_free_coherent1(struct device *dev, size_t size, void *dma_addr, ++ dma_addr_t dma_handle) ++{ ++ if (dev) ++ return dma_free_coherent(dev, size, dma_addr, dma_handle); ++ else ++ return pci_free_consistent(NULL, size, dma_addr, dma_handle); ++} ++ ++#undef dma_alloc_coherent ++#define dma_alloc_coherent snd_dma_alloc_coherent1 ++#undef dma_free_coherent ++#define dma_free_coherent snd_dma_free_coherent1 ++#endif /* < 2.6.5 */ ++ ++#else ++ ++/* for 2.2/2.4 kernels */ ++#if defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(__i386__) ++#define dma_alloc_coherent(dev,size,addr,flags) pci_alloc_consistent((struct pci_dev *)(dev),size,addr) ++#define dma_free_coherent(dev,size,ptr,addr) pci_free_consistent((struct pci_dev *)(dev),size,ptr,addr) ++#elif CONFIG_SBUS ++#define dma_alloc_coherent(dev,size,addr,flags) sbus_alloc_consistent((struct sbus_dev *)(dev),size,addr) ++#define dma_free_coherent(dev,size,ptr,addr) sbus_free_consistent((struct sbus_dev *)(dev),size,ptr,addr) ++#else ++#error "Need a bus for dma_alloc_coherent()" ++#endif ++ ++#endif /* >= 2.6.0 */ ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) ++#if defined(__i386__) || defined(__ppc__) || defined(__x86_64__) ++ + /* + * A hack to allocate large buffers via dma_alloc_coherent() + * +@@ -99,6 +143,30 @@ struct snd_mem_list { + * so dma_mask doesn't have to be messed with. + */ + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) ++#define VALID_DMA_MASK(dev) (dev)->dma_mask ++#define GET_DMA_MASK(dev) *(dev)->dma_mask ++#define SET_DMA_MASK(dev,val) (*(dev)->dma_mask = (val)) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 5) ++#define GET_COHERENT_DMA_MASK(dev) (dev)->coherent_dma_mask ++#define SET_COHERENT_DMA_MASK(dev,val) ((dev)->coherent_dma_mask = (val)) ++#else ++#define GET_COHERENT_DMA_MASK(dev) 0 /* dummy */ ++#define SET_COHERENT_DMA_MASK(dev,val) ++#endif ++#else /* 2.4.x */ ++#define VALID_DMA_MASK(dev) 1 ++#define GET_DMA_MASK(dev) ((struct pci_dev *)(dev))->dma_mask ++#define SET_DMA_MASK(dev,val) (((struct pci_dev *)(dev))->dma_mask = (val)) ++#ifdef CONFIG_HAVE_PCI_CONSISTENT_DMA_MASK ++#define GET_COHERENT_DMA_MASK(dev) ((struct pci_dev *)(dev))->consistent_dma_mask ++#define SET_COHERENT_DMA_MASK(dev,val) (((struct pci_dev *)(dev))->consistent_dma_mask = (val)) ++#else ++#define GET_COHERENT_DMA_MASK(dev) 0 /* dummy */ ++#define SET_COHERENT_DMA_MASK(dev,val) ++#endif ++#endif ++ + static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size, + dma_addr_t *dma_handle, + gfp_t flags) +@@ -106,15 +174,15 @@ static void *snd_dma_hack_alloc_coherent + void *ret; + u64 dma_mask, coherent_dma_mask; + +- if (dev == NULL || !dev->dma_mask) ++ if (dev == NULL || !VALID_DMA_MASK(dev)) + return dma_alloc_coherent(dev, size, dma_handle, flags); +- dma_mask = *dev->dma_mask; +- coherent_dma_mask = dev->coherent_dma_mask; +- *dev->dma_mask = 0xffffffff; /* do without masking */ +- dev->coherent_dma_mask = 0xffffffff; /* do without masking */ ++ dma_mask = GET_DMA_MASK(dev); ++ coherent_dma_mask = GET_COHERENT_DMA_MASK(dev); ++ SET_DMA_MASK(dev, 0xffffffff); /* do without masking */ ++ SET_COHERENT_DMA_MASK(dev, 0xffffffff); /* do without masking */ + ret = dma_alloc_coherent(dev, size, dma_handle, flags); +- *dev->dma_mask = dma_mask; /* restore */ +- dev->coherent_dma_mask = coherent_dma_mask; /* restore */ ++ SET_DMA_MASK(dev, dma_mask); /* restore */ ++ SET_COHERENT_DMA_MASK(dev, coherent_dma_mask) /* restore */; + if (ret) { + /* obtained address is out of range? */ + if (((unsigned long)*dma_handle + size - 1) & ~dma_mask) { +@@ -139,6 +207,8 @@ static void *snd_dma_hack_alloc_coherent + #define dma_alloc_coherent snd_dma_hack_alloc_coherent + + #endif /* arch */ ++#endif /* >= 2.4.0 */ ++ + + /* + * +@@ -158,6 +228,24 @@ static inline void dec_snd_pages(int ord + snd_allocated_pages -= 1 << order; + } + ++static void mark_pages(struct page *page, int order) ++{ ++#if ! defined(__arm__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) ++ struct page *last_page = page + (1 << order); ++ while (page < last_page) ++ SetPageReserved(page++); ++#endif ++} ++ ++static void unmark_pages(struct page *page, int order) ++{ ++#if ! defined(__arm__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) ++ struct page *last_page = page + (1 << order); ++ while (page < last_page) ++ ClearPageReserved(page++); ++#endif ++} ++ + /** + * snd_malloc_pages - allocate pages with the given size + * @size: the size to allocate in bytes +@@ -176,8 +264,10 @@ void *snd_malloc_pages(size_t size, gfp_ + snd_assert(gfp_flags != 0, return NULL); + gfp_flags |= __GFP_COMP; /* compound page lets parts be mapped */ + pg = get_order(size); +- if ((res = (void *) __get_free_pages(gfp_flags, pg)) != NULL) ++ if ((res = (void *) __get_free_pages(gfp_flags, pg)) != NULL) { ++ mark_pages(virt_to_page(res), pg); + inc_snd_pages(pg); ++ } + return res; + } + +@@ -196,6 +286,7 @@ void snd_free_pages(void *ptr, size_t si + return; + pg = get_order(size); + dec_snd_pages(pg); ++ unmark_pages(virt_to_page(ptr), pg); + free_pages((unsigned long) ptr, pg); + } + +@@ -220,8 +311,10 @@ static void *snd_malloc_dev_pages(struct + | __GFP_NORETRY /* don't trigger OOM-killer */ + | __GFP_NOWARN; /* no stack trace print - this call is non-critical */ + res = dma_alloc_coherent(dev, PAGE_SIZE << pg, dma, gfp_flags); +- if (res != NULL) ++ if (res != NULL) { ++ mark_pages(virt_to_page(res), pg); + inc_snd_pages(pg); ++ } + + return res; + } +@@ -236,6 +329,7 @@ static void snd_free_dev_pages(struct de + return; + pg = get_order(size); + dec_snd_pages(pg); ++ unmark_pages(virt_to_page(ptr), pg); + dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma); + } + +@@ -481,53 +575,55 @@ static void free_all_reserved_pages(void + #define SND_MEM_PROC_FILE "driver/snd-page-alloc" + static struct proc_dir_entry *snd_mem_proc; + +-static int snd_mem_proc_read(char *page, char **start, off_t off, +- int count, int *eof, void *data) ++static int snd_mem_proc_read(struct seq_file *seq, void *offset) + { +- int len = 0; + long pages = snd_allocated_pages >> (PAGE_SHIFT-12); + struct snd_mem_list *mem; + int devno; + static char *types[] = { "UNKNOWN", "CONT", "DEV", "DEV-SG", "SBUS" }; + ++ seq_printf(seq, "pages : %li bytes (%li pages per %likB)\n", ++ pages * PAGE_SIZE, pages, PAGE_SIZE / 1024); + mutex_lock(&list_mutex); +- len += snprintf(page + len, count - len, +- "pages : %li bytes (%li pages per %likB)\n", +- pages * PAGE_SIZE, pages, PAGE_SIZE / 1024); + devno = 0; + list_for_each_entry(mem, &mem_list_head, list) { + devno++; +- len += snprintf(page + len, count - len, +- "buffer %d : ID %08x : type %s\n", +- devno, mem->id, types[mem->buffer.dev.type]); +- len += snprintf(page + len, count - len, +- " addr = 0x%lx, size = %d bytes\n", +- (unsigned long)mem->buffer.addr, (int)mem->buffer.bytes); ++ seq_printf(seq, "buffer %d : ID %08x : type %s\n", ++ devno, mem->id, types[mem->buffer.dev.type]); ++ seq_printf(seq, " addr = 0x%lx, size = %d bytes\n", ++ (unsigned long)mem->buffer.addr, ++ (int)mem->buffer.bytes); + } + mutex_unlock(&list_mutex); +- return len; ++ return 0; ++} ++ ++static int snd_mem_proc_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, snd_mem_proc_read, NULL); + } + + /* FIXME: for pci only - other bus? */ + #ifdef CONFIG_PCI ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) + #define gettoken(bufp) strsep(bufp, " \t\n") + +-static int snd_mem_proc_write(struct file *file, const char __user *buffer, +- unsigned long count, void *data) ++static ssize_t snd_mem_proc_write(struct file *file, const char __user * buffer, ++ size_t count, loff_t * ppos) + { + char buf[128]; + char *token, *p; + +- if (count > ARRAY_SIZE(buf) - 1) +- count = ARRAY_SIZE(buf) - 1; ++ if (count > sizeof(buf) - 1) ++ return -EINVAL; + if (copy_from_user(buf, buffer, count)) + return -EFAULT; +- buf[ARRAY_SIZE(buf) - 1] = '\0'; ++ buf[count] = '\0'; + + p = buf; + token = gettoken(&p); + if (! token || *token == '#') +- return (int)count; ++ return count; + if (strcmp(token, "add") == 0) { + char *endp; + int vendor, device, size, buffers; +@@ -596,9 +692,22 @@ static int snd_mem_proc_write(struct fil + free_all_reserved_pages(); + else + printk(KERN_ERR "snd-page-alloc: invalid proc cmd\n"); +- return (int)count; ++ return count; + } ++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) */ + #endif /* CONFIG_PCI */ ++ ++static const struct file_operations snd_mem_proc_fops = { ++ .owner = THIS_MODULE, ++ .open = snd_mem_proc_open, ++ .read = seq_read, ++#ifdef CONFIG_PCI ++ .write = snd_mem_proc_write, ++#endif ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ + #endif /* CONFIG_PROC_FS */ + + /* +@@ -609,12 +718,8 @@ static int __init snd_mem_init(void) + { + #ifdef CONFIG_PROC_FS + snd_mem_proc = create_proc_entry(SND_MEM_PROC_FILE, 0644, NULL); +- if (snd_mem_proc) { +- snd_mem_proc->read_proc = snd_mem_proc_read; +-#ifdef CONFIG_PCI +- snd_mem_proc->write_proc = snd_mem_proc_write; +-#endif +- } ++ if (snd_mem_proc) ++ snd_mem_proc->proc_fops = &snd_mem_proc_fops; + #endif + return 0; + } +@@ -644,3 +749,5 @@ EXPORT_SYMBOL(snd_dma_reserve_buf); + + EXPORT_SYMBOL(snd_malloc_pages); + EXPORT_SYMBOL(snd_free_pages); ++ ++#include "memalloc.inc1" diff --git a/media-sound/alsa-driver/files/digest-alsa-driver-1.0.14-r1 b/media-sound/alsa-driver/files/digest-alsa-driver-1.0.14-r1 new file mode 100644 index 000000000000..1249e22daedf --- /dev/null +++ b/media-sound/alsa-driver/files/digest-alsa-driver-1.0.14-r1 @@ -0,0 +1,3 @@ +MD5 78232c1c38db6a1f4e1d304e2cc1f660 alsa-driver-1.0.14.tar.bz2 2600096 +RMD160 2d017ed11bd037e450ffa969602f84cc104e5b72 alsa-driver-1.0.14.tar.bz2 2600096 +SHA256 4987c05fd5516f9cb36ff4b73ccb77300124423b2bd6c66260eed73317529eca alsa-driver-1.0.14.tar.bz2 2600096 |