From: Linus Walleij <linus.walleij@linaro.org>
To: kunyi@google.com
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Tomer Maimon <tmaimon77@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
avifishman70@gmail.com,
OpenBMC Maillist <openbmc@lists.ozlabs.org>,
Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 1/2] gpio: gpio-mmio: Allow volatile shadow regs
Date: Tue, 30 Oct 2018 13:06:27 +0100 [thread overview]
Message-ID: <CACRpkdbzhRMB1gr6CUVdref15v1S5DjHaUxi6=BOYoc3f_ZCrQ@mail.gmail.com> (raw)
In-Reply-To: <20181017213012.233957-2-kunyi@google.com>
On Wed, Oct 17, 2018 at 11:30 PM Kun Yi <kunyi@google.com> wrote:
> Currently the generic GPIO driver stores the direction and data shadow register
> when the driver probes. However, in embedded SOCs the GPIO pins are often
> interleaved with pins muxed to other functions, and pinctrl driver might
> toggle the direction/data register values for these pins. With GPIO
> driver being not the only owner, it should read the shadow registers
> before updating them, otherwise some pin states would be overwritten.
>
> This patch adds a flag BGPIOF_VOLATILE_REG to allow a pinctrl driver that uses
> the generic GPIO interface to indicate the need of read-before-update.
>
> Signed-off-by: Kun Yi <kunyi@google.com>
Hi Kun,
as you see the build robot has problems with the patch, please look
into it.
Architecturally I'm not so sure about this, we are introducing more
and more "shadow registers" and I feel what happens at the end
of the day is that we end up reimplementing regmap-mmio.
Please look into switching gpio-mmio.c to use regmap-mmio
and add more registers based on that.
It might be a bit complex but is a way better way forward for
everyone.
Yours,
Linus Walleij
next prev parent reply other threads:[~2018-10-30 12:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-17 21:30 [PATCH 0/2] Allow gpio-mmio to co-exist with pinctrl driver Kun Yi
2018-10-17 21:30 ` [PATCH 1/2] gpio: gpio-mmio: Allow volatile shadow regs Kun Yi
2018-10-18 11:49 ` kbuild test robot
2018-10-30 12:06 ` Linus Walleij [this message]
2018-10-17 21:30 ` [PATCH 2/2] pinctrl: pinctrl-npcm7xx: Set BGPIOF_VOLATILE_REG Kun Yi
2018-10-30 12:08 ` Linus Walleij
2018-10-31 5:06 ` Kun Yi
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='CACRpkdbzhRMB1gr6CUVdref15v1S5DjHaUxi6=BOYoc3f_ZCrQ@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=avifishman70@gmail.com \
--cc=broonie@kernel.org \
--cc=kunyi@google.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=tmaimon77@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).