summary.rst 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. =============================
  2. Introduction to I2C and SMBus
  3. =============================
  4. I²C (pronounce: I squared C and written I2C in the kernel documentation) is
  5. a protocol developed by Philips. It is a slow two-wire protocol (variable
  6. speed, up to 400 kHz), with a high speed extension (3.4 MHz). It provides
  7. an inexpensive bus for connecting many types of devices with infrequent or
  8. low bandwidth communications needs. I2C is widely used with embedded
  9. systems. Some systems use variants that don't meet branding requirements,
  10. and so are not advertised as being I2C but come under different names,
  11. e.g. TWI (Two Wire Interface), IIC.
  12. The latest official I2C specification is the `"I2C-bus specification and user
  13. manual" (UM10204) <https://www.nxp.com/webapp/Download?colCode=UM10204>`_
  14. published by NXP Semiconductors. However, you need to log-in to the site to
  15. access the PDF. An older version of the specification (revision 6) is archived
  16. `here <https://web.archive.org/web/20210813122132/https://www.nxp.com/docs/en/user-guide/UM10204.pdf>`_.
  17. SMBus (System Management Bus) is based on the I2C protocol, and is mostly
  18. a subset of I2C protocols and signaling. Many I2C devices will work on an
  19. SMBus, but some SMBus protocols add semantics beyond what is required to
  20. achieve I2C branding. Modern PC mainboards rely on SMBus. The most common
  21. devices connected through SMBus are RAM modules configured using I2C EEPROMs,
  22. and hardware monitoring chips.
  23. Because the SMBus is mostly a subset of the generalized I2C bus, we can
  24. use its protocols on many I2C systems. However, there are systems that don't
  25. meet both SMBus and I2C electrical constraints; and others which can't
  26. implement all the common SMBus protocol semantics or messages.
  27. Terminology
  28. ===========
  29. Using the terminology from the official documentation, the I2C bus connects
  30. one or more *master* chips and one or more *slave* chips.
  31. .. kernel-figure:: i2c_bus.svg
  32. :alt: Simple I2C bus with one master and 3 slaves
  33. Simple I2C bus
  34. A **master** chip is a node that starts communications with slaves. In the
  35. Linux kernel implementation it is called an **adapter** or bus. Adapter
  36. drivers are in the ``drivers/i2c/busses/`` subdirectory.
  37. An **algorithm** contains general code that can be used to implement a
  38. whole class of I2C adapters. Each specific adapter driver either depends on
  39. an algorithm driver in the ``drivers/i2c/algos/`` subdirectory, or includes
  40. its own implementation.
  41. A **slave** chip is a node that responds to communications when addressed
  42. by the master. In Linux it is called a **client**. Client drivers are kept
  43. in a directory specific to the feature they provide, for example
  44. ``drivers/media/gpio/`` for GPIO expanders and ``drivers/media/i2c/`` for
  45. video-related chips.
  46. For the example configuration in figure, you will need a driver for your
  47. I2C adapter, and drivers for your I2C devices (usually one driver for each
  48. device).