Module Name:    src
Committed By:   phx
Date:           Fri Oct 15 22:18:59 UTC 2010

Modified Files:
        src/sys/arch/macppc/dev: deq.c

Log Message:
Make it match the TAS3004 "codec" node, which is found on newer PowerBook G4s
(PowerBook5,6).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/macppc/dev/deq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/macppc/dev/deq.c
diff -u src/sys/arch/macppc/dev/deq.c:1.6 src/sys/arch/macppc/dev/deq.c:1.7
--- src/sys/arch/macppc/dev/deq.c:1.6	Sat Mar 14 21:04:11 2009
+++ src/sys/arch/macppc/dev/deq.c	Fri Oct 15 22:18:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: deq.c,v 1.6 2009/03/14 21:04:11 dsl Exp $	*/
+/*	$NetBSD: deq.c,v 1.7 2010/10/15 22:18:58 phx Exp $	*/
 
 /*-
  * Copyright (C) 2005 Michael Lorenz
@@ -32,7 +32,7 @@
  */
  
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.6 2009/03/14 21:04:11 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.7 2010/10/15 22:18:58 phx Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -59,14 +59,16 @@
 deq_match(device_t parent, struct cfdata *cf, void *aux)
 {
 	struct ki2c_confargs *ka = aux;
-	char compat[32];
+	char buf[32];
 	
-	if (strcmp(ka->ka_name, "deq") != 0)
-		return 0;
-
-	memset(compat, 0, sizeof(compat));
-	if(OF_getprop(ka->ka_node, "i2c-address", compat, sizeof(compat)))
-		return 1;
+	if (strcmp(ka->ka_name, "deq") == 0) {
+		if (OF_getprop(ka->ka_node, "i2c-address", buf, sizeof(buf)))
+			return 1;
+	} else if (strcmp(ka->ka_name, "codec") == 0) {
+		if (OF_getprop(ka->ka_node, "compatible", buf, sizeof(buf)))
+			if (strcmp(buf, "tas3004") == 0)
+				return 1;
+	}
 	return 0;
 }
 
@@ -83,5 +85,5 @@
 	sc->sc_parent = parent;
 	sc->sc_address = ka->ka_addr & 0xfe;
 	sc->sc_i2c = ka->ka_tag;
-	printf(" Apple Digital Equalizer, addr 0x%x\n", sc->sc_address);
+	aprint_normal(" Apple Digital Equalizer, addr 0x%x\n", sc->sc_address);
 }

Reply via email to