[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2652d7df-b208-b88a-026e-5821d3d745ef@gmail.com>
Date: Wed, 5 Apr 2023 10:29:30 +0300
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Benjamin Bara <bbara93@...il.com>,
Support Opensource <support.opensource@...semi.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Lee Jones <lee@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Steve Twiss <stwiss.opensource@...semi.com>
Cc: DLG-Adam.Thomson.Opensource@...renesas.com,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
Benjamin Bara <benjamin.bara@...data.com>
Subject: Re: [PATCH v2 1/3] regulator: da9063: add voltage monitoring
registers
Hi Benjamin,
On 4/5/23 08:29, Benjamin Bara wrote:
> From: Benjamin Bara <benjamin.bara@...data.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@...data.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@...il.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! ~~
Powered by blists - more mailing lists