[alsa-devel] ASoC: regmap_config.max_register value wrong?

Sergej Sawazki ce3a at gmx.de
Mon May 25 22:46:25 CEST 2015


Dear all,

The following snippet is from the wm8741 codec driver. Shouldn't the
.max_register field be set to WM8741_REGISTER_COUNT-1 (10) instead of
WM8741_MAX_REGISTER (0x20)?

[...]
static const struct regmap_config wm8741_regmap = {
	.reg_bits = 7,
	.val_bits = 9,
	.max_register = WM8741_MAX_REGISTER,
[...]

WM8741_MAX_REGISTER is the address of the last register.
WM8741_REGISTER_COUNT is the number of registers.

The regmap_config documentation says: "@max_register: Optional,
specifies the maximum valid register index."

So it should be the *register index* and not the register address.
Do I understand it correctly?

Many thanks in advance.
Best regards,
Sergej


More information about the Alsa-devel mailing list