Subject: snapper for recent powerbook G4
To: None <port-macppc@NetBSD.org>
From: Antoine Reilles <Antoine.Reilles@loria.fr>
List: port-macppc
Date: 02/10/2006 22:47:26
--w/VI3ydZO+RcZ3Ux
Content-Type: multipart/mixed; boundary="QXO0/MSS4VvK6f+D"
Content-Disposition: inline


--QXO0/MSS4VvK6f+D
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

Since now i can boot netbsd on my Powerbook 6,8 (12'), it become
interesting to get things working.

The audio is not working, but is reported by macosx as TAS 3004, so it
should be supported by snapper.

Thanks to macallan advices, i got snapper and deq to be recognized (see
attached diff). Then, adding=20
audio*  at audiobus?
to GENERIC (and removing the other audio* at XXXXX)
i get in dmesg:

=2E..
obio0 at pci1 dev 23 function 0: addr 0x80000000
=2E..
snapper0 at obio0 offset 0x0: irq 30,1,2
=2E..
deq0 at ki2c1 Apple Digital Equalizer, addr 6a
=2E..
audio at snapper0 not configured
=2E..

However, it does not play sound so far :-(
With=20
mplayer -ao oss i get:
Checking audio filter chain for 44100Hz/2ch/s16be ->
44100Hz/2ch/s16be...
AF_pre: 44100Hz/2ch/s16be
[AO OSS] audio_setup: Can't open audio device /dev/sound: Invalid
argument

while mplayer -ao sun
does not output any sound, neither outputs the progressbar

Best regards,
antoine

--QXO0/MSS4VvK6f+D
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="snapper.diff"
Content-Transfer-Encoding: quoted-printable

Index: sys/arch/macppc/dev/deq.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/arch/macppc/dev/deq.c,v
retrieving revision 1.2
diff -u -r1.2 deq.c
--- sys/arch/macppc/dev/deq.c	11 Dec 2005 12:18:03 -0000	1.2
+++ sys/arch/macppc/dev/deq.c	10 Feb 2006 21:43:57 -0000
@@ -64,12 +64,13 @@
 	struct ki2c_confargs *ka =3D aux;
 	char compat[32];
 =09
-	if (strcmp(ka->ka_name, "deq") !=3D 0)
+	if ((strcmp(ka->ka_name, "deq") !=3D 0) && (strcmp(ka->ka_name, "codec") =
!=3D 0))
 		return 0;
=20
 	memset(compat, 0, sizeof(compat));
 	if(OF_getprop(ka->ka_node, "i2c-address", compat, sizeof(compat)))
 		return 1;
+
 	return 0;
 }
=20
Index: sys/arch/macppc/dev/snapper.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/arch/macppc/dev/snapper.c,v
retrieving revision 1.8
diff -u -r1.8 snapper.c
--- sys/arch/macppc/dev/snapper.c	24 Dec 2005 22:45:35 -0000	1.8
+++ sys/arch/macppc/dev/snapper.c	10 Feb 2006 21:43:57 -0000
@@ -335,7 +335,7 @@
 snapper_match(struct device *parent, struct cfdata *match, void *aux)
 {
 	struct confargs *ca;
-	int soundbus, soundchip;
+	int soundbus, soundchip, soundcodec;
 	char compat[32];
=20
 	ca =3D aux;
@@ -349,10 +349,14 @@
 	bzero(compat, sizeof compat);
 	OF_getprop(soundchip, "compatible", compat, sizeof compat);
=20
-	if (strcmp(compat, "snapper") !=3D 0)
-		return 0;
+	if (strcmp(compat, "snapper") =3D=3D 0)
+		return 1;
=20
-	return 1;
+	if (OF_getprop(soundchip,"platform-tas-codec-ref",
+	    &soundcodec, sizeof soundcodec) =3D=3D sizeof soundcodec)
+		return 1;
+
+	return 0;
 }
=20
 void

--QXO0/MSS4VvK6f+D--

--w/VI3ydZO+RcZ3Ux
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)

iD8DBQFD7Qnu4VqmoGDE/mwRAoXnAJ9/MZSap4WZtBLmwAwJSH4nKqJTXgCeO7Ld
wgdALlGdMHcNt5qqQq6Qrgc=
=mB6J
-----END PGP SIGNATURE-----

--w/VI3ydZO+RcZ3Ux--