Introduction to I2C and SMBus¶
I²C (pronounce: I squared C and written I2C in the kernel documentation) isa protocol developed by Philips. It is a slow two-wire protocol (variablespeed, up to 400 kHz), with a high speed extension (3.4 MHz). It providesan inexpensive bus for connecting many types of devices with infrequent orlow bandwidth communications needs. I2C is widely used with embeddedsystems. Some systems use variants that don’t meet branding requirements,and so are not advertised as being I2C but come under different names,e.g. TWI (Two Wire Interface), IIC.
The official I2C specification is the“I2C-bus specification and usermanual” (UM10204)published by NXP Semiconductors.
SMBus (System Management Bus) is based on the I2C protocol, and is mostlya subset of I2C protocols and signaling. Many I2C devices will work on anSMBus, but some SMBus protocols add semantics beyond what is required toachieve I2C branding. Modern PC mainboards rely on SMBus. The most commondevices connected through SMBus are RAM modules configured using I2C EEPROMs,and hardware monitoring chips.
Because the SMBus is mostly a subset of the generalized I2C bus, we canuse its protocols on many I2C systems. However, there are systems that don’tmeet both SMBus and I2C electrical constraints; and others which can’timplement all the common SMBus protocol semantics or messages.
Terminology¶
Using the terminology from the official documentation, the I2C bus connectsone or moremaster chips and one or moreslave chips.
Simple I2C bus
Amaster chip is a node that starts communications with slaves. In theLinux kernel implementation it is called anadapter or bus. Adapterdrivers are in thedrivers/i2c/busses/ subdirectory.
Analgorithm contains general code that can be used to implement awhole class of I2C adapters. Each specific adapter driver either depends onan algorithm driver in thedrivers/i2c/algos/ subdirectory, or includesits own implementation.
Aslave chip is a node that responds to communications when addressedby the master. In Linux it is called aclient. Client drivers are keptin a directory specific to the feature they provide, for exampledrivers/media/gpio/ for GPIO expanders anddrivers/media/i2c/ forvideo-related chips.
For the example configuration in figure, you will need a driver for yourI2C adapter, and drivers for your I2C devices (usually one driver for eachdevice).