x
Loading
 Loading
Hello, Guest | Login | Register

The Inter-Integrated Circuit Protocol

Inter-Integrated Circuit, or “i2c” (pronounced “I squared C”), is a serial bus/protocol that’s widely used to interface hosts with devices such as EEPROM memory, audio codecs, and specialized chips that monitor parameters like temperature and power supply voltages. Take a look at how the kernel supports i2c.

Inter-Integrated Circuit, or “i2c” (pronounced “I squared C”), is a serial bus/protocol that’s widely used to interface hosts with devices such as EEPROM memory, audio codecs, and specialized chips that monitor parameters like temperature and power supply voltages. Additionally, i2c is widely used in embedded devices to communicate with real time clocks, with transmitters to link LCD monitors to a host, and so on. The System Management Bus (SMBus) is a subset of i2c.

i2c and SMBus are master-slave protocols, where communication takes place between a host adapter and client devices. The host adapter is usually part of the south bridge chipset on desktops and part of the microcontroller on embedded devices.

This month, let’s discuss how the Linux kernel supports i2c/SMBus host adapters and client devices, and let’s implement a very simple client device driver to access an SMBus memory device. To maximize the driver’s usefulness, we’ll use only the SMBus commands supported by the i2c core, yielding a driver that works with both SMBus and i2c adapters.

The Kernel i2c/SMBus Layer

Figure One illustrates the Linux i2c subsystem. The kernel i2c infrastructure consists of:

* The i2c-core, a code-base consisting of routines and data structures available to host adapter drivers and client drivers. The presence of common code in the core makes driver implementations easier. Additionally, the core provides a level of indirection that makes client drivers independent of the host adapter, allowing the client driver to work unchanged even if the device is…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Linux Scalability in a NUMA World
  2. Controlling Input/Output of Device Drivers
  3. Absolute Power
  4. Macro Magic: m4, Part One
  5. Advanced SCSI Drivers and Other Tales
Follow Linux Magazine
Rackspace