lkml.org 
[lkml]   [2019]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] regulator: act8865: operating mode and suspend state support
On Sat, Aug 10, 2019 at 01:18:54PM +0530, Raag Jadav wrote:

> +static int act8865_set_mode(struct regulator_dev *rdev, unsigned int mode)
> +{
> + struct act8865 *act8865 = rdev_get_drvdata(rdev);
> + struct regmap *regmap = rdev->regmap;
> + int id = rdev_get_id(rdev);
> + int reg, ret, val = 0;

This function doesn't check if the mode is _FIXED - if it is then I'd
expect to get an error when trying to set the mode (I'm assuming that
means fixed in hardware).

> +static unsigned int act8865_get_mode(struct regulator_dev *rdev)
> +{
> + struct act8865 *act8865 = rdev_get_drvdata(rdev);
> + int id = rdev_get_id(rdev);
> +
> + if (id < ACT8865_ID_DCDC1 || id >= ACT8865_ID_MAX)
> + return -EINVAL;
> +
> + return act8865->op_mode[id];
> +}

This should be reading the value back from the hardware.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-08-12 13:12    [W:0.052 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site