Module Name: src Committed By: jmcneill Date: Mon Oct 3 22:27:23 UTC 2011
Modified Files: src/sys/dev/i2c: files.i2c i2c.c src/sys/modules/iic: Makefile Added Files: src/sys/dev/i2c: i2c_subr.c Log Message: fix build for kernels with i2c host controller drivers but no iic(4) driver present To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/dev/i2c/files.i2c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/i2c/i2c.c cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/i2c_subr.c cvs rdiff -u -r1.2 -r1.3 src/sys/modules/iic/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/i2c/files.i2c diff -u src/sys/dev/i2c/files.i2c:1.43 src/sys/dev/i2c/files.i2c:1.44 --- src/sys/dev/i2c/files.i2c:1.43 Sun Oct 2 16:39:47 2011 +++ src/sys/dev/i2c/files.i2c Mon Oct 3 22:27:23 2011 @@ -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 @@ define i2cexec 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 Index: src/sys/dev/i2c/i2c.c diff -u src/sys/dev/i2c/i2c.c:1.34 src/sys/dev/i2c/i2c.c:1.35 --- src/sys/dev/i2c/i2c.c:1.34 Sun Oct 2 21:12:43 2011 +++ src/sys/dev/i2c/i2c.c Mon Oct 3 22:27:23 2011 @@ -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_smbus_intr_thread(void * 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) { Index: src/sys/modules/iic/Makefile diff -u src/sys/modules/iic/Makefile:1.2 src/sys/modules/iic/Makefile:1.3 --- src/sys/modules/iic/Makefile:1.2 Sun Oct 2 21:14:22 2011 +++ src/sys/modules/iic/Makefile Mon Oct 3 22:27:23 2011 @@ -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> Added files: Index: src/sys/dev/i2c/i2c_subr.c diff -u /dev/null src/sys/dev/i2c/i2c_subr.c:1.1 --- /dev/null Mon Oct 3 22:27:23 2011 +++ src/sys/dev/i2c/i2c_subr.c Mon Oct 3 22:27:23 2011 @@ -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; +}