On Tue, Mar 22, 2022 at 10:50:30AM +0200, Andy Shevchenko wrote: > On Tue, Mar 22, 2022 at 10:39 AM Hans Kurscheidt <lve0200@xxxxxxxxx> wrote: > > Am 22.03.2022 um 09:36 schrieb Hans Kurscheidt: > > > Am 22.03.2022 um 01:59 schrieb Kent Gibson: > > ... > > > > Still 1 more question. I understand the sense of a Pull-up in Input > > > mode, but reading the code, I see that the Bias option exists as well > > > for gpioset (Output). What is the sense of this, and what does it do? > > I guess we started providing OPEN SOURCE / DRAIN in libgpiod v2.0 > (Bart or Kent may correct me), but you should get an idea why it may > be useful. > No - open drain/source is not new - it has been there since cdev was added AFAIAA. The v2 ABI, which libgpiod v2 will support, adds debounce, event sequence numbers, events from multiple lines in one request, and a few other things, but the drive options have always been there - even before the bias options were added. > On top of that, the pin can be reconfigured from input to output and > vice versa at run-time. So, keeping a bias setting will allow not to > think about it when pin direction is switched, although I agree this > may not be a clean case to use. > Agreed - I would set both the direction and bias in such a case. Cheers, Kent.