Re: [PATCH v1 2/3] Documentation: gpio: Add a section on what to return in ->get() callback
From: Andy Shevchenko
Date: Wed Nov 30 2022 - 11:23:16 EST
On Wed, Nov 30, 2022 at 05:14:38PM +0100, Hans de Goede wrote:
> On 11/30/22 17:12, Hans de Goede wrote:
> > On 11/30/22 16:55, Andy Shevchenko wrote:
...
> > IHMO the rules for get() should simply be:
> >
> > 1. Device has an input buffer:
> > Return input-buffer value for the pin.
> >
> > 2. Devices does not have an input buffer:
> > Return last set output-buffer value
>
> Quick correction device should be pin here, because it
> if there is an input buffer or not can differ per pin.
> So IHMO the rules for get() should simply be:
>
> 1. pin has an input buffer:
> return input-buffer value for the pin.
>
> 2. pin does not have an input buffer:
> return the value last set for the pin's output-buffer
"pin" misleads here. The "pin" can be in native function which may have not be
even connected to GPIO buffers. There are different hardware topologies.
So, no, not a "pin".
--
With Best Regards,
Andy Shevchenko