lkml.org 
[lkml]   [2019]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 09/16] regulator: bd71828: Basic support for ROHM bd71828 PMIC regulators
Date
Thanks Mark,

On Mon, 2019-11-18 at 16:20 +0000, Mark Brown wrote:
> On Mon, Nov 18, 2019 at 08:57:57AM +0200, Matti Vaittinen wrote:
>
> > +static int ramp_delay_supported(struct regulator_dev *rdev)
> > +{
> > + switch (rdev->desc->id) {
> > + case BD71828_BUCK1:
> > + case BD71828_BUCK2:
> > + case BD71828_BUCK6:
> > + case BD71828_BUCK7:
> > + return 1;
> > + default:
> > + break;
> > + }
> > + return 0;
> > +}
> > +
> > +static int bd71828_set_ramp_delay(struct regulator_dev *rdev, int
> > ramp_delay)
> > +{
> > + unsigned int val;
> > +
> > + if (!ramp_delay_supported(rdev)) {
> > + dev_err(&rdev->dev, "%s: can't set ramp-delay\n",
> > + rdev->desc->name);
> > + return -EINVAL;
>
> Rather than doing this it's better to just not provide the operation
> for
> devices that don't support it, that makes the handling in the core
> easier.

Makes sense. I'll change this in next version.

Br,
Matti Vaittinen

\
 
 \ /
  Last update: 2019-11-19 10:13    [W:0.149 / U:2.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site