linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"marek.vasut+renesas@gmail.com" <marek.vasut+renesas@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"bgolaszewski@baylibre.com" <bgolaszewski@baylibre.com>,
	"lee.jones@linaro.org" <lee.jones@linaro.org>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>
Cc: linux-power <linux-power@fi.rohmeurope.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Khiem Nguyen <khiem.nguyen.xt@renesas.com>,
	"linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2 04/10] regulator: bd9571mwv: Add BD9574MWF support
Date: Mon, 14 Dec 2020 08:22:26 +0000	[thread overview]
Message-ID: <TY2PR01MB369297B5977B36C9286C06CAD8C70@TY2PR01MB3692.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <9ca960355762528f3b91f7622aa799e831492f8d.camel@fi.rohmeurope.com>

Hello Matti-san,

> From: Vaittinen, Matti, Sent: Monday, December 14, 2020 4:13 PM
> 
> Hello Shimoda-san,
> 
> On Mon, 2020-12-14 at 04:57 +0000, Yoshihiro Shimoda wrote:
> > Hello Matti-san,
> >
> > > From: Vaittinen, Matti, Sent: Friday, December 11, 2020 9:34 PM
> > >
> > > Hello again Shimada-san,
> > >
> > > On Fri, 2020-12-11 at 20:27 +0900, Yoshihiro Shimoda wrote:
> > > > Add support for BD9574MWF which is silimar chip with BD9571MWV.
> > > > Note that BD9574MWF doesn't support AVS and VID.
> > >
> > > I'd like to understand what is VID?
> >
> > It seems reading some voltages from registers.
> > For example, BD9571 has "VD18_VID" register which
> > is prohibit to write. But, BD9574 doesn't have this
> > register. Also, the driver names "vid_ops",
> > so I described "VID" here. Perhaps, we should revise
> > the description to clear. (Please look "Updated description" in this
> > email.)
> 
> Thank you for detailed explanation. So as far as I understood - VID is
> a register which displays the current output voltage, right?

Yes.

> If I am
> not mistaken, this is different from register where (initial) voltage
> is set?

Yes. I checked on my environment (H3 Salvator-XS).

> > > > Signed-off-by: Yoshihiro Shimoda <
> > > > yoshihiro.shimoda.uh@renesas.com>
> > > > ---
> > > >  drivers/regulator/bd9571mwv-regulator.c | 10 ++++++++--
> > > >  1 file changed, 8 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/regulator/bd9571mwv-regulator.c
> > > > b/drivers/regulator/bd9571mwv-regulator.c
> > > > index 02120b0..041339b 100644
> > > > --- a/drivers/regulator/bd9571mwv-regulator.c
> > > > +++ b/drivers/regulator/bd9571mwv-regulator.c
> > > > @@ -1,6 +1,6 @@
> > > >  // SPDX-License-Identifier: GPL-2.0
> > > >  /*
> > > > - * ROHM BD9571MWV-M regulator driver
> > > > + * ROHM BD9571MWV-M and BD9574MWF-M regulator driver
> > > >   *
> > > >   * Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com
> > > > >
> > > >   *
> > > > @@ -9,6 +9,7 @@
> > > >   * NOTE: VD09 is missing
> > > >   */
> > > >
> > > > +#include <linux/mfd/rohm-generic.h>
> > > >  #include <linux/module.h>
> > > >  #include <linux/of.h>
> > > >  #include <linux/platform_device.h>
> > > > @@ -277,6 +278,7 @@ static int bd9571mwv_regulator_probe(struct
> > > > platform_device *pdev)
> > > >  	struct regulator_dev *rdev;
> > > >  	unsigned int val;
> > > >  	int i;
> > > > +	enum rohm_chip_type chip = platform_get_device_id(pdev)-
> > > > > driver_data;
> > > >
> > > >  	bdreg = devm_kzalloc(&pdev->dev, sizeof(*bdreg), GFP_KERNEL);
> > > >  	if (!bdreg)
> > > > @@ -292,6 +294,9 @@ static int bd9571mwv_regulator_probe(struct
> > > > platform_device *pdev)
> > > >  	config.regmap = bdreg->regmap;
> > > >
> > > >  	for (i = 0; i < ARRAY_SIZE(regulators); i++) {
> > > > +		/* BD9574MWF supports DVFS only */
> > > > +		if (chip == ROHM_CHIP_TYPE_BD9574 && regulators[i].id
> > > > != DVFS)
> > > > +			continue;
> > >
> > > Does this mean that reading VD09 voltage is not supported by
> > > driver?
> >
> > Yes. Also, reading VD{18,25,33} voltage are not supported.
> 
> I think that would be excellent comment here. Maybe something like: "We
> don't support voltage rails VD{09,18,25,33} by this driver on BD9574."

Thank you for the suggestion! I'll use this comment.

> > > (I
> > > assumed VD09 initial voltage can be set from eeprom(?) and read by
> > > driver - I may be wrong though). Perhaps it is worth mentioning in
> > > the
> > > commit message as a driver restriction?
> >
> > Yes, these voltage can be set from eeprom and read by driver.
> > So, I updated the description like below.
> >
> > -- Updated description --
> > Add support for BD9574MWF which is similar chip with BD9571MWV.
> > Note that since BD9574MWF doesn't have avs_ops and vid_ops
> > related registers, this driver avoids to use these registers
> > if BD9574MWF is used.
> > ------------------------
> 
> Thank you :) What I was after is that I would like to leave a note
> about 'what could be improved' or about what is the 'software
> limitation' here so that if anyone later needs the other voltage rails
> he would have a hint about what could be done.
> 
> Do you think mentioning that "the VD09 voltage could be read from PMIC
> but that is not supported by this commit" in commit message would be
> Ok?

I think OK because VD09 could be read from "BD9574MWF_VD09_VINIT"
register, but that is not supported but this commit.

> > > And just asking out of the curiosity - are the other voltage rails
> > > listed in data-sheet (VD18, DDR0, VD33, VD09 and LDO1,...,LDO4)
> > > set-up
> > > from DT as fixed-regulators? Any reason why they are not set-up
> > > here?
> >
> > TBH, I don't know why. Perhaps, the driver cannot read DDR0, LDO[1-4]
> > values?
> 
> I also think that all voltages can't be read. I was just thinking that
> it might make sense to always create the fixed regulators from PMIC
> driver - because if PMIC is used - then these voltage rails do exist.
> (This was just a question so that I could learn - not so much of a
> review comment.)
> 
> If you re-spin the series for other fixups - then I would appreciate
> some comment about omitting the rest of the voltage outputs.
> 
> Other than that - for what it is worth:
> 
> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>

Thank you very much for your review!

Best regards,
Yoshihiro Shimoda


  reply	other threads:[~2020-12-14  8:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 11:27 [PATCH v2 00/10] treewide: bd9571mwv: Add support for BD9574MWF Yoshihiro Shimoda
2020-12-11 11:27 ` [PATCH v2 01/10] dt-bindings: mfd: bd9571mwv: Document BD9574MWF Yoshihiro Shimoda
2020-12-11 11:27 ` [PATCH v2 02/10] mfd: rohm-generic: Add BD9571 and BD9574 Yoshihiro Shimoda
2020-12-11 11:36   ` Vaittinen, Matti
2020-12-11 11:27 ` [PATCH v2 03/10] regulator: bd9571mwv: rid of using struct bd9571mwv Yoshihiro Shimoda
2020-12-11 12:00   ` Vaittinen, Matti
2020-12-15 16:02     ` Geert Uytterhoeven
2020-12-15 16:13       ` Geert Uytterhoeven
2020-12-16  2:13         ` Yoshihiro Shimoda
2020-12-16  6:00           ` Vaittinen, Matti
2020-12-16  6:29             ` Yoshihiro Shimoda
2020-12-16  6:55               ` Vaittinen, Matti
2020-12-11 11:27 ` [PATCH v2 04/10] regulator: bd9571mwv: Add BD9574MWF support Yoshihiro Shimoda
2020-12-11 12:34   ` Vaittinen, Matti
2020-12-14  4:57     ` Yoshihiro Shimoda
2020-12-14  7:12       ` Vaittinen, Matti
2020-12-14  8:22         ` Yoshihiro Shimoda [this message]
2020-12-11 11:27 ` [PATCH v2 05/10] gpio: bd9571mwv: Use the SPDX license identifier Yoshihiro Shimoda
2020-12-15 16:08   ` Geert Uytterhoeven
2020-12-11 11:27 ` [PATCH v2 06/10] gpio: bd9571mwv: rid of using struct bd9571mwv Yoshihiro Shimoda
2020-12-11 12:42   ` Vaittinen, Matti
2020-12-11 11:27 ` [PATCH v2 07/10] gpio: bd9571mwv: Add BD9574MWF support Yoshihiro Shimoda
2020-12-11 12:55   ` Vaittinen, Matti
2020-12-14  5:11     ` Yoshihiro Shimoda
2020-12-11 11:27 ` [PATCH v2 08/10] mfd: bd9571mwv: Use the SPDX license identifier Yoshihiro Shimoda
2020-12-14 12:12   ` Yoshihiro Shimoda
2020-12-11 11:27 ` [PATCH v2 09/10] mfd: bd9571mwv: Make the driver more generic Yoshihiro Shimoda
2020-12-11 13:29   ` Vaittinen, Matti
2020-12-14  6:21     ` Yoshihiro Shimoda
2020-12-11 11:27 ` [PATCH v2 10/10] mfd: bd9571mwv: Add support for BD9574MWF Yoshihiro Shimoda

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=TY2PR01MB369297B5977B36C9286C06CAD8C70@TY2PR01MB3692.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=Matti.Vaittinen@fi.rohmeurope.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=khiem.nguyen.xt@renesas.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.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).