Re: [PATCH v5 09/16] regulator: bd71828: Basic support for ROHM bd71828 PMIC regulators

From: Vaittinen, Matti
Date: Tue Nov 19 2019 - 04:12:15 EST


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