linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Hsin-hsiung Wang <hsin-hsiung.wang@mediatek.com>
To: Mark Brown <broonie@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	srv_heupstream@mediatek.com, devicetree@vger.kernel.org,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Sean Wang <sean.wang@mediatek.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org,
	Richard Fontana <rfontana@redhat.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Eddie Huang <eddie.huang@mediatek.com>,
	Lee Jones <lee.jones@linaro.org>,
	Allison Randal <allison@lohutok.net>,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH v4 07/10] regulator: mt6358: Add support for MT6358 regulator
Date: Tue, 6 Aug 2019 15:28:47 +0800	[thread overview]
Message-ID: <1565076527.23984.5.camel@mtksdaap41> (raw)
In-Reply-To: <20190805131030.GE6432@sirena.org.uk>

Hi Mark,

On Mon, 2019-08-05 at 14:10 +0100, Mark Brown wrote:
> On Mon, Aug 05, 2019 at 01:21:55PM +0800, Hsin-Hsiung Wang wrote:
> 
> > +static const u32 vmch_voltages[] = {
> > +	2900000, 3000000, 3300000,
> > +};
> 
> > +static const u32 vemc_voltages[] = {
> > +	2900000, 3000000, 3300000,
> > +};
> 
> Several of these tables appear to be identical.
> 
I will use the same voltage table in the next patch.

> > +static inline unsigned int mt6358_map_mode(unsigned int mode)
> > +{
> > +	return mode == MT6358_BUCK_MODE_AUTO ?
> > +		REGULATOR_MODE_NORMAL : REGULATOR_MODE_FAST;
> > +}
> 
> There is no need for this to be an inline and please write normal
> conditional statements to improve legibility.  There's other examples in
> the driver.
> 
will fix it in the next patch.

> > +static int mt6358_get_buck_voltage_sel(struct regulator_dev *rdev)
> > +{
> > +	int ret, regval;
> > +	struct mt6358_regulator_info *info = rdev_get_drvdata(rdev);
> > +
> > +	ret = regmap_read(rdev->regmap, info->da_vsel_reg, &regval);
> > +	if (ret != 0) {
> > +		dev_info(&rdev->dev,
> > +			 "Failed to get mt6358 Buck %s vsel reg: %d\n",
> > +			 info->desc.name, ret);
> 
> dev_err() for errors here and throughout the driver.
> 
will fix it in the next patch.

> > +		return ret;
> > +	}
> > +
> > +	ret = (regval >> info->da_vsel_shift) & info->da_vsel_mask;
> > +
> > +	return ret;
> > +}
> 
> This looks like a standard get_voltage_sel_regmap()?
> 
MT6358 has buck voltage status registers to show the actual output
voltage and the registers are different from the voltage setting
registers.
We want to get the actual voltage output, so we use the da_vsel status
registers here.

> > +err_mode:
> > +	if (ret != 0)
> > +		return ret;
> > +
> > +	return 0;
> 
> Or just return ret unconditionally?
will modify it to return ret unconditionally in the next patch.

Thanks a lot.
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-08-06  7:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05  5:21 [PATCH v4 00/10] Add Support for MediaTek PMIC MT6358 Hsin-Hsiung Wang
2019-08-05  5:21 ` [PATCH v4 01/10] mfd: mt6397: clean up code Hsin-Hsiung Wang
2019-08-05  5:21 ` [PATCH v4 02/10] mfd: mt6397: extract irq related code from core driver Hsin-Hsiung Wang
2019-08-12 10:59   ` Lee Jones
2019-08-05  5:21 ` [PATCH v4 03/10] mfd: mt6397: modify suspend/resume behavior Hsin-Hsiung Wang
2019-08-12 11:00   ` Lee Jones
2019-08-05  5:21 ` [PATCH v4 04/10] dt-bindings: mfd: Add compatible for the MediaTek MT6358 PMIC Hsin-Hsiung Wang
2019-08-05  5:21 ` [PATCH v4 05/10] regulator: Add document for MT6358 regulator Hsin-Hsiung Wang
2019-08-05  5:21 ` [PATCH v4 06/10] mfd: Add support for the MediaTek MT6358 PMIC Hsin-Hsiung Wang
2019-08-12 10:59   ` Lee Jones
2019-08-23  1:57     ` Hsin-hsiung Wang
2019-08-05  5:21 ` [PATCH v4 07/10] regulator: mt6358: Add support for MT6358 regulator Hsin-Hsiung Wang
2019-08-05 13:10   ` Mark Brown
2019-08-06  7:28     ` Hsin-hsiung Wang [this message]
2019-08-05  5:21 ` [PATCH v4 08/10] arm64: dts: mt6358: add PMIC MT6358 related nodes Hsin-Hsiung Wang
2019-08-05  5:21 ` [PATCH v4 09/10] rtc: mt6397: fix alarm register overwrite Hsin-Hsiung Wang
2019-08-05  7:24   ` Alexandre Belloni
2019-08-05  5:21 ` [PATCH v4 10/10] rtc: Add support for the MediaTek MT6358 RTC Hsin-Hsiung Wang
2019-08-05  7:23   ` Alexandre Belloni
2019-08-06 11:41     ` Ran Bi

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=1565076527.23984.5.camel@mtksdaap41 \
    --to=hsin-hsiung.wang@mediatek.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allison@lohutok.net \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eddie.huang@mediatek.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=rfontana@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=sean.wang@mediatek.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=tglx@linutronix.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;
as well as URLs for NNTP newsgroup(s).