diff options
| author | augustss <augustss@NetBSD.org> | 2002-02-14 03:22:36 +0000 |
|---|---|---|
| committer | augustss <augustss@NetBSD.org> | 2002-02-14 03:22:36 +0000 |
| commit | 076c2a2de8853af95818f18cb86b8eaf944e4e2a (patch) | |
| tree | 1137efd8fe4869892331daf7923fb85fd293d7d3 /sys/dev | |
| parent | 549323fedcff24e90db87b63d7238801e14afd93 (diff) | |
Make fixed rate codecs work. From Tsuyoshi Iguchi in kern/15606.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/auich.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c index 9324f392ab2..750825cfcff 100644 --- a/sys/dev/pci/auich.c +++ b/sys/dev/pci/auich.c @@ -1,4 +1,4 @@ -/* $NetBSD: auich.c,v 1.9 2002/02/02 11:13:44 augustss Exp $ */ +/* $NetBSD: auich.c,v 1.10 2002/02/14 03:22:36 augustss Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -80,7 +80,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.9 2002/02/02 11:13:44 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.10 2002/02/14 03:22:36 augustss Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -401,6 +401,7 @@ auich_attach(struct device *parent, struct device *self, void *aux) sc->sc_fixed_rate = 0; } else { sc->sc_fixed_rate = 48000; + printf("%s: warning, fixed rate codec\n", sc->sc_dev.dv_xname); } audio_attach_mi(&auich_hw_if, sc, &sc->sc_dev); @@ -669,6 +670,15 @@ auich_set_params(void *v, int setmode, int usemode, struct audio_params *play, sc->sc_fixed_rate ? sc->sc_fixed_rate : p->sample_rate); auich_read_codec(sc, AC97_REG_PCM_FRONT_DAC_RATE, &rate); p->sample_rate = rate; + if (sc->sc_fixed_rate) { + p->sample_rate = sc->sc_fixed_rate; + } else { + auich_write_codec(sc, AC97_REG_PCM_FRONT_DAC_RATE, + p->sample_rate); + auich_read_codec(sc, AC97_REG_PCM_FRONT_DAC_RATE, + &rate); + p->sample_rate = rate; + } auich_write_codec(sc, AC97_REG_POWER, val); } |
