Chapter 9. Regmap API - A Register Map Abstraction
Before the regmap API was developed, there was redundant code for the device drivers dealing with SPI core, I2C core, or both. The principle was the same: accessing the register for read/write operations. The following diagram shows how either the SPI or I2C API were standalone before regmap was introduced to the kernel:

SPI and I2C subsystems before regmap
The regmap API was introduced in version 3.1 of the kernel, to factorize and unify the way kernel developers access SPI/I2C devices. It is then just a matter of how to initialize and configure a regmap, and process any read/write/modify operation fluently, whether it is SPI or I2C:

SPI and I2C subsystems after regmap
This chapter will walk through the regmap framework as follows:
- Introducing the main data structures used in the regmap framework
- Walking through regmap configuration
- Accessing devices using the regmap API
- Introducing the regmap caching system
- Providing a complete driver that summarizes...