From: Lars-Peter Clausen <lars@metafoo.de>
To: Sergej Sawazki <ce3a@gmx.de>, Mark Brown <broonie@kernel.org>,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
dan.carpenter@oracle.com
Cc: alsa-devel@alsa-project.org
Subject: Re: ASoC: regmap_config.max_register value wrong?
Date: Tue, 26 May 2015 08:42:58 +0200 [thread overview]
Message-ID: <556415F2.4060809@metafoo.de> (raw)
In-Reply-To: <55638A21.50208@gmx.de>
On 05/25/2015 10:46 PM, Sergej Sawazki wrote:
> 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?
What the documentation means is the index into the physical register map,
which is the address. So the code is probably correct.
next prev parent reply other threads:[~2015-05-26 6:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-25 20:46 ASoC: regmap_config.max_register value wrong? Sergej Sawazki
2015-05-26 6:42 ` Lars-Peter Clausen [this message]
2015-05-26 8:14 ` Charles Keepax
2015-05-27 17:05 ` Sergej Sawazki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=556415F2.4060809@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ce3a@gmx.de \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=dan.carpenter@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox