Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/hdaudio For AC3, set the Non-PCM bit in the stre...



details:   https://anonhg.NetBSD.org/src/rev/d7e841a8b9a2
branches:  trunk
changeset: 769306:d7e841a8b9a2
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Sep 06 10:48:28 2011 +0000

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

diffstat:

 sys/dev/pci/hdaudio/hdaudio.c    |  13 +++++++++++--
 sys/dev/pci/hdaudio/hdaudioreg.h |   5 ++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diffs (53 lines):

diff -r 04b802a00c45 -r d7e841a8b9a2 sys/dev/pci/hdaudio/hdaudio.c
--- a/sys/dev/pci/hdaudio/hdaudio.c     Tue Sep 06 10:27:07 2011 +0000
+++ b/sys/dev/pci/hdaudio/hdaudio.c     Tue Sep 06 10:48:28 2011 +0000
@@ -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 <support%precedence.co.uk@localhost>
@@ -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) |
diff -r 04b802a00c45 -r d7e841a8b9a2 sys/dev/pci/hdaudio/hdaudioreg.h
--- a/sys/dev/pci/hdaudio/hdaudioreg.h  Tue Sep 06 10:27:07 2011 +0000
+++ b/sys/dev/pci/hdaudio/hdaudioreg.h  Tue Sep 06 10:48:28 2011 +0000
@@ -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 <support%precedence.co.uk@localhost>
@@ -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



Home | Main Index | Thread Index | Old Index