Documentation/i2c/smbus-protocol.rst

Source file repositories/reference/linux-study-clean/Documentation/i2c/smbus-protocol.rst

File Facts

System
Linux kernel
Corpus path
Documentation/i2c/smbus-protocol.rst
Extension
.rst
Size
9996 bytes
Lines
325
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

==================
The SMBus Protocol
==================

The following is a summary of the SMBus protocol. It applies to
all revisions of the protocol (1.0, 1.1, and 2.0).
Certain protocol features which are not supported by
this package are briefly described at the end of this document.

Some adapters understand only the SMBus (System Management Bus) protocol,
which is a subset from the I2C protocol. Fortunately, many devices use
only the same subset, which makes it possible to put them on an SMBus.

If you write a driver for some I2C device, please try to use the SMBus
commands if at all possible (if the device uses only that subset of the
I2C protocol). This makes it possible to use the device driver on both
SMBus adapters and I2C adapters (the SMBus command set is automatically
translated to I2C on I2C adapters, but plain I2C commands can not be
handled at all on most pure SMBus adapters).

Below is a list of SMBus protocol operations, and the functions executing
them.  Note that the names used in the SMBus protocol specifications usually
don't match these function names.  For some of the operations which pass a
single data byte, the functions using SMBus protocol operation names execute
a different protocol operation entirely.

Each transaction type corresponds to a functionality flag. Before calling a
transaction function, a device driver should always check (just once) for
the corresponding functionality flag to ensure that the underlying I2C
adapter supports the transaction in question. See
Documentation/i2c/functionality.rst for the details.


Key to symbols
==============

=============== =============================================================
S               Start condition
Sr              Repeated start condition, used to switch from write to
                read mode.
P               Stop condition
Rd/Wr (1 bit)   Read/Write bit. Rd equals 1, Wr equals 0.
A, NA (1 bit)   Acknowledge (ACK) and Not Acknowledge (NACK) bit
Addr  (7 bits)  I2C 7 bit address. Note that this can be expanded to
                get a 10 bit I2C address.
Comm  (8 bits)  Command byte, a data byte which often selects a register on
                the device.
Data  (8 bits)  A plain data byte. DataLow and DataHigh represent the low and
                high byte of a 16 bit word.
Count (8 bits)  A data byte containing the length of a block operation.

[..]            Data sent by I2C device, as opposed to data sent by the host
                adapter.
=============== =============================================================


SMBus Quick Command
===================

This sends a single bit to the device, at the place of the Rd/Wr bit::

  S Addr Rd/Wr [A] P

Functionality flag: I2C_FUNC_SMBUS_QUICK


SMBus Receive Byte
==================

Implemented by i2c_smbus_read_byte()

Annotation

Implementation Notes