[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110628154115.GA20501@opensource.wolfsonmicro.com>
Date: Tue, 28 Jun 2011 17:05:38 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: ashishj3 <ashish.jangam@...tcummins.com>
Cc: Dajun <dajun.chen@...semi.com>, linaro-dev@...ts.linaro.org,
lrg@...mlogic.co.uk, linux-kernel@...r.kernel.org
Subject: Re: [Patch 5/11] Regulator: DA9052 regulator support v1
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!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists