Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c Make i2c_acquire_bus() / i2c_release_bus() real ...



details:   https://anonhg.NetBSD.org/src/rev/64336ce8288f
branches:  trunk
changeset: 446542:64336ce8288f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Dec 10 00:31:45 2018 +0000

description:
Make i2c_acquire_bus() / i2c_release_bus() real symbols.

diffstat:

 sys/dev/i2c/i2c_exec.c |  28 ++++++++++++++++++++++++++--
 sys/dev/i2c/i2cvar.h   |   9 +++------
 2 files changed, 29 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r 4135ec7689f1 -r 64336ce8288f sys/dev/i2c/i2c_exec.c
--- a/sys/dev/i2c/i2c_exec.c    Mon Dec 10 00:29:47 2018 +0000
+++ b/sys/dev/i2c/i2c_exec.c    Mon Dec 10 00:31:45 2018 +0000
@@ -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 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.
diff -r 4135ec7689f1 -r 64336ce8288f sys/dev/i2c/i2cvar.h
--- a/sys/dev/i2c/i2cvar.h      Mon Dec 10 00:29:47 2018 +0000
+++ b/sys/dev/i2c/i2cvar.h      Mon Dec 10 00:31:45 2018 +0000
@@ -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 @@
  * 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);
 



Home | Main Index | Thread Index | Old Index