lkml.org 
[lkml]   [2010]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/01] regulator: support max8649
On Tue, Jan 26, 2010 at 01:26:08AM -0500, Haojian Zhuang wrote:

This all looks good except...

> +static int max8649_enable_time(struct regulator_dev *rdev)
> +{

...

> + return (voltage / step);

I'd expect the time taken to enable to be the voltage multipled by the
step size rather than divided by the step size?

> +static int max8649_set_mode(struct regulator_dev *rdev, unsigned int mode)
> +{
> + struct max8649_regulator_info *info = rdev_get_drvdata(rdev);
> +
> + switch (mode) {
> + case REGULATOR_MODE_FAST:
> + max8649_set_bits(info->i2c, info->vol_reg, MAX8649_FORCE_PWM,
> + MAX8649_FORCE_PWM);
> + break;
> + case REGULATOR_MODE_NORMAL:
> + max8649_set_bits(info->i2c, info->vol_reg,
> + MAX8649_FORCE_PWM, 0);
> + break;

This should really have a default case which rejects other modes.


\
 
 \ /
  Last update: 2010-01-26 12:07    [W:0.077 / U:4.976 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site