October 2017
Intermediate to advanced
586 pages
14h 8m
English
The purpose of the regmap_multi_reg_write() function is writing multiple registers to the device. Its prototype looks as follows:
int regmap_multi_reg_write(struct regmap *map,
const struct reg_sequence *regs, int num_regs)
To see how to use that function, you need to know what struct reg_sequence is:
/**
* Register/value pairs for sequences of writes with an optional delay in
* microseconds to be applied after each write.
*
* @reg: Register address.
* @def: Register value.
* @delay_us: Delay to be applied after the register write in microseconds
*/
struct reg_sequence {
unsigned int reg;
unsigned int def;
unsigned int delay_us;
};
And this is how it is used:
static const struct reg_sequence foo_default_regs[] ...