Module Name:    src
Committed By:   thorpej
Date:           Mon Dec 10 00:31:45 UTC 2018

Modified Files:
        src/sys/dev/i2c: i2c_exec.c i2cvar.h

Log Message:
Make i2c_acquire_bus() / i2c_release_bus() real symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/i2c_exec.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/i2c/i2cvar.h

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/i2c_exec.c
diff -u src/sys/dev/i2c/i2c_exec.c:1.10 src/sys/dev/i2c/i2c_exec.c:1.11
--- src/sys/dev/i2c/i2c_exec.c:1.10	Sat Mar  7 14:16:51 2015
+++ src/sys/dev/i2c/i2c_exec.c	Mon Dec 10 00:31:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c_exec.c,v 1.10 2015/03/07 14:16:51 jmcneill Exp $	*/
+/*	$NetBSD: i2c_exec.c,v 1.11 2018/12/10 00:31:45 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c_exec.c,v 1.10 2015/03/07 14:16:51 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c_exec.c,v 1.11 2018/12/10 00:31:45 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -54,6 +54,30 @@ static uint8_t	iic_smbus_pec(int, uint8_
 static int	i2cexec_modcmd(modcmd_t, void *);
 
 /*
+ * iic_acquire_bus:
+ *
+ *	Acquire the I2C bus for use by a client.
+ */
+int
+iic_acquire_bus(i2c_tag_t tag, int flags)
+{
+
+	return (*tag->ic_acquire_bus)(tag->ic_cookie, flags);
+}
+
+/*
+ * iic_release_bus:
+ *
+ *	Relese the I2C bus, allowing another client to use it.
+ */
+void
+iic_release_bus(i2c_tag_t tag, int flags)
+{
+
+	(*tag->ic_release_bus)(tag->ic_cookie, flags);
+}
+
+/*
  * iic_exec:
  *
  *	Simplified I2C client interface engine.

Index: src/sys/dev/i2c/i2cvar.h
diff -u src/sys/dev/i2c/i2cvar.h:1.17 src/sys/dev/i2c/i2cvar.h:1.18
--- src/sys/dev/i2c/i2cvar.h:1.17	Tue Jun 26 06:34:55 2018
+++ src/sys/dev/i2c/i2cvar.h	Mon Dec 10 00:31:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2cvar.h,v 1.17 2018/06/26 06:34:55 thorpej Exp $	*/
+/*	$NetBSD: i2cvar.h,v 1.18 2018/12/10 00:31:45 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -208,11 +208,8 @@ bool	iic_use_direct_match(const struct i
  * Simplified API for clients of the i2c framework.  Definitions
  * in <dev/i2c/i2c_io.h>.
  */
-#define	iic_acquire_bus(ic, flags)					\
-	(*(ic)->ic_acquire_bus)((ic)->ic_cookie, (flags))
-#define	iic_release_bus(ic, flags)					\
-	(*(ic)->ic_release_bus)((ic)->ic_cookie, (flags))
-
+int	iic_acquire_bus(i2c_tag_t, int);
+void	iic_release_bus(i2c_tag_t, int);
 int	iic_exec(i2c_tag_t, i2c_op_t, i2c_addr_t, const void *,
 	    size_t, void *, size_t, int);
 

Reply via email to