linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Hyeung Dong Jeong <eric.jeong.opensource@diasemi.com>
To: Mark Brown <broonie@kernel.org>,
	Eric Hyeung Dong Jeong <eric.jeong.opensource@diasemi.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	DEVICETREE <devicetree@vger.kernel.org>,
	LINUX-KERNEL <linux-kernel@vger.kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Support Opensource <Support.Opensource@diasemi.com>
Subject: RE: [PATCH V1 3/3] regulator: slg51000: add slg51000 regulator driver
Date: Wed, 17 Apr 2019 11:25:29 +0000	[thread overview]
Message-ID: <VE1PR10MB288069C2FC4B6F79AE8F26A891250@VE1PR10MB2880.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20190416152448.GC4834@sirena.org.uk>

On Wednesday, April 17, 2019 12:25 AM +0900, Mark Brown wrote:
 
> On Tue, Apr 16, 2019 at 01:37:27PM +0900, Eric Jeong wrote:
> 
> > +static int slg51000_regulator_is_enabled(struct regulator_dev *rdev)
> > +{
> > +	struct slg51000 *chip = rdev_get_drvdata(rdev);
> > +	int ret, id = rdev_get_id(rdev);
> > +	unsigned int state;
> > +
> > +	ret = regmap_read(chip->regmap, es_reg[id].sreg, &state);
> > +	if (ret < 0) {
> > +		dev_err(chip->dev, "Failed to read status register(%d)\n",
> > +			ret);
> > +		return ret;
> > +	}
> > +
> > +	if (!(state & SLG51000_STA_ILIM_FLAG_MASK) &&
> > +	    (state & SLG51000_STA_VOUT_OK_FLAG_MASK))
> > +		return 1;
> > +	else
> > +		return 0;
> 
> This looks like it should be a get_status() operation as it's reading
> status bits rather than the command we sent to the device - for that
> just use regulator_is_enabled_regmap().

I thought that it needs to return current status of a regulator when the function is called.
I am wondering that the *is_enabled()* function is just to check 
If a regulator has been turned on or not rather than getting current status of the regulator.

Thanks
Eric

  reply	other threads:[~2019-04-17 11:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  4:37 [PATCH V1 0/3] slg51000: regulator driver submission Eric Jeong
2019-04-16  4:37 ` [PATCH V1 1/3] MAINTAINERS: slg51000 updates to the Dialog Semiconductor search terms Eric Jeong
2019-04-16  4:37 ` [PATCH V1 2/3] Documentation: devicetree: regulator: add binding for slg51000 Eric Jeong
2019-04-16 15:25   ` Mark Brown
2019-04-16  4:37 ` [PATCH V1 3/3] regulator: slg51000: add slg51000 regulator driver Eric Jeong
2019-04-16 15:24   ` Mark Brown
2019-04-17 11:25     ` Eric Hyeung Dong Jeong [this message]
2019-04-17 15:49       ` Mark Brown

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=VE1PR10MB288069C2FC4B6F79AE8F26A891250@VE1PR10MB2880.EURPRD10.PROD.OUTLOOK.COM \
    --to=eric.jeong.opensource@diasemi.com \
    --cc=Support.Opensource@diasemi.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /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).