diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-04-05 17:19:02 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2005-04-05 17:19:02 +0000 |
commit | d9e7a75c81ece80e0aa363bb6f634a58b611efb7 (patch) | |
tree | ed33e8d645b9e26e91b57005656392767b2bb89a | |
parent | 78abd85cc1304c2326255070ecce68efc96739c2 (diff) |
from netbsd:
Some SiS 7012 chips come muted by default, so un-mute all SiS 7012 chips at
attach time the way Linux does it. Reported and tested by Jonathan
Schleifer, I checked it didn't break my own 7012 device which doesn't need
that manipulation.
-rw-r--r-- | sys/dev/pci/auich.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c index 3450a07653f..6b2efed37b2 100644 --- a/sys/dev/pci/auich.c +++ b/sys/dev/pci/auich.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auich.c,v 1.48 2005/04/05 01:41:44 mickey Exp $ */ +/* $OpenBSD: auich.c,v 1.49 2005/04/05 17:19:01 mickey Exp $ */ /* * Copyright (c) 2000,2001 Michael Shalayeff @@ -138,6 +138,9 @@ #define AUICH_SEMATIMO 1000 /* us */ #define AUICH_RESETIMO 500000 /* us */ +#define ICH_SIS_NV_CTL 0x4c /* some SiS/nVidia register. From Linux */ +#define ICH_SIS_CTL_UNMUTE 0x01 /* un-mute the output */ + /* * according to the dev/audiovar.h AU_RING_SIZE is 2^16, what fits * in our limits perfectly, i.e. setting it to higher value @@ -347,16 +350,6 @@ auich_attach(parent, self, aux) u_int32_t status; int i; - /* SiS 7012 needs special handling */ - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_SIS && - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SIS_7012_ACA) { - sc->sc_sts_reg = AUICH_PICB; - sc->sc_sample_size = 1; - } else { - sc->sc_sts_reg = AUICH_STS; - sc->sc_sample_size = 2; - } - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_INTEL && (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_82801DB_ACA || PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_82801EB_ACA || @@ -441,6 +434,20 @@ auich_attach(parent, self, aux) printf(": %s, %s\n", intrstr, sc->sc_audev.name); + /* SiS 7012 needs special handling */ + if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_SIS && + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SIS_7012_ACA) { + sc->sc_sts_reg = AUICH_PICB; + sc->sc_sample_size = 1; + /* un-mute output */ + 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) | + ICH_SIS_CTL_UNMUTE); + } else { + sc->sc_sts_reg = AUICH_STS; + sc->sc_sample_size = 2; + } + /* allocate dma lists */ #define a(a) (void *)(((u_long)(a) + sizeof(*(a)) - 1) & ~(sizeof(*(a))-1)) sc->dmalist_pcmo = sc->dmap_pcmo = a(sc->dmasto_pcmo); |