[PATCH] [UBUNTU:sound/pci/hda/] Clean up hda-intel.c

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Sat Sep 9 20:28:25 UTC 2006


From 35ff5d8b369c3371d026a323a18dd8a2f9cf07a4 Mon Sep 17 00:00:00 2001
From: Daniel T. Chen <crimsun at garnish.localdomain>
Date: Wed, 6 Sep 2006 13:28:51 -0400
Subject: [PATCH] [UBUNTU:sound/pci/hda/] Clean up hda-intel.c

UpstreamStatus: Added in upstream alsa-kernel hg changeset:
		1fcaf04eed52 [http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=1fcaf04eed52e42be56eb67d4cd1503b29f85b1a;style=raw]

This commit from Takashi Iwai uses the more reliable
synchronize_irq() and cleans up the position buffer pointer.

Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>
---
 sound/pci/hda/hda_intel.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 829d561..1529550 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -247,7 +247,7 @@ typedef struct snd_azx_dev azx_dev_t;
 struct snd_azx_dev {
 	u32 *bdl;			/* virtual address of the BDL */
 	dma_addr_t bdl_addr;		/* physical address of the BDL */
-	volatile u32 *posbuf;			/* position buffer pointer */
+	u32 *posbuf;			/* position buffer pointer */
 
 	unsigned int bufsize;		/* size of the play buffer in bytes */
 	unsigned int fragsize;		/* size of each period in bytes */
@@ -1171,7 +1171,7 @@ static snd_pcm_uframes_t azx_pcm_pointer
 	if (chip->position_fix == POS_FIX_POSBUF ||
 	    chip->position_fix == POS_FIX_AUTO) {
 		/* use the position buffer */
-		pos = *azx_dev->posbuf;
+		pos = le32_to_cpu(*azx_dev->posbuf);
 		if (chip->position_fix == POS_FIX_AUTO &&
 		    azx_dev->period_intr == 1 && ! pos) {
 			printk(KERN_WARNING
@@ -1319,7 +1319,7 @@ static int __devinit azx_init_stream(azx
 		azx_dev_t *azx_dev = &chip->azx_dev[i];
 		azx_dev->bdl = (u32 *)(chip->bdl.area + off);
 		azx_dev->bdl_addr = chip->bdl.addr + off;
-		azx_dev->posbuf = (volatile u32 *)(chip->posbuf.area + i * 8);
+		azx_dev->posbuf = (u32 __iomem *)(chip->posbuf.area + i * 8);
 		/* offset: SDI0=0x80, SDI1=0xa0, ... SDO3=0x160 */
 		azx_dev->sd_addr = chip->remap_addr + (0x20 * i + 0x80);
 		/* int mask: SDI0=0x01, SDI1=0x02, ... SDO3=0x80 */
@@ -1391,8 +1391,7 @@ static int azx_free(azx_t *chip)
 		azx_writel(chip, DPLBASE, 0);
 		azx_writel(chip, DPUBASE, 0);
 
-		/* wait a little for interrupts to finish */
-		msleep(1);
+		synchronize_irq(chip->irq);
 	}
 
 	if (chip->irq >= 0)
-- 
1.4.1

-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:  0xC88ABDA3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20060909/5fc5ca48/attachment.sig>


More information about the kernel-team mailing list