From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Benjamin Bara <bbara93@gmail.com>,
Support Opensource <support.opensource@diasemi.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Lee Jones <lee@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Steve Twiss <stwiss.opensource@diasemi.com>
Cc: DLG-Adam.Thomson.Opensource@dm.renesas.com,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Benjamin Bara <benjamin.bara@skidata.com>
Subject: Re: [PATCH v2 1/3] regulator: da9063: add voltage monitoring registers
Date: Wed, 5 Apr 2023 10:29:30 +0300 [thread overview]
Message-ID: <2652d7df-b208-b88a-026e-5821d3d745ef@gmail.com> (raw)
In-Reply-To: <20230403-da9063-disable-unused-v2-1-2f1bd2a2434a@skidata.com>
Hi Benjamin,
On 4/5/23 08:29, Benjamin Bara wrote:
> From: Benjamin Bara <benjamin.bara@skidata.com>
>
> Add the definitions for the registers responsible for voltage
> monitoring. Add a voltage monitor enable bitfield per regulator.
>
> Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
> ---
> drivers/regulator/da9063-regulator.c | 29 +++++++++++++++++++++++++++++
> include/linux/mfd/da9063/registers.h | 23 +++++++++++++++++++++++
> 2 files changed, 52 insertions(+)
>
> diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
> index 82f52a2a031a..1c720fc595b3 100644
> --- a/drivers/regulator/da9063-regulator.c
> +++ b/drivers/regulator/da9063-regulator.c
...
>
> @@ -932,6 +955,12 @@ static int da9063_regulator_probe(struct platform_device *pdev)
> if (IS_ERR(regl->suspend_sleep))
> return PTR_ERR(regl->suspend_sleep);
> }
> + if (regl->info->vmon.reg) {
Just a very minor thing - wouldn't this check be better as:
if (regl->info->vmon.mask) ?
We may have device(s) where 0 is a valid reg. However, mask 0 is
probably not making sense - unless I misunderstand something?
Well, I guess the reg 0 is not valid for vmon on currently supported
ICs, and it probably is unlikely that would happen on a future device
either. Still, treating register 0 as 'not initialized' always feels a
tad bad for me if it can be avoided. So, perhaps consider this if you
re-spin for some other reason - but I don't think this is by any means
crucial.
FWIW:
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
> + regl->vmon = devm_regmap_field_alloc(&pdev->dev,
> + da9063->regmap, regl->info->vmon);
> + if (IS_ERR(regl->vmon))
> + return PTR_ERR(regl->vmon);
> + }
>
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
next prev parent reply other threads:[~2023-04-05 7:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 5:29 [PATCH v2 0/3] regulator: da9063: disable unused voltage monitors Benjamin Bara
2023-04-05 5:29 ` [PATCH v2 1/3] regulator: da9063: add voltage monitoring registers Benjamin Bara
2023-04-05 7:29 ` Matti Vaittinen [this message]
2023-04-05 8:04 ` Benjamin Bara
2023-04-05 5:29 ` [PATCH v2 2/3] regulator: da9063: implement basic XVP setter Benjamin Bara
2023-04-05 7:42 ` Matti Vaittinen
2023-04-05 10:52 ` Mark Brown
2023-04-05 14:08 ` Benjamin Bara
2023-04-05 5:29 ` [PATCH v2 3/3] dt-bindings: mfd: dlg,da9063: document XVP Benjamin Bara
2023-04-05 5:33 ` Krzysztof Kozlowski
2023-04-05 7:43 ` Matti Vaittinen
2023-04-05 15:30 ` [PATCH v2 0/3] regulator: da9063: disable unused voltage monitors Lee Jones
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=2652d7df-b208-b88a-026e-5821d3d745ef@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=DLG-Adam.Thomson.Opensource@dm.renesas.com \
--cc=bbara93@gmail.com \
--cc=benjamin.bara@skidata.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=stwiss.opensource@diasemi.com \
--cc=support.opensource@diasemi.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;
as well as URLs for NNTP newsgroup(s).