Re: SV: [PATCH RFC] gpio: new driver for a gpio simulator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



pt., 12 paź 2018 o 11:47 Uwe Kleine-König
<u.kleine-koenig@xxxxxxxxxxxxxx> napisał(a):
>
> On Fri, Oct 12, 2018 at 11:27:18AM +0200, Einar Vading wrote:
> > On Fri, Oct 12, 2018 at 11:06:12AM +0200, Uwe Kleine-König wrote:
> > > Would it help to instanciate more than one gpio-simulator?
> >
> > Hmm, I don't think that would pose a problem. With DT it would be easy to name
> > the GPIOs and get then get them by name. What gpiochip they are on should not
> > matter... I think.
>
> The only downside is that you cannot atomically set GPIOs on different
> chips. I didn't try to use naming, but maybe the gpio framework is good
> enough that it just works.
>
> Best regards
> Uwe
>
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Sorry for the late reply, I was travelling last week.

If I understand correctly the main difference between gpio-mockup and
gpio-simulator is that simulating interrupts on input lines would
happen by changing the value of connected output GPIO lines.

I started using gpio-mockup for testing of both libgpiod and GPIO user
API some time ago. I initially thought about doing the exact same
thing with interrupts but figured that if we want to test the user API
then we'd better not be actually using it since we won't know where
the eventual bugs will actually come from - i.e. when testing reading
line events, let's not be using the output API from the other side,
but rather something not linked to GPIO in any way - debugfs in this
case.

That being said: I have nothing against extending gpio-mockup with
this feature - I actually like it. I guess having a single module
param that would create a second corresponding gpiochip for every
standard one would be enough? I could have the numbering starting
right after the standard chips and a special label too. However I
don't really see a need to have two separate testing drivers for a
single subsystem. Is there anything in the way mockup is implemented
that stops you from reusing it?

Please note that libgpiod extensively uses gpio-mockup for testing so
there's now way we're getting rid of it anytime soon.

Best regards,
Bartosz Golaszewski




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux