Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Force the codec into a known state before trying...
details: https://anonhg.NetBSD.org/src/rev/3bff2105a4fe
branches: trunk
changeset: 554987:3bff2105a4fe
user: mycroft <mycroft%NetBSD.org@localhost>
date: Thu Nov 06 07:13:33 2003 +0000
description:
Force the codec into a known state before trying to determine its speed.
diffstat:
sys/dev/pci/auich.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (43 lines):
diff -r b8823b179d27 -r 3bff2105a4fe sys/dev/pci/auich.c
--- a/sys/dev/pci/auich.c Thu Nov 06 07:09:40 2003 +0000
+++ b/sys/dev/pci/auich.c Thu Nov 06 07:13:33 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auich.c,v 1.53 2003/10/31 08:15:53 kent Exp $ */
+/* $NetBSD: auich.c,v 1.54 2003/11/06 07:13:33 mycroft Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.53 2003/10/31 08:15:53 kent Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.54 2003/11/06 07:13:33 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1440,6 +1440,7 @@
uint32_t actual_48k_rate, bytes, ac97rate;
void *temp_buffer;
struct auich_dma *p;
+ u_long rate;
/*
* Grab audio from input for fixed interval and compare how
@@ -1448,9 +1449,16 @@
* generated.
*/
+ /* Force the codec to a known state first. */
+ sc->codec_if->vtbl->set_clock(sc->codec_if, 48000);
+ rate = 48000;
+ sc->codec_if->vtbl->set_rate(sc->codec_if, AC97_REG_PCM_LR_ADC_RATE,
+ &rate);
+
/* Setup a buffer */
bytes = 64000;
temp_buffer = auich_allocm(sc, AUMODE_RECORD, bytes, M_DEVBUF, M_WAITOK);
+
for (p = sc->sc_dmas; p && KERNADDR(p) != temp_buffer; p = p->next)
;
if (p == NULL) {
Home |
Main Index |
Thread Index |
Old Index