[bootlin/training-materials updates] master: kernel: i2c: Clarify why we should use the SMBus protocol (a0981a5a)
Miquel Raynal
miquel.raynal at bootlin.com
Mon Nov 15 10:47:12 CET 2021
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/a0981a5afbe4b8bf2cdfb0651945c7c90df86316
>---------------------------------------------------------------
commit a0981a5afbe4b8bf2cdfb0651945c7c90df86316
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date: Mon Nov 15 10:37:56 2021 +0100
kernel: i2c: Clarify why we should use the SMBus protocol
Using SMBus commands is not mandatory but preferred (see the kdoc) and
only when talking to an SMBus device, so make this clear. While at it,
clarify the reason for that choice: SMBus commands will be translated
into I2C commands by the core if needed, but the opposite is not
possible.
Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
>---------------------------------------------------------------
a0981a5afbe4b8bf2cdfb0651945c7c90df86316
slides/kernel-i2c/kernel-i2c.tex | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/slides/kernel-i2c/kernel-i2c.tex b/slides/kernel-i2c/kernel-i2c.tex
index 80bcbbe9..5a459b85 100644
--- a/slides/kernel-i2c/kernel-i2c.tex
+++ b/slides/kernel-i2c/kernel-i2c.tex
@@ -362,10 +362,14 @@ From \kfile{drivers/input/touchscreen/st1232.c}
\item It focuses on devices power management and defines a standard
set of transactions, such as reading/writing from a register-like
interface.
- \item Linux provides SMBus functions that {\em should be used}
- instead of the raw API, if the I2C device supports this
- standard type of transactions. The driver can then be used on both
- SMBus and I2C adapters (can't use I2C commands on SMBus adapters).
+ \item Linux provides SMBus functions that should preferably be used
+ instead of the raw API with devices supporting SMBus.
+ \item Such a driver will be usable with both SMBus and I2C adapters
+ \begin{itemize}
+ \item SMBus adapters cannot send raw I2C commands
+ \item I2C adapters will receive an SMBus-like command crafted by the
+ core
+ \end{itemize}
\item Example: the \kfunc{i2c_smbus_read_byte_data} function allows
to read one byte of data from a device register.
\begin{itemize}
More information about the training-materials-updates
mailing list