[bootlin/training-materials updates] master: Improve details about i2c basic functions (bbc1484e)
Michael Opdenacker
michael.opdenacker at bootlin.com
Fri Mar 15 15:38:16 CET 2019
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/bbc1484ea128a4942886d673bbc789bb0a86e77d
>---------------------------------------------------------------
commit bbc1484ea128a4942886d673bbc789bb0a86e77d
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date: Fri Mar 15 15:38:16 2019 +0100
Improve details about i2c basic functions
Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>
>---------------------------------------------------------------
bbc1484ea128a4942886d673bbc789bb0a86e77d
slides/kernel-i2c/kernel-i2c.tex | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/slides/kernel-i2c/kernel-i2c.tex b/slides/kernel-i2c/kernel-i2c.tex
index 2573c52c..9f17c9dc 100644
--- a/slides/kernel-i2c/kernel-i2c.tex
+++ b/slides/kernel-i2c/kernel-i2c.tex
@@ -261,13 +261,15 @@ static int <driver>_remove(struct i2c_client *client)
functions to either send or receive data:
\begin{itemize}
\item
- \code{int i2c_master_send(struct i2c_client *client, const char *buf, int count);}\\Sends
- the contents of \code{buf} to the client.
+ \code{int i2c_master_send(const struct i2c_client *client, const char *buf, int count);}
+ \\Sends the contents of \code{buf} to the client.
\item
- \code{int i2c_master_recv(struct i2c_client *client, char *buf, int count);}\\Receives
- \code{count} bytes from the client, and store them into
+ \code{int i2c_master_recv(const struct i2c_client *client, char *buf, int count);}
+ \\Receives \code{count} bytes from the client, and store them into
\code{buf}.
\end{itemize}
+ Both functions a negative error number in case of failure, otherwise the
+ number of transmitted bytes.
\end{frame}
\begin{frame}{Communicating with the I2C device: message transfer}
@@ -276,7 +278,7 @@ static int <driver>_remove(struct i2c_client *client)
transaction in one direction:
\begin{itemize}
\item
- \code{int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num);}
+ \code{int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);}
\item The \kstruct{i2c_adapter} pointer can be found by using
\code{client->adapter}
\item The \kstruct{i2c_msg} structure defines the length, location, and
More information about the training-materials-updates
mailing list