Re: XFree86 on Thinkpad T23

Colin Perkins <[email protected]>
Newsgroups gmane.os.freebsd.devel.mobile
Message-ID <[email protected]>
--> "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 [email protected]
with "unsubscribe freebsd-mobile" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.