Module Name:    src
Committed By:   jmcneill
Date:           Sat Oct  7 20:31:48 UTC 2017

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

Log Message:
add direct config support


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/axp22x.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/axp22x.c
diff -u src/sys/dev/i2c/axp22x.c:1.2 src/sys/dev/i2c/axp22x.c:1.3
--- src/sys/dev/i2c/axp22x.c:1.2	Fri Nov 21 22:31:09 2014
+++ src/sys/dev/i2c/axp22x.c	Sat Oct  7 20:31:48 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: axp22x.c,v 1.2 2014/11/21 22:31:09 jmcneill Exp $ */
+/* $NetBSD: axp22x.c,v 1.3 2017/10/07 20:31:48 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: axp22x.c,v 1.2 2014/11/21 22:31:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: axp22x.c,v 1.3 2017/10/07 20:31:48 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -40,6 +40,11 @@ __KERNEL_RCSID(0, "$NetBSD: axp22x.c,v 1
 
 #include <dev/sysmon/sysmonvar.h>
 
+static const char *compatible[] = {
+	"x-powers,axp221",
+	NULL
+};
+
 #define AXP_TEMP_MON_REG	0x56	/* 2 bytes */
 
 struct axp22x_softc {
@@ -63,6 +68,11 @@ CFATTACH_DECL_NEW(axp22x, sizeof(struct 
 static int
 axp22x_match(device_t parent, cfdata_t match, void *aux)
 {
+	struct i2c_attach_args *ia = aux;
+
+	if (ia->ia_name != NULL)
+		return iic_compat_match(ia, compatible);
+
 	return 1;
 }
 

Reply via email to