| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | I2C and SMBus | 
 | 2 | ============= | 
 | 3 |  | 
 | 4 | I2C (pronounce: I squared C) is a protocol developed by Philips. It is a  | 
| David Brownell | 4298cfc | 2007-05-01 23:26:31 +0200 | [diff] [blame] | 5 | slow two-wire protocol (variable speed, up to 400 kHz), with a high speed | 
 | 6 | extension (3.4 MHz).  It provides an inexpensive bus for connecting many | 
 | 7 | types of devices with infrequent or low bandwidth communications needs. | 
 | 8 | I2C is widely used with embedded systems.  Some systems use variants that | 
 | 9 | don't meet branding requirements, and so are not advertised as being I2C. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 |  | 
| David Brownell | 4298cfc | 2007-05-01 23:26:31 +0200 | [diff] [blame] | 11 | SMBus (System Management Bus) is based on the I2C protocol, and is mostly | 
 | 12 | a subset of I2C protocols and signaling.  Many I2C devices will work on an | 
 | 13 | SMBus, but some SMBus protocols add semantics beyond what is required to | 
 | 14 | achieve I2C branding.  Modern PC mainboards rely on SMBus.  The most common | 
 | 15 | devices connected through SMBus are RAM modules configured using I2C EEPROMs, | 
 | 16 | and hardware monitoring chips. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 |  | 
| David Brownell | 4298cfc | 2007-05-01 23:26:31 +0200 | [diff] [blame] | 18 | Because the SMBus is mostly a subset of the generalized I2C bus, we can | 
 | 19 | use its protocols on many I2C systems.  However, there are systems that don't | 
 | 20 | meet both SMBus and I2C electrical constraints; and others which can't | 
 | 21 | implement all the common SMBus protocol semantics or messages. | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 |  | 
 | 23 |  | 
 | 24 | Terminology | 
 | 25 | =========== | 
 | 26 |  | 
 | 27 | When we talk about I2C, we use the following terms: | 
 | 28 |   Bus    -> Algorithm | 
 | 29 |             Adapter | 
 | 30 |   Device -> Driver | 
 | 31 |             Client | 
 | 32 |  | 
 | 33 | An Algorithm driver contains general code that can be used for a whole class | 
| Jean Delvare | 45ccc6c | 2007-12-12 13:45:24 +0100 | [diff] [blame] | 34 | of I2C adapters. Each specific adapter driver either depends on one algorithm | 
 | 35 | driver, or includes its own implementation. | 
| David Brownell | 4298cfc | 2007-05-01 23:26:31 +0200 | [diff] [blame] | 36 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | A Driver driver (yes, this sounds ridiculous, sorry) contains the general | 
 | 38 | code to access some type of device. Each detected device gets its own | 
 | 39 | data in the Client structure. Usually, Driver and Client are more closely | 
 | 40 | integrated than Algorithm and Adapter. | 
 | 41 |  | 
| Jean Delvare | 45ccc6c | 2007-12-12 13:45:24 +0100 | [diff] [blame] | 42 | For a given configuration, you will need a driver for your I2C bus, and | 
 | 43 | drivers for your I2C devices (usually one driver for each device). | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 |  | 
| David Brownell | 4298cfc | 2007-05-01 23:26:31 +0200 | [diff] [blame] | 45 | At this time, Linux only operates I2C (or SMBus) in master mode; you can't | 
 | 46 | use these APIs to make a Linux system behave as a slave/device, either to | 
 | 47 | speak a custom protocol or to emulate some other device. |