October 2017
Intermediate to advanced
586 pages
14h 8m
English
As we said earlier, the regmap API supports both SPI and I2C protocols. Depending on the protocol you need to support in your driver, you will have to call either regmap_init_i2c() or regmap_init_spi() in the probe function. To write a generic driver, regmap is the best choice.
The regmap API is generic and homogenous. Only the initialization changes between bus types. Other functions are the same.
Whether you allocated an I2C or SPI register map, it is freed with the regmap_exit function:
void regmap_exit(struct regmap *map)
This function simply releases ...