All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>
Cc: vincent.whitchurch@axis.com, Mark Rutland <mark.rutland@arm.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH RFC] gpio: new driver for a gpio simulator
Date: Wed, 10 Oct 2018 13:47:42 +0200	[thread overview]
Message-ID: <CACRpkdYnHGWwOA=KUNRe4VP_jxO8TXG3v4vEJfV58OB6z99JFQ@mail.gmail.com> (raw)
In-Reply-To: <20181009191121.r2tgc2oslwcwfhyn@pengutronix.de>

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.

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 recently posted patches to even enable device tree
> > probing of the mockup device, indicating that there is already
> > some industrial use of that driver for prototyping.
>
> My gpio-simulator has dt support, too, but it's more a private project
> of me without industrial use (yet).

It's pretty easy for me to see the general utility, so I would
ideally like to incorporate these things into one and the same
simulator/mockup driver.

Yours,
Linus Walleij

  reply	other threads:[~2018-10-10 11:47 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 [this message]
2018-10-11  8:16       ` Uwe Kleine-König
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='CACRpkdYnHGWwOA=KUNRe4VP_jxO8TXG3v4vEJfV58OB6z99JFQ@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.