Module Name:    src
Committed By:   jmcneill
Date:           Tue Sep  6 10:48:29 UTC 2011

Modified Files:
        src/sys/dev/pci/hdaudio: hdaudio.c hdaudioreg.h

Log Message:
For AC3, set the Non-PCM bit in the stream format structure used in the
stream descriptors & codec config.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/hdaudio/hdaudio.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/hdaudio/hdaudioreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/hdaudio/hdaudio.c
diff -u src/sys/dev/pci/hdaudio/hdaudio.c:1.14 src/sys/dev/pci/hdaudio/hdaudio.c:1.15
--- src/sys/dev/pci/hdaudio/hdaudio.c:1.14	Mon Aug 29 14:47:09 2011
+++ src/sys/dev/pci/hdaudio/hdaudio.c	Tue Sep  6 10:48:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.14 2011/08/29 14:47:09 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.15 2011/09/06 10:48:28 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <supp...@precedence.co.uk>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.14 2011/08/29 14:47:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.15 2011/09/06 10:48:28 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1070,6 +1070,15 @@
 {
 	uint16_t fmt = 0;
 
+	switch (param->encoding) {
+	case AUDIO_ENCODING_AC3:
+		fmt |= HDAUDIO_FMT_TYPE_NONPCM;
+		break;
+	default:
+		fmt |= HDAUDIO_FMT_TYPE_PCM;
+		break;
+	}
+
 	switch (param->sample_rate) {
 	case 8000:
 		fmt |= HDAUDIO_FMT_BASE_48 | HDAUDIO_FMT_MULT(1) |

Index: src/sys/dev/pci/hdaudio/hdaudioreg.h
diff -u src/sys/dev/pci/hdaudio/hdaudioreg.h:1.6 src/sys/dev/pci/hdaudio/hdaudioreg.h:1.7
--- src/sys/dev/pci/hdaudio/hdaudioreg.h:1.6	Tue Sep  6 01:51:44 2011
+++ src/sys/dev/pci/hdaudio/hdaudioreg.h	Tue Sep  6 10:48:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudioreg.h,v 1.6 2011/09/06 01:51:44 jmcneill Exp $ */
+/* $NetBSD: hdaudioreg.h,v 1.7 2011/09/06 10:48:28 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <supp...@precedence.co.uk>
@@ -123,6 +123,9 @@
 #define	HDAUDIO_SD_FIFOW(x) 	HDAUDIO_SD_REG(0x0e, x)
 #define	HDAUDIO_SD_FIFOS(x) 	HDAUDIO_SD_REG(0x10, x)
 #define	HDAUDIO_SD_FMT(x)	HDAUDIO_SD_REG(0x12, x)
+#define	 HDAUDIO_FMT_TYPE_MASK	 0x8000
+#define	  HDAUDIO_FMT_TYPE_PCM	  0x0000
+#define	  HDAUDIO_FMT_TYPE_NONPCM 0x8000
 #define	 HDAUDIO_FMT_BASE_MASK	 0x4000
 #define	  HDAUDIO_FMT_BASE_48	  0x0000
 #define	  HDAUDIO_FMT_BASE_44	  0x4000

Reply via email to