Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c Let kernel config override I2C_MAX_ADDR



details:   https://anonhg.NetBSD.org/src/rev/74283c97cef3
branches:  trunk
changeset: 804927:74283c97cef3
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Dec 07 00:32:35 2014 +0000

description:
Let kernel config override I2C_MAX_ADDR

diffstat:

 sys/dev/i2c/files.i2c |   3 ++-
 sys/dev/i2c/i2c.c     |  10 ++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diffs (50 lines):

diff -r caf658f92c61 -r 74283c97cef3 sys/dev/i2c/files.i2c
--- a/sys/dev/i2c/files.i2c     Sat Dec 06 21:53:55 2014 +0000
+++ b/sys/dev/i2c/files.i2c     Sun Dec 07 00:32:35 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.i2c,v 1.58 2014/10/15 05:11:36 uebayasi Exp $
+#      $NetBSD: files.i2c,v 1.59 2014/12/07 00:32:35 jmcneill Exp $
 
 obsolete defflag       opt_i2cbus.h            I2C_SCAN
 define i2cbus { }
@@ -9,6 +9,7 @@
 file   dev/i2c/i2c.c                           iic
 file   dev/i2c/i2c_exec.c                      iic | i2cbus | i2cexec
 file   dev/i2c/i2c_subr.c                      iic | i2cbus
+defparam opt_i2c.h                             I2C_MAX_ADDR
 
 # Common module for bit-bang'ing an I2C bus
 define i2c_bitbang
diff -r caf658f92c61 -r 74283c97cef3 sys/dev/i2c/i2c.c
--- a/sys/dev/i2c/i2c.c Sat Dec 06 21:53:55 2014 +0000
+++ b/sys/dev/i2c/i2c.c Sun Dec 07 00:32:35 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i2c.c,v 1.44 2014/07/25 08:10:37 dholland Exp $        */
+/*     $NetBSD: i2c.c,v 1.45 2014/12/07 00:32:35 jmcneill Exp $        */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -35,8 +35,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef _KERNEL_OPT
+#include "opt_i2c.h"
+#endif
+
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.44 2014/07/25 08:10:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.45 2014/12/07 00:32:35 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -55,7 +59,9 @@
 
 #include "locators.h"
 
+#ifndef I2C_MAX_ADDR
 #define I2C_MAX_ADDR   0x3ff   /* 10-bit address, max */
+#endif
 
 struct iic_softc {
        i2c_tag_t sc_tag;



Home | Main Index | Thread Index | Old Index