Re: [RFC] gpio: expose pull-up/pull-down line flags to userspace

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

 



On Wed, Oct 09, 2019 at 03:30:37PM +0200, Drew Fustini wrote:
> On Wed, Oct 09, 2019 at 02:55:24PM +0800, Kent Gibson wrote:
> > Safe to assume your code is in your topic/gpio-uapi-config branch?
> > I hope so, cos I've forked from that into github.com/warthog618/linux 
> > and have started working on it.
> 
> Do you also have a fork of libgpiod that you are working in?
> 
> In case it is of any use, I just posted the libgpiod patch for pull-up/down
> flags that I had been using to test with.
> 
> I help maintain Adafruit_Blinka [1] so I would like try testing pull-up/down.
> I already have a Raspberry Pi 3 booting a cross-compiled kernel with my (now
> outdated) patch applied and a patched libgpiod.
> 
It is basically working for me on my Pi4:

pi@quoll:~ $ ./gpiodctl get gpiochip0 7
0
pi@quoll:~ $ ./gpiodctl get -u gpiochip0 7
1
pi@quoll:~ $ ./gpiodctl get gpiochip0 7
1
pi@quoll:~ $ ./gpiodctl get -d gpiochip0 7
0
pi@quoll:~ $ ./gpiodctl get gpiochip0 7
0

That is using the gpiodctl tool from my gpiod library.
My gpiod test suite also passes, but it doesn't do much to
exercise the UAPI.
I was intending to run my uapi test suite, which is more thorough,
but it turns out that only targets gpio-mockup, whereas my gpiod
test suite can target either.
Something else for the todo list.

Hopefully it is obvious what gpiodctl is doing. (-u sets the 
pull-up flag, -d sets the pull-down flag)
Looks like the pulls stick when the line is released, and the
subsequent get, without pull-up set, either doesn't clear the
pull-up/down or the line stays floating at the old pull level.
More investigation required, but that will have to wait til 
I get back to this later in the day.

Oh, and that is running on the rpi-5.3.3 kernel patched with everything
on my topic/gpio-uapi-config branch from 5.4-rc2 onward.

Cheers,
Kent.



[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