Re: [libgpiod] feature request: output state read and sustain

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

 





On 29. 06. 22 13:25, Kent Gibson wrote:
On Wed, Jun 29, 2022 at 01:17:54PM +0200, Jiří Prchal wrote:


On 29. 06. 22 12:47, Kent Gibson wrote:
On Wed, Jun 29, 2022 at 12:27:13PM +0200, Andy Shevchenko wrote:
On Wed, Jun 29, 2022 at 11:27 AM Jiří Prchal <jiri.prchal@xxxxxxxxxxx> wrote:
On 29. 06. 22 9:23, Kent Gibson wrote:
On Tue, Jun 28, 2022 at 03:08:20PM +0200, Jiří Prchal wrote:

using new libgpiod / chardev driver, is there any way to get state of
output? I mean one process sets it for example to 1 and another process
reads this output state for example to show that on web page.

I'm not sure it's guaranteed to read output back. Some (b0rken?) GPIO
chips may not allow this on H/W level and when reading they always
will get the value of Input Buffer (now imagine if the line is
configured as Output with Input being disconnected from the physical
pin).


Agreed.  Userspace should know the value they set the output to, and so
have no need to read it back.  GPIO is not NVM.
Not NVM, bat RAM and it keeps their data untill reset, after reset it has specific value (usually 0)
I haven't seen HW without possibility of reading back output register, but I don't say there couldn't be such one.


No, no it is not RAM.

And I have seen hardware where you can't read back the output.
And so has Andy apparently.
That is the problem - there is lots of hardware out there and we are
trying to provide a consistent interface to inconsistent hardware.
OK, but if hw supports it why not provide it. And for hw without support keep it's value in memory? Or return to user space with errno indicating "no support"?

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