Date: Fri, 24 May 2002 18:18:57 -0700 From: "Michael W. Collette" <metrol@metrol.net> To: FreeBSD Mailing Lists <freebsd-mobile@FreeBSD.org> Subject: Thinkpad Sound Patch... MFC'd? Message-ID: <200205241818.57497.metrol@metrol.net>
next in thread | raw e-mail | index | archive | help
A little while back we were working on sound card related issues with Thinkpads. In my case, a T23. Along with applying changes based on the following pr's, I have also applied the patches following. So far, I'm all thumbs up over here. My sound card has been working very nicely after applying all this stuff, where without them it doesn't work at all. Just wondering what further confirmation might be required that I could assist with to get this MFC'd. It'd be nice to have future Thinkpad owners to not have to go through all this patching to get noise out. It'd also be nice for me to be able to make world without re-patching and all that. http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/36716 http://www.freebsd.org/cgi/query-pr.cgi?pr=i386/36972 And the following patch.... 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); -- "Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read." - Groucho Marx To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205241818.57497.metrol>