From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Sergej Sawazki <ce3a@gmx.de>,
alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
dan.carpenter@oracle.com
Subject: Re: ASoC: regmap_config.max_register value wrong?
Date: Tue, 26 May 2015 09:14:46 +0100 [thread overview]
Message-ID: <20150526081446.GD31187@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <556415F2.4060809@metafoo.de>
On Tue, May 26, 2015 at 08:42:58AM +0200, Lars-Peter Clausen wrote:
> 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.
>
Yeah the documentation there is maybe not entirely clear here, but
the code is correct.
Thanks,
Charles
next prev parent reply other threads:[~2015-05-26 8:14 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
2015-05-26 8:14 ` Charles Keepax [this message]
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=20150526081446.GD31187@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ce3a@gmx.de \
--cc=dan.carpenter@oracle.com \
--cc=lars@metafoo.de \
/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