From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Baolin Wang <baolin.wang@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
orsonzhai@gmail.com, zhang.lyra@gmail.com, neo.hou@unisoc.com,
Mark Brown <broonie@kernel.org>,
linux-gpio <linux-gpio@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] gpio: sprd: Fix the incorrect data register
Date: Tue, 15 Jan 2019 11:47:22 +0100 [thread overview]
Message-ID: <CAMpxmJVyMd=rebK2h=uC_Cu_KXivRpCDCxzrneig0eZnK=wXpQ@mail.gmail.com> (raw)
In-Reply-To: <732ea4f8ff1bf3ad28bda543ae8e1727c78f8b3b.1547538574.git.baolin.wang@linaro.org>
wt., 15 sty 2019 o 08:53 Baolin Wang <baolin.wang@linaro.org> napisał(a):
>
> From: Neo Hou <neo.hou@unisoc.com>
>
> Since differnt type EICs have its own data register to read, thus fix the
> incorrect data register.
>
> Signed-off-by: Neo Hou <neo.hou@unisoc.com>
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> ---
> drivers/gpio/gpio-eic-sprd.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
> index e0d6a0a..257df59 100644
> --- a/drivers/gpio/gpio-eic-sprd.c
> +++ b/drivers/gpio/gpio-eic-sprd.c
> @@ -180,7 +180,18 @@ static void sprd_eic_free(struct gpio_chip *chip, unsigned int offset)
>
> static int sprd_eic_get(struct gpio_chip *chip, unsigned int offset)
> {
> - return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA);
> + struct sprd_eic *sprd_eic = gpiochip_get_data(chip);
> +
> + switch (sprd_eic->type) {
> + case SPRD_EIC_DEBOUNCE:
> + return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA);
> + case SPRD_EIC_ASYNC:
> + return sprd_eic_read(chip, offset, SPRD_EIC_ASYNC_DATA);
> + case SPRD_EIC_SYNC:
> + return sprd_eic_read(chip, offset, SPRD_EIC_SYNC_DATA);
> + default:
> + return -ENOTSUPP;
> + }
> }
>
> static int sprd_eic_direction_input(struct gpio_chip *chip, unsigned int offset)
> --
> 1.7.9.5
>
I guess both this and the second patch should go into stable and have
a Fixes: tag?
Bart
next prev parent reply other threads:[~2019-01-15 10:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 7:52 [PATCH 1/2] gpio: sprd: Fix the incorrect data register Baolin Wang
2019-01-15 7:52 ` [PATCH 2/2] gpio: sprd: Fix incorrect irq type setting for the async EIC Baolin Wang
2019-01-15 10:47 ` Bartosz Golaszewski [this message]
2019-01-15 12:00 ` [PATCH 1/2] gpio: sprd: Fix the incorrect data register Baolin Wang
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='CAMpxmJVyMd=rebK2h=uC_Cu_KXivRpCDCxzrneig0eZnK=wXpQ@mail.gmail.com' \
--to=bgolaszewski@baylibre.com \
--cc=baolin.wang@linaro.org \
--cc=broonie@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neo.hou@unisoc.com \
--cc=orsonzhai@gmail.com \
--cc=zhang.lyra@gmail.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).