Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci SiS 7012 uses different multichannel control bit...



details:   https://anonhg.NetBSD.org/src/rev/73ede6d90a72
branches:  trunk
changeset: 747126:73ede6d90a72
user:      sborrill <sborrill%NetBSD.org@localhost>
date:      Thu Sep 03 14:29:42 2009 +0000

description:
SiS 7012 uses different multichannel control bits compared to other codecs
(data from linux via OpenBSD).

diffstat:

 sys/dev/pci/auich.c    |  26 ++++++++++++++++++++------
 sys/dev/pci/auichreg.h |   6 +++++-
 2 files changed, 25 insertions(+), 7 deletions(-)

diffs (97 lines):

diff -r 23ec1ef0f4d6 -r 73ede6d90a72 sys/dev/pci/auich.c
--- a/sys/dev/pci/auich.c       Thu Sep 03 14:13:16 2009 +0000
+++ b/sys/dev/pci/auich.c       Thu Sep 03 14:29:42 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auich.c,v 1.129 2009/03/17 19:38:34 dyoung Exp $       */
+/*     $NetBSD: auich.c,v 1.130 2009/09/03 14:29:42 sborrill Exp $     */
 
 /*-
  * Copyright (c) 2000, 2004, 2005 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.129 2009/03/17 19:38:34 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.130 2009/09/03 14:29:42 sborrill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -185,6 +185,12 @@
        enum ac97_host_flags sc_codecflags;
        bool sc_spdif;
 
+       /* multi-channel control bits */
+       int sc_pcm246_mask;
+       int sc_pcm2;
+       int sc_pcm4;
+       int sc_pcm6;
+
        /* DMA scatter-gather lists. */
        bus_dmamap_t sc_cddmamap;
 #define        sc_cddma        sc_cddmamap->dm_segs[0].ds_addr
@@ -551,6 +557,10 @@
        if (d->id == PCIID_SIS7012) {
                sc->sc_sts_reg = ICH_PICB;
                sc->sc_sample_shift = 0;
+               sc->sc_pcm246_mask = ICH_SIS_PCM246_MASK;
+               sc->sc_pcm2 = ICH_SIS_PCM2;
+               sc->sc_pcm4 = ICH_SIS_PCM4;
+               sc->sc_pcm6 = ICH_SIS_PCM6;
                /* Un-mute output. From Linux. */
                bus_space_write_4(sc->iot, sc->aud_ioh, ICH_SIS_NV_CTL,
                    bus_space_read_4(sc->iot, sc->aud_ioh, ICH_SIS_NV_CTL) |
@@ -558,6 +568,10 @@
        } else {
                sc->sc_sts_reg = ICH_STS;
                sc->sc_sample_shift = 1;
+               sc->sc_pcm246_mask = ICH_PCM246_MASK;
+               sc->sc_pcm2 = ICH_PCM2;
+               sc->sc_pcm4 = ICH_PCM4;
+               sc->sc_pcm6 = ICH_PCM6;
        }
 
        /* Workaround for a 440MX B-stepping erratum */
@@ -859,7 +873,7 @@
        control = bus_space_read_4(sc->iot, sc->aud_ioh,
            ICH_GCTRL + sc->sc_modem_offset);
        if (sc->sc_codectype == AC97_CODEC_TYPE_AUDIO) {
-               control &= ~(ICH_ACLSO | ICH_PCM246_MASK);
+               control &= ~(ICH_ACLSO | sc->sc_pcm246_mask);
        } else {
                control &= ~ICH_ACLSO;
                control |= ICH_GIE;
@@ -1021,11 +1035,11 @@
                    sc->sc_codectype == AC97_CODEC_TYPE_AUDIO) {
                        control = bus_space_read_4(sc->iot, sc->aud_ioh,
                            ICH_GCTRL + sc->sc_modem_offset);
-                               control &= ~ICH_PCM246_MASK;
+                               control &= ~sc->sc_pcm246_mask;
                        if (p->channels == 4) {
-                               control |= ICH_PCM4;
+                               control |= sc->sc_pcm4;
                        } else if (p->channels == 6) {
-                               control |= ICH_PCM6;
+                               control |= sc->sc_pcm6;
                        }
                        bus_space_write_4(sc->iot, sc->aud_ioh,
                            ICH_GCTRL + sc->sc_modem_offset, control);
diff -r 23ec1ef0f4d6 -r 73ede6d90a72 sys/dev/pci/auichreg.h
--- a/sys/dev/pci/auichreg.h    Thu Sep 03 14:13:16 2009 +0000
+++ b/sys/dev/pci/auichreg.h    Thu Sep 03 14:29:42 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auichreg.h,v 1.11 2008/01/14 21:33:04 martin Exp $     */
+/*     $NetBSD: auichreg.h,v 1.12 2009/09/03 14:29:42 sborrill Exp $   */
 
 /*
  * Copyright (c) 2000 Michael Shalayeff
@@ -85,6 +85,10 @@
 #define                 ICH_PCM2       0x000000 /* 2ch output */
 #define                 ICH_PCM4       0x100000 /* 4ch output */
 #define                 ICH_PCM6       0x200000 /* 6ch output */
+#define                ICH_SIS_PCM246_MASK     0x0000c0
+#define                 ICH_SIS_PCM2   0x000000 /* 2ch output */
+#define                 ICH_SIS_PCM4   0x000040 /* 4ch output */
+#define                 ICH_SIS_PCM6   0x000080 /* 6ch output */
 #define                ICH_S2RIE       0x40    /* int when tertiary codec resume */
 #define                ICH_SRIE        0x20    /* int when 2ndary codec resume */
 #define                ICH_PRIE        0x10    /* int when primary codec resume */



Home | Main Index | Thread Index | Old Index