From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Adam Ford <aford173@gmail.com>
Cc: linux-gpio <linux-gpio@vger.kernel.org>,
aford@beaconembedded.com,
Linus Walleij <linus.walleij@linaro.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] gpio: pca953x: Fix pca953x_gpio_set_config
Date: Wed, 15 Apr 2020 13:23:52 +0200 [thread overview]
Message-ID: <CAMpxmJU0sSDPTa-YHTEsYCzX3Vpv5YJAKhOhfhf73_rbL4jYSg@mail.gmail.com> (raw)
In-Reply-To: <20200412013352.674506-2-aford173@gmail.com>
niedz., 12 kwi 2020 o 03:34 Adam Ford <aford173@gmail.com> napisał(a):
>
> pca953x_gpio_set_config is setup to support pull-up/down
> bias. Currently the driver uses a variable called 'config' to
> determine which options to use. Unfortunately, this is incorrect.
>
> This patch uses function pinconf_to_config_param(config), which
> converts this 'config' parameter back to pinconfig to determine
> which option to use.
>
> Fixes: 15add06841a3 ("gpio: pca953x: add ->set_config implementation")
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
> index 5638b4e5355f..4269ea9a817e 100644
> --- a/drivers/gpio/gpio-pca953x.c
> +++ b/drivers/gpio/gpio-pca953x.c
> @@ -531,7 +531,7 @@ static int pca953x_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
> {
> struct pca953x_chip *chip = gpiochip_get_data(gc);
>
> - switch (config) {
> + switch (pinconf_to_config_param(config)) {
> case PIN_CONFIG_BIAS_PULL_UP:
> case PIN_CONFIG_BIAS_PULL_DOWN:
> return pca953x_gpio_set_pull_up_down(chip, offset, config);
> --
> 2.25.1
>
Patch applied for fixes, thanks!
Bart
next prev parent reply other threads:[~2020-04-15 11:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-12 1:33 [PATCH 1/2] gpiolib: of: Improve gpiolib-of support pull up/down on expanders Adam Ford
2020-04-12 1:33 ` [PATCH 2/2] gpio: pca953x: Fix pca953x_gpio_set_config Adam Ford
2020-04-15 11:23 ` Bartosz Golaszewski [this message]
2020-04-15 11:23 ` [PATCH 1/2] gpiolib: of: Improve gpiolib-of support pull up/down on expanders Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMpxmJU0sSDPTa-YHTEsYCzX3Vpv5YJAKhOhfhf73_rbL4jYSg@mail.gmail.com \
--to=bgolaszewski@baylibre.com \
--cc=aford173@gmail.com \
--cc=aford@beaconembedded.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).