[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161129113855.GH1867@localhost.localdomain>
Date: Tue, 29 Nov 2016 11:38:55 +0000
From: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
To: <broonie@...nel.org>
CC: <lgirdwood@...il.com>, <linux-kernel@...r.kernel.org>,
<patches@...nsource.wolfsonmicro.com>
Subject: Re: [PATCH 2/2] regulator: core: Allow enable GPIO to be specified
using GPIOD
On Tue, Nov 29, 2016 at 11:30:45AM +0000, Charles Keepax wrote:
> The regulator subsystem has used GPIOs internally for a while, however,
> end drivers must still specify their enable GPIO using a GPIO number. This
> patch allows the end drivers to specify the enable GPIO using GPIOD
> directly.
>
> Signed-off-by: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
> ---
> drivers/regulator/core.c | 38 ++++++++++++++++++++++++++------------
> include/linux/regulator/driver.h | 14 +++++++++-----
> 2 files changed, 35 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index b3417ac..48f2813 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
>
> pin->gpiod = gpiod;
> @@ -4027,14 +4042,13 @@ regulator_register(const struct regulator_desc *regulator_desc,
> goto clean;
> }
>
> - if ((config->ena_gpio || config->ena_gpio_initialized) &&
> - gpio_is_valid(config->ena_gpio)) {
> + if (regulator_ena_gpio_valid(config)) {
> mutex_lock(®ulator_list_mutex);
> ret = regulator_ena_gpio_request(rdev, config);
> mutex_unlock(®ulator_list_mutex);
> if (ret != 0) {
> rdev_err(rdev, "Failed to request enable GPIO%d: %d\n",
> - config->ena_gpio, ret);
> + desc_to_gpio(config->ena_gpiod), ret);
Ah sorry small bug here I will respin.
Thanks,
Charles
Powered by blists - more mailing lists