brintos

brintos / linux-shallow public Read only

0
0
Text · 2.3 KiB · 7582c07 Raw
49 lines · plain
1I\ :sup:`2`\ C and SMBus Subsystem2==================================3 4I\ :sup:`2`\ C (or without fancy typography, "I2C") is an acronym for5the "Inter-IC" bus, a simple bus protocol which is widely used where low6data rate communications suffice. Since it's also a licensed trademark,7some vendors use another name (such as "Two-Wire Interface", TWI) for8the same bus. I2C only needs two signals (SCL for clock, SDA for data),9conserving board real estate and minimizing signal quality issues. Most10I2C devices use seven bit addresses, and bus speeds of up to 400 kHz;11there's a high speed extension (3.4 MHz) that's not yet found wide use.12I2C is a multi-master bus; open drain signaling is used to arbitrate13between masters, as well as to handshake and to synchronize clocks from14slower clients.15 16The Linux I2C programming interfaces support the master side of bus17interactions and the slave side. The programming interface is18structured around two kinds of driver, and two kinds of device. An I2C19"Adapter Driver" abstracts the controller hardware; it binds to a20physical device (perhaps a PCI device or platform_device) and exposes a21:c:type:`struct i2c_adapter <i2c_adapter>` representing each22I2C bus segment it manages. On each I2C bus segment will be I2C devices23represented by a :c:type:`struct i2c_client <i2c_client>`.24Those devices will be bound to a :c:type:`struct i2c_driver25<i2c_driver>`, which should follow the standard Linux driver model. There26are functions to perform various I2C protocol operations; at this writing27all such functions are usable only from task context.28 29The System Management Bus (SMBus) is a sibling protocol. Most SMBus30systems are also I2C conformant. The electrical constraints are tighter31for SMBus, and it standardizes particular protocol messages and idioms.32Controllers that support I2C can also support most SMBus operations, but33SMBus controllers don't support all the protocol options that an I2C34controller will. There are functions to perform various SMBus protocol35operations, either using I2C primitives or by issuing SMBus commands to36i2c_adapter devices which don't support those I2C operations.37 38.. kernel-doc:: include/linux/i2c.h39   :internal:40 41.. kernel-doc:: drivers/i2c/i2c-boardinfo.c42   :functions: i2c_register_board_info43 44.. kernel-doc:: drivers/i2c/i2c-core-base.c45   :export:46 47.. kernel-doc:: drivers/i2c/i2c-core-smbus.c48   :export:49