Date: Tue, 11 Jun 2002 07:10:04 -0700 (PDT) From: Colin Perkins <csp@isi.edu> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/39146: sound fails to load on some Thinkpad models Message-ID: <200206111410.g5BEA4626624@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/39146; it has been noted by GNATS. From: Colin Perkins <csp@isi.edu> To: freebsd-gnats-submit@FreeBSD.org Cc: daniel@pelleg.org Subject: Re: kern/39146: sound fails to load on some Thinkpad models Date: Tue, 11 Jun 2002 10:02:50 -0400 Try the following (from Orion Hodson <hodson@freebsd.org>, I just tweaked it to work with reinit_mixer too) Colin Index: ac97.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97.c,v retrieving revision 1.5.2.9 diff -u -r1.5.2.9 ac97.c --- ac97.c 2002/04/22 15:49:35 1.5.2.9 +++ ac97.c 2002/06/11 13:58:31 @@ -373,7 +373,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); @@ -468,7 +479,17 @@ 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); Index: ac97.h =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97.h,v retrieving revision 1.3.2.7 diff -u -r1.3.2.7 ac97.h --- ac97.h 2002/04/22 15:49:35 1.3.2.7 +++ ac97.h 2002/06/11 13:58:54 @@ -56,6 +56,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) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206111410.g5BEA4626624>