Source-Changes-HG archive

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

[src/trunk]: src/sys fix build for kernels with i2c host controller drivers b...



details:   https://anonhg.NetBSD.org/src/rev/90a7052efb2a
branches:  trunk
changeset: 770107:90a7052efb2a
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Oct 03 22:27:23 2011 +0000

description:
fix build for kernels with i2c host controller drivers but no iic(4)
driver present

diffstat:

 sys/dev/i2c/files.i2c    |   5 ++-
 sys/dev/i2c/i2c.c        |  14 +----------
 sys/dev/i2c/i2c_subr.c   |  54 ++++++++++++++++++++++++++++++++++++++++++++++++
 sys/modules/iic/Makefile |   4 +-
 4 files changed, 61 insertions(+), 16 deletions(-)

diffs (130 lines):

diff -r 058fac92f4d8 -r 90a7052efb2a sys/dev/i2c/files.i2c
--- a/sys/dev/i2c/files.i2c     Mon Oct 03 20:13:48 2011 +0000
+++ b/sys/dev/i2c/files.i2c     Mon Oct 03 22:27:23 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.i2c,v 1.43 2011/10/02 16:39:47 jmcneill Exp $
+#      $NetBSD: files.i2c,v 1.44 2011/10/03 22:27:23 jmcneill Exp $
 
 obsolete defflag       opt_i2cbus.h            I2C_SCAN
 define i2cbus { }
@@ -6,8 +6,9 @@
 
 device iic { [addr = -1], [size = -1] }
 attach iic at i2cbus
-file   dev/i2c/i2c.c                           iic | i2cbus
+file   dev/i2c/i2c.c                           iic
 file   dev/i2c/i2c_exec.c                      iic | i2cbus | i2cexec
+file   dev/i2c/i2c_subr.c                      iic | i2cbus
 
 # Common module for bit-bang'ing an I2C bus
 define i2c_bitbang
diff -r 058fac92f4d8 -r 90a7052efb2a sys/dev/i2c/i2c.c
--- a/sys/dev/i2c/i2c.c Mon Oct 03 20:13:48 2011 +0000
+++ b/sys/dev/i2c/i2c.c Mon Oct 03 22:27:23 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i2c.c,v 1.34 2011/10/02 21:12:43 jmcneill Exp $        */
+/*     $NetBSD: i2c.c,v 1.35 2011/10/03 22:27:23 jmcneill Exp $        */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.34 2011/10/02 21:12:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.35 2011/10/03 22:27:23 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -78,16 +78,6 @@
 static void    iic_fill_compat(struct i2c_attach_args*, const char*,
                        size_t, char **);
 
-int
-iicbus_print(void *aux, const char *pnp)
-{
-
-       if (pnp != NULL)
-               aprint_normal("iic at %s", pnp);
-
-       return UNCONF;
-}
-
 static int
 iic_print_direct(void *aux, const char *pnp)
 {
diff -r 058fac92f4d8 -r 90a7052efb2a sys/dev/i2c/i2c_subr.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/i2c/i2c_subr.c    Mon Oct 03 22:27:23 2011 +0000
@@ -0,0 +1,54 @@
+/*     $NetBSD: i2c_subr.c,v 1.1 2011/10/03 22:27:23 jmcneill Exp $    */
+
+/*
+ * Copyright (c) 2003 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed for the NetBSD Project by
+ *      Wasabi Systems, Inc.
+ * 4. The name of Wasabi Systems, Inc. may not be used to endorse
+ *    or promote products derived from this software without specific prior
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: i2c_subr.c,v 1.1 2011/10/03 22:27:23 jmcneill Exp $");
+
+#include <sys/param.h>
+#include <sys/device.h>
+
+#include <dev/i2c/i2cvar.h>
+
+int
+iicbus_print(void *aux, const char *pnp)
+{
+
+       if (pnp != NULL)
+               aprint_normal("iic at %s", pnp);
+
+       return UNCONF;
+}
diff -r 058fac92f4d8 -r 90a7052efb2a sys/modules/iic/Makefile
--- a/sys/modules/iic/Makefile  Mon Oct 03 20:13:48 2011 +0000
+++ b/sys/modules/iic/Makefile  Mon Oct 03 22:27:23 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 2011/10/02 21:14:22 jmcneill Exp $
+#      $NetBSD: Makefile,v 1.3 2011/10/03 22:27:23 jmcneill Exp $
 
 .include "../Makefile.inc"
 
@@ -6,6 +6,6 @@
 
 KMOD=          iic
 IOCONF=                iic.ioconf
-SRCS=          i2c.c i2c_bitbang.c
+SRCS=          i2c.c i2c_bitbang.c i2c_subr.c
 
 .include <bsd.kmodule.mk>



Home | Main Index | Thread Index | Old Index