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!