From owner-freebsd-mobile Sun May 12 2:37:59 2002 Delivered-To: freebsd-mobile@freebsd.org Received: from purple.nge.isi.edu (csperkins.demon.co.uk [193.237.26.84]) by hub.freebsd.org (Postfix) with ESMTP id 179BC37B401 for ; Sun, 12 May 2002 02:37:50 -0700 (PDT) Received: from purple.nge.isi.edu (localhost.nge.isi.edu [127.0.0.1]) by purple.nge.isi.edu (8.12.2/8.12.2) with ESMTP id g4C9ajuD000836; Sun, 12 May 2002 05:36:45 -0400 (EDT) (envelope-from csp@purple.nge.isi.edu) Message-Id: <200205120936.g4C9ajuD000836@purple.nge.isi.edu> To: "Michael W. Collette" Cc: Troy , FreeBSD Mailing Lists , hodson@icir.org Subject: Re: XFree86 on Thinkpad T23 In-Reply-To: Your message of "Sat, 11 May 2002 17:12:17 PDT." <200205111712.17347.metrol@metrol.net> Date: Sun, 12 May 2002 10:36:45 +0100 From: Colin Perkins Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --> "Michael W. Collette" writes: >Troy wrote: >> 2) vi /usr/src/sys/dev/sound/pcm/ac97.c >> replace: >> DELAY (1000); >> with: >> DELAY (4000); > >The clouds parted, the angels wept, and my T23 played a wave!! One teensy >mistake here in your post threw me for a bit until I managed to dig up the >post mentioning the original fix. Missed it by one little decimal place :) > >DELAY (10000); > gets replaced with >DELAY (40000); > >That's the magic that makes it work. > >I should also note that in the original posts concerning this there was a >concern that this additional delay may have some interaction problems with >other devices. I'm personally WAY too early into this to tell one way or the >other. Just thought it worth mentioning that newer fixes may be a coming. Orion has a better fix which I've been testing. Try the enclosed, although there may be a newer version by now (this only fixes the first DELAY(10000), and needs the obvious fix for the other one). Colin Index: ac97.h =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97.h,v retrieving revision 1.3.2.5 diff -u -r1.3.2.5 ac97.h --- ac97.h 1 Aug 2001 03:41:03 -0000 1.3.2.5 +++ ac97.h 15 Apr 2002 15:21:41 -0000 @@ -47,6 +47,12 @@ #define AC97_REG_GEN 0x20 #define AC97_REG_3D 0x22 #define AC97_REG_POWER 0x26 +#define AC97_POWER_ADC (1 << 0) +#define AC97_POWER_DAC (1 << 1) +#define AC97_POWER_ANL (1 << 2) +#define AC97_POWER_REF (1 << 3) +#define AC97_POWER_STATUS (AC97_POWER_ADC | AC97_POWER_DAC | \ + AC97_POWER_REF | AC97_POWER_ANL ) #define AC97_REGEXT_ID 0x28 #define AC97_EXTCAP_VRA (1 << 0) #define AC97_EXTCAP_DRA (1 << 1) Index: ac97.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97.c,v retrieving revision 1.5.2.7 diff -u -r1.5.2.7 ac97.c --- ac97.c 12 Dec 2001 19:45:23 -0000 1.5.2.7 +++ ac97.c 15 Apr 2002 15:21:41 -0000 @@ -367,7 +367,18 @@ wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); wrcd(codec, AC97_REG_RESET, 0); - DELAY(100000); + for(i = 0; i < 500; i++) { + static u_int32_t os = 0; + u_int32_t s = rdcd(codec, AC97_REG_POWER) & AC97_POWER_STATUS; + if (s == AC97_POWER_STATUS) + break; + if (s != os) + device_printf(codec->dev, "status 0x%02x %d\n", s, i); + os = s; + DELAY(10000); + } + device_printf(codec->dev, "Ready at %d\n", i); + wrcd(codec, AC97_REG_POWER, (codec->flags & AC97_F_EAPD_INV)? 0x8000 : 0x0000); i = rdcd(codec, AC97_REG_RESET); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message