Module Name:    src
Committed By:   macallan
Date:           Fri Sep 22 04:07:34 UTC 2017

Modified Files:
        src/sys/dev/i2c: sgsmix.c

Log Message:
use direct config


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/i2c/sgsmix.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/dev/i2c/sgsmix.c
diff -u src/sys/dev/i2c/sgsmix.c:1.7 src/sys/dev/i2c/sgsmix.c:1.8
--- src/sys/dev/i2c/sgsmix.c:1.7	Sat Nov 13 13:51:59 2010
+++ src/sys/dev/i2c/sgsmix.c	Fri Sep 22 04:07:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sgsmix.c,v 1.7 2010/11/13 13:51:59 uebayasi Exp $	*/
+/*	$NetBSD: sgsmix.c,v 1.8 2017/09/22 04:07:34 macallan Exp $	*/
 
 /*-
  * Copyright (C) 2005 Michael Lorenz.
@@ -31,7 +31,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sgsmix.c,v 1.7 2010/11/13 13:51:59 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgsmix.c,v 1.8 2017/09/22 04:07:34 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -82,14 +82,20 @@ sgsmix_match(device_t parent, cfdata_t c
 	int ret = -1;
 	uint8_t out[2] = {1, 0x20};
 
-	/* see if we can talk to something at address 0x8a */
-	if (args->ia_addr == 0x8a) {
-		iic_acquire_bus(args->ia_tag, 0);
-		ret = iic_exec(args->ia_tag, I2C_OP_WRITE, args->ia_addr,
-		    out, 2, NULL, 0, 0);
-		iic_release_bus(args->ia_tag, 0);
+	if (args->ia_name) {
+		if (strcmp(args->ia_name, "sgsmix") == 0)
+			return 1;
+	} else {
+		/* see if we can talk to something at address 0x8a */
+		if (args->ia_addr == 0x8a) {
+			iic_acquire_bus(args->ia_tag, 0);
+			ret = iic_exec(args->ia_tag, I2C_OP_WRITE, args->ia_addr,
+			    out, 2, NULL, 0, 0);
+			iic_release_bus(args->ia_tag, 0);
+		}
+		return (ret >= 0);
 	}
-	return (ret >= 0);
+	return 0;
 }
 
 static void

Reply via email to