All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Hans Kurscheidt <lve0200@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: gpiod: Set pullup for Input Line
Date: Wed, 23 Mar 2022 00:11:07 +0800	[thread overview]
Message-ID: <20220322161107.GA131091@sol> (raw)
In-Reply-To: <1a7fd31a-221e-7b23-b95f-d71e440b3ff0@gmail.com>

On Tue, Mar 22, 2022 at 09:36:29AM +0100, Hans Kurscheidt wrote:
> 
> Am 22.03.2022 um 01:59 schrieb Kent Gibson:
> > On Mon, Mar 21, 2022 at 07:33:28PM +0200, Andy Shevchenko wrote:
> > > On Mon, Mar 21, 2022 at 7:27 PM Hans Kurscheidt<lve0200@gmail.com>  wrote:
> > > > Hi thanks, that makes hope.
> > > First of all, please do not top-post.
> > > 
> > > > Unfortunately apt-get gpiod on my OrangePi Armbian board gives me
> > > > version 1.2, while the dev is already at 1.6. I probably have to build
> > > > it from source.
> > > > 
> > > > Keeping fingers crossed .
> > > I don't remember the details of old versions of libgpiod (Bart? Kent?)
> > > I think it was available even there.
> > > 
> > Bias support was added in libgpiod v1.5.
> > It wasn't even exposed in the uAPI prior to that - it wasn't added until
> > kernel v5.5.
> > 
> > In this case building the latest stable, 1.6.3, is the way to go.
> > 
> > Cheers,
> > Kent.
> > 
> > > > Am 21.03.2022 um 17:26 schrieb Andy Shevchenko:
> > > > > On Mon, Mar 21, 2022 at 1:30 PM Hans Kurscheidt<lve0200@gmail.com>  wrote:
> > > > > > Despite deep searching, I cannot find any information, if gpiod allow
> > > > > > specifying pull-ups to input lines and how to do/handle it.
> > > > > Have you followed this code from libgpiod?
> > > > > https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/tools/gpioset.c#n44
> > > 
> > > -- 
> > > With Best Regards,
> > > Andy Shevchenko
> 
> Thank-you Kent!
> 
> 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?
> 

As answered by Andy, drive and bias are orthogonal so gpioset supports
setting them independently.  Obviously setting bias with push-pull
doesn't make much sense, but the case it is there for is combining open
drain/source with a pull for when the line is not being driven.
Granted that such a pull would usually be provided externally, but the
option is there in case it isn't.

> WRT. building it, it wasn't that straight forward, as in the description. On
> the Armbian/Debian buster Kernel 5.10.60-sunxi64 #21.08.1 I had to create an
> M4 dir, install GNU-archives and install libtools in addition to succeed
> building it. Then doxygen and help2man were still missing.
> 

I defer to Bart on build issues, but you shouldn't need to create the
m4 directory - you should install m4.
In fact all these packages:
  apt_packages:
      - autoconf
      - autoconf-archive
      - libtool
      - m4
      - doxygen
      - graphviz

That list is drawn from a recent patch I submitted to build the documentation
on a readthedocs Ubuntu VM, but it is probably the same or very similar
for Armbian.
That is in addition to build-essential, but I assume you already have that.

Cheers,
Kent.

  parent reply	other threads:[~2022-03-22 16:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 10:43 gpiod: Set pullup for Input Line Hans Kurscheidt
2022-03-21 13:34 ` Alexander Dahl
2022-03-21 16:26 ` Andy Shevchenko
2022-03-21 17:27   ` Hans Kurscheidt
2022-03-21 17:33     ` Andy Shevchenko
2022-03-21 18:17       ` Hans Kurscheidt
2022-03-21 20:25         ` Fwd: " Hans Kurscheidt
2022-03-22  0:59       ` Kent Gibson
     [not found]         ` <1a7fd31a-221e-7b23-b95f-d71e440b3ff0@gmail.com>
2022-03-22  8:39           ` Hans Kurscheidt
2022-03-22  8:50             ` Andy Shevchenko
2022-03-22  9:39               ` Hans Kurscheidt
2022-03-22 16:12                 ` Kent Gibson
2022-03-22 16:11               ` Kent Gibson
2022-03-22 16:11           ` Kent Gibson [this message]
     [not found] <ab3240e5-df61-cff4-ebba-f6a7e5d99f52@gmail.com>
2022-03-21 13:48 ` Hans Kurscheidt
2022-03-21 14:42   ` Alexander Dahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220322161107.GA131091@sol \
    --to=warthog618@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linux-gpio@vger.kernel.org \
    --cc=lve0200@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.