From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
Mark Rutland <mark.rutland@arm.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
vincent.whitchurch@axis.com,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Sascha Hauer <kernel@pengutronix.de>
Subject: Re: [PATCH RFC] gpio: new driver for a gpio simulator
Date: Thu, 11 Oct 2018 10:16:46 +0200 [thread overview]
Message-ID: <20181011081646.np2pte7eeohuyhh6@pengutronix.de> (raw)
In-Reply-To: <CACRpkdYnHGWwOA=KUNRe4VP_jxO8TXG3v4vEJfV58OB6z99JFQ@mail.gmail.com>
On Wed, Oct 10, 2018 at 01:47:42PM +0200, Linus Walleij wrote:
> On Tue, Oct 9, 2018 at 9:11 PM Uwe Kleine-K�nig
> <u.kleine-koenig@pengutronix.de> wrote:
>
> > Currently it is not yet supported, but with the API of gpio-simulator it
> > should be trivially possible, to atomically set gpios from userspace
> > which won't work with the debugfs files used by gpio-mockup.
>
> Hm. That seems like a feature we might want in the mockup
> driver then.
>
> > An advantage of gpio-mockup over gpio-simulator I noticed by reading is
> > that it already supports atomic setting in the direction to userspace.
> > Also the number of gpios isn't fixed. (But 64 GPIOs should be enough for
> > everybody :-)
> >
> > A bit unrelated: I would probably have noticed the mockup driver if it
> > were not hidden in the section "Memory mapped GPIO drivers".
>
> This should be fixed.
>
> > > 2. Would it be possible to extend gpio-mockup.c to cover your
> > > usecases instead of introducing another unreal GPIO device?
> >
> > Sure, I could change the interface from debugfs to two gpio ports that
> > behave like gpio-simulator :-)
>
> Can't we do both... maybe I just don't get it here.
This would complicate things because then there are two controllers of
the same resource with all the resulting effects. We'd need to make sure
that only one of the two controllers can be active. It's not hard, but I
see little use.
> Certainly gpio-mockup will give you the B side, there is
> a gpiochip that appears after all as a result of probing the
> driver. What you want is to add a second gpiochip that can
> be used to stimulate it.
>
> Maybe that is as simple as a module parameter or
> Kconfig option to also create a controlling port.
>
> I would prefer to have one GPIO-mockup/fake/simulator
> thing instead of several, so we can focus efforts.
>
> It's good for prototyping and testing alike.
>
> > The motivation to create gpio-simulator
> > was to have a nice test case for the rotary-encoder driver and for that
> > it is crucial to be able to set gpios atomically (in the direction that
> > isn't possible for mockup) to test quick turning.
>
> This is a valid prototyping usecase. As is Vincent's.
@Vincent: What is your usecase? I currently cannot imagine a use case
that can be done with the mockup driver but not with the simulator.
The conceptual difference is just that mockup uses files in debugfs to
control the "inner side" while the simulator uses another set of gpios.
The advantages of the latter are that you could wire both sides to
otherwise unaware drivers (though this is a bit theoretical as there is
currently no use case I'm aware of that already exists) and it works
with the tools that might already exist to work on real hardware. Also
it is dogfooding which is nice.
So if you ask me the conceptually right solution is to use the
gpio-simulator and throw away the mockup driver. The only downside I see
here is that users of mockup have to adapt. I didn't look into the tool
for mockup yet, but probably they can be easily adapted to work with the
simulator. But maybe I missed the killer feature of the mockup driver
so feel free to prove me wrong.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K�nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2018-10-11 15:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-08 10:13 [PATCH RFC] gpio: new driver for a gpio simulator Uwe Kleine-König
2018-10-08 13:08 ` Uwe Kleine-König
2018-10-09 12:51 ` Linus Walleij
2018-10-09 19:11 ` Uwe Kleine-König
2018-10-10 11:47 ` Linus Walleij
2018-10-11 8:16 ` Uwe Kleine-König [this message]
2018-10-11 9:49 ` Vincent Whitchurch
2018-10-12 8:02 ` SV: " Einar Vading
2018-10-12 9:06 ` Uwe Kleine-König
2018-10-12 9:27 ` Einar Vading
2018-10-12 9:47 ` Uwe Kleine-König
2018-10-15 9:54 ` Bartosz Golaszewski
2018-10-15 20:03 ` Uwe Kleine-König
2018-10-18 15:03 ` Bartosz Golaszewski
2018-10-18 19:16 ` Uwe Kleine-König
2018-10-30 12:45 ` Linus Walleij
2018-11-03 21:15 ` Uwe Kleine-König
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=20181011081646.np2pte7eeohuyhh6@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=vincent.whitchurch@axis.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).