[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191118162032.GI9761@sirena.org.uk>
Date: Mon, 18 Nov 2019 16:20:32 +0000
From: Mark Brown <broonie@...nel.org>
To: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc: mazziesaccount@...il.com, Lee Jones <lee.jones@...aro.org>,
Jacek Anaszewski <jacek.anaszewski@...il.com>,
Pavel Machek <pavel@....cz>, Dan Murphy <dmurphy@...com>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Liam Girdwood <lgirdwood@...il.com>,
Jonathan Corbet <corbet@....net>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Nicholas Mc Guire <hofrat@...dl.org>,
Phil Edworthy <phil.edworthy@...esas.com>,
linux-leds@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-clk@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-rtc@...r.kernel.org
Subject: Re: [PATCH v5 09/16] regulator: bd71828: Basic support for ROHM
bd71828 PMIC regulators
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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists