From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/2] Fix basic_mmio_gpio shadow initialization
Date: Thu, 17 May 2012 15:35:01 +0800 [thread overview]
Message-ID: <1337240103-4756-1-git-send-email-shawn.guo@linaro.org> (raw)
I recently ran into a problem with gpio-generic driver on mxs platform.
It turns out it's the exactly same problem that Lothar had run into
on imx/mxc platform, which was fixed up in gpio-mxc driver as below.
commit fb1492186276ba52d99b58121b8a9a87f20cc9f3
Author: Lothar Wa?mann <LW@KARO-electronics.de>
Date: Thu Jul 7 14:50:16 2011 +0200
gpio/mxc: add missing initialization of basic_mmio_gpio shadow variables
The bgpio_init() function does not initialise the shadow register for
the GPIO direction register. Thus, when configuring the first GPIO with
gpio_set_direction() all other GPIOs of the same bank will be
configured as inputs. Since the bgpio layer cannot know whether the
register is readable, the initialisation should be done by the caller
of bgpio_init().
Also, the 'data' shadow variable that is used inside basic_mmio_gpio
to cache the current value of the GPIO_DR register is initialised from
the GPIO_PSR register within bgpio_init(). Thus when setting the
output value of a certain GPIO, the other GPIO outputs of the same
bank will be set or cleared depending on the pin state of the GPIO
inputs during bgpio_init().
I think it's a problem of gpio-generic rather than platform specific
driver, so I'm coming up this series to have the problem fixed in
gpio-generic driver itself and then removes the fixup in gpio-mxc.
Thus, other platform gpio drivers based on gpio-generic do not have to
suffer from the same problem and fix it up in individually over and
over again.
Per suggestion from Lothar, I'm copying the maintainers of those
platform gpio drivers using gpio-generic to inform the default behavior
changing on gpio-generic. Please let me know if anyone gets impacted
by the changes.
Regards,
Shawn
Shawn Guo (2):
gpio/generic: initialize basic_mmio_gpio shadow variables properly
gpio/mxc: remove basic_mmio_gpio shadow fixup
drivers/gpio/gpio-generic.c | 4 ++++
drivers/gpio/gpio-mxc.c | 2 --
2 files changed, 4 insertions(+), 2 deletions(-)
--
1.7.5.4
next reply other threads:[~2012-05-17 7:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-17 7:35 Shawn Guo [this message]
2012-05-17 7:35 ` [PATCH 1/2] gpio/generic: initialize basic_mmio_gpio shadow variables properly Shawn Guo
2012-05-17 15:47 ` H Hartley Sweeten
2012-05-18 13:51 ` Shawn Guo
2012-05-19 5:44 ` Grant Likely
2012-05-19 5:45 ` Grant Likely
2012-05-17 7:35 ` [PATCH 2/2] gpio/mxc: remove basic_mmio_gpio shadow fixup Shawn Guo
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=1337240103-4756-1-git-send-email-shawn.guo@linaro.org \
--to=shawn.guo@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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).