Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c act8846_match: filter on ia_addr (device is expe...



details:   https://anonhg.NetBSD.org/src/rev/4b7ed8ddc31b
branches:  trunk
changeset: 322352:4b7ed8ddc31b
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Apr 30 20:26:09 2018 +0000

description:
act8846_match: filter on ia_addr (device is expected at 0x5a)

diffstat:

 sys/dev/i2c/act8846.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 04dd4c72b3c9 -r 4b7ed8ddc31b sys/dev/i2c/act8846.c
--- a/sys/dev/i2c/act8846.c     Mon Apr 30 09:59:09 2018 +0000
+++ b/sys/dev/i2c/act8846.c     Mon Apr 30 20:26:09 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: act8846.c,v 1.3 2015/01/02 21:55:31 jmcneill Exp $ */
+/* $NetBSD: act8846.c,v 1.4 2018/04/30 20:26:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 //#define ACT_DEBUG
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: act8846.c,v 1.3 2015/01/02 21:55:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: act8846.c,v 1.4 2018/04/30 20:26:09 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -148,7 +148,12 @@
 static int
 act8846_match(device_t parent, cfdata_t match, void *aux)
 {
-       return 1;
+       struct i2c_attach_args *ia = aux;
+
+       if (ia->ia_addr == 0x5a)
+               return 1;
+
+       return 0;
 }
 
 static void



Home | Main Index | Thread Index | Old Index