Skip to main content
Inter-Integrated Circuit (I²C) is a bidirectional, two-wire serial bus for short-distance communication between integrated circuits, where devices communicate using assigned bus addresses.

Overview

Key Characteristics

  • Bidirectional 2-wire serial bus (SDA + SCL)
  • 7-bit or 10-bit target addressing
  • Multi-controller mode support

Operating Modes

Communication Sequence

Packet structure: Start → Address frame (7/10-bit) → R/W bit → ACK/NACK → Data frames (8-bit) → Stop Signal rules:
  • SCL HIGH: SDA must remain stable
  • SCL LOW: SDA may change
  • Exception: START and STOP sequences may change SDA when SCL is HIGH

Transfer Modes by Subsystem

Interface Components

Device Tree Sources

APIs

Software Device Tree Configuration

Linux Device Tree Example

GPIO pinctrl:

QUPAC Access Control

Ensure the correct protocol is set in QUPAC_Access.c:

Configuration Steps

1

Enable kernel configurations

Edit kernel_platform/kernel/arch/arm64/configs/qcom_defconfig:
2

Enable I2C node in device tree

3

Compile and flash

Compile the kernel and device tree changes, then load images to the device.

Verification

Check Device Nodes

Use i2c-tools

Debugging

Enable Debug Logs

Enable I2C Tracing

Check Clock and GPIO

Troubleshooting

Symptoms: i2cdetect shows no devices; /dev/i2c-X not present.Check device tree status:
Check kernel module:
Check clock:
Check GPIO pinmux:
Symptoms:
Causes and fixes:
  • No pull-up resistors — Add 4.7 kΩ pull-ups on SDA/SCL
  • Slave not responding — Verify slave power and reset; check initialization sequence
  • Wrong clock frequency — Adjust clock-frequency in device tree
  • Bus stuck low — Power cycle devices or send clock pulses to release bus
Symptoms:
Steps:
  1. Identify board type: dmesg | grep "CDT Version"
  2. Locate platform ID in QUPAC_Access.xml
  3. Verify QUPAC_Access.c sets QUPV3_PROTOCOL_I2C, AC_HLOS, bAllowFifo=TRUE, bLoad=TRUE
  4. Rebuild TEE firmware if changes were made
Symptoms: Incorrect data read; intermittent failures.Fixes:
  • Reduce bus speed
  • Shorten wire length; add 22–100 Ω series resistors
  • Add decoupling capacitors near devices
  • Verify setup and hold times with oscilloscope
Symptoms:
Fixes: Verify CONFIG_QCOM_GPI_DMA=m; check DMA channel assignment; ensure DMA-safe memory alignment.To test without DMA:
Check runtime PM configuration, verify power domain dependencies, and add proper suspend/resume handlers.

Quick Diagnostic Commands

Resources