public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: ashishj3 <ashish.jangam@kpitcummins.com>
Cc: Dajun <dajun.chen@diasemi.com>,
	linaro-dev@lists.linaro.org, lrg@slimlogic.co.uk,
	linux-kernel@vger.kernel.org
Subject: Re: [Patch 5/11] Regulator: DA9052 regulator support v1
Date: Tue, 28 Jun 2011 17:05:38 +0100	[thread overview]
Message-ID: <20110628154115.GA20501@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1309164157.5620.13.camel@L-0532.kpit.com>

On Mon, Jun 27, 2011 at 02:12:37PM +0530, ashishj3 wrote:

> +static int da9052_dcdc_set_current_limit(struct regulator_dev *rdev, int min_uA,
> +					  int max_uA)
> +{
> +	struct da9052_regulator *regulator = rdev_get_drvdata(rdev);
> +	int offset = rdev_get_id(rdev);
> +	int reg_val;
> +
> +	if (min_uA > 1200000 || max_uA > 1200000)
> +		return -EINVAL;
> +
> +	if (min_uA == 700)
> +		reg_val = DA9052_BUCK_CURRENT_LIMIT_700mA;
> +	else if (min_uA <= 800)
> +		reg_val = DA9052_BUCK_CURRENT_LIMIT_800mA;
> +	else if (min_uA <= 1000)
> +		reg_val = DA9052_BUCK_CURRENT_LIMIT_1000mA;
> +	else if (min_uA <= 1200)
> +		reg_val = DA9052_BUCK_CURRENT_LIMIT_1200mA;

What if min_uA is less than 700?

Otherwise this looks reasonable - very much better!

      reply	other threads:[~2011-06-28 16:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27  8:42 [Patch 5/11] Regulator: DA9052 regulator support v1 ashishj3
2011-06-28 16:05 ` Mark Brown [this message]

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=20110628154115.GA20501@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=ashish.jangam@kpitcummins.com \
    --cc=dajun.chen@diasemi.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /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