Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c add direct config support
details: https://anonhg.NetBSD.org/src/rev/0d7df6c334ab
branches: trunk
changeset: 356674:0d7df6c334ab
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Oct 07 20:31:48 2017 +0000
description:
add direct config support
diffstat:
sys/dev/i2c/axp22x.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diffs (42 lines):
diff -r 1c5abc051a9a -r 0d7df6c334ab sys/dev/i2c/axp22x.c
--- a/sys/dev/i2c/axp22x.c Sat Oct 07 20:18:16 2017 +0000
+++ b/sys/dev/i2c/axp22x.c Sat Oct 07 20:31:48 2017 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
#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 @@
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;
}
Home |
Main Index |
Thread Index |
Old Index