Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c tcakp_match: filter on ia_addr for ...



details:   https://anonhg.NetBSD.org/src/rev/90c77b5021f5
branches:  trunk
changeset: 318589:90c77b5021f5
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Apr 30 20:33:09 2018 +0000
description:
tcakp_match: filter on ia_addr for indirect config (device is expected at 0x34)

diffstat:

 sys/dev/i2c/tcakp.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r 9f180f062a46 -r 90c77b5021f5 sys/dev/i2c/tcakp.c
--- a/sys/dev/i2c/tcakp.c       Mon Apr 30 20:26:09 2018 +0000
+++ b/sys/dev/i2c/tcakp.c       Mon Apr 30 20:33:09 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcakp.c,v 1.5 2017/12/10 17:03:07 bouyer Exp $ */
+/* $NetBSD: tcakp.c,v 1.6 2018/04/30 20:33:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_fdt.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcakp.c,v 1.5 2017/12/10 17:03:07 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcakp.c,v 1.6 2018/04/30 20:33:09 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -317,9 +317,11 @@
 {
        struct i2c_attach_args *ia = aux;
 
-       if (ia->ia_name == NULL)
-               return 1;
-       else
+       if (ia->ia_name == NULL) {
+               if (ia->ia_addr == 0x34)
+                       return 1;
+               return 0;
+       } else
                return iic_compat_match(ia, tcakp_compats);
 }
 



Home | Main Index | Thread Index | Old Index