[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd5499bcb2cceb163ab7829eced05360c725f6e3.camel@fi.rohmeurope.com>
Date: Tue, 19 Nov 2019 09:12:06 +0000
From: "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>
To: "broonie@...nel.org" <broonie@...nel.org>
CC: "corbet@....net" <corbet@....net>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"phil.edworthy@...esas.com" <phil.edworthy@...esas.com>,
"linux-rtc@...r.kernel.org" <linux-rtc@...r.kernel.org>,
"dmurphy@...com" <dmurphy@...com>,
"linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>,
"jeffrey.t.kirsher@...el.com" <jeffrey.t.kirsher@...el.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"mchehab+samsung@...nel.org" <mchehab+samsung@...nel.org>,
"alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mturquette@...libre.com" <mturquette@...libre.com>,
"lgirdwood@...il.com" <lgirdwood@...il.com>,
"jacek.anaszewski@...il.com" <jacek.anaszewski@...il.com>,
"mazziesaccount@...il.com" <mazziesaccount@...il.com>,
"a.zummo@...ertech.it" <a.zummo@...ertech.it>,
"linus.walleij@...aro.org" <linus.walleij@...aro.org>,
"wsa+renesas@...g-engineering.com" <wsa+renesas@...g-engineering.com>,
"m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
"mark.rutland@....com" <mark.rutland@....com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
"hkallweit1@...il.com" <hkallweit1@...il.com>,
"bgolaszewski@...libre.com" <bgolaszewski@...libre.com>,
"hofrat@...dl.org" <hofrat@...dl.org>,
"lee.jones@...aro.org" <lee.jones@...aro.org>,
"pavel@....cz" <pavel@....cz>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"sboyd@...nel.org" <sboyd@...nel.org>
Subject: Re: [PATCH v5 09/16] regulator: bd71828: Basic support for ROHM
bd71828 PMIC regulators
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
Powered by blists - more mailing lists