Gabriel Jacob Perin
← Back to blog

The iio_simple_dummy Anatomy

2026-04-01

Summary:

This post describes the anatomy of the iio_simple_dummy driver, a toy driver in the Linux Industrial I/O subsystem used to help developers understand how IIO sensor drivers are structured. The tutorial explains the role of struct iio_chan_spec in representing device channels, showing how different fields define channel type, indexing, shared and separate attributes, scan layout for buffered data, and optional event support. It uses the dummy driver as a concrete example to introduce common IIO concepts such as voltage, differential, and modified acceleration channels.

The tutorial also examines the main data access paths of the driver through the iio_dummy_read_raw() and iio_dummy_write_raw() functions. It shows how the IIO core uses the channel specification and the requested mask to identify which attribute is being accessed, and how the driver reads from or writes to its internal state accordingly. In this way, the post provides an introduction to both the static channel description and the runtime read/write logic that appear in IIO drivers.