Re: [libgpiod] bug: pull-up does not work

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

 





On 25. 03. 22 15:57, Kent Gibson wrote:
On Fri, Mar 25, 2022 at 11:02:07AM +0100, Jiří Prchal wrote:
Hi,
since in debian is 1.6.2 and pull-up doesn't work so I cloned git, branch
next/libgpiod-2.0 and compiled libgpiod and tools, but no luck, same result.


You mean it doesn't work for you on your platform.

The libgpiod-2.0 branch is a work in progress and should not be considered
the place to go to find solutions to problems with v1.6.
Not that I'm saying that the v2 branch doesn't work, I'm actually pretty
sure it does, but its purpose is to switch to the latest kernel uAPI, not
to provide fixes, should they be needed, for v1.6.
Just thought api v1 doesn't support pull-ups so tried v2.

~# uname -r
5.17.0-rc7_cpm9g25

floating pins should go with pull-up/down
~# gpioget -B pull-up 3 6 8 10 12 14 16 18 20
0 0 0 0 0 0 0 0
~# gpioget -B pull-up 3 6 8 10 12 14 16 18 20
1 1 0 0 0 0 0 0
~# gpioget -B pull-up 3 6 8 10 12 14 16 18 20
0 1 0 1 0 0 0 0

~# gpioget -v
gpioget (libgpiod) v2.0-devel

Whats wrong with it?

You forgot to mention which of those pins are floating.
All of them.
Or what gpiochip3 is and whether it supports biasing.
AT91SAM9G25, hw supports pull-ups.

So does your chip support pull-up/down?
The kernel can only enable it if the hardware and pinctrl driver supports it.
Is there possibility that pinctrl doesn't support it? I think other gpios used in kernel are with pull-up.
Example:
pinctrl@fffff400 {
	1wire {
		pinctrl_1wire: 1wire-0 {
atmel,pins = <AT91_PIOC 0 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; /* PC0 PIO, pull-up */
		};
	};
};

If the hardware doesn't support it then attempting to set the
pull-up/down is quietly ignored, which would be consistent with what you
are seeing.

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