linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: dimitry@cos.flag.org
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: dimitry <dimitry@cos.flag.org>
Subject: gpiolib: GPIO_GET_LINEHANDLE_IOCTL and GPIO_GET_LINEEVENT_IOCTL at the same time
Date: Tue, 28 Aug 2018 09:33:11 -0400 (EDT)	[thread overview]
Message-ID: <314029050.47161.1535463191699.JavaMail.zimbra@cos.flag.org> (raw)

It seems gpiolib only allows user to request either the line handle descriptor or the line event descriptor, but not both at the same time. 

gpiohandle_request hr; 
gpioevent_request er; 
... 
ioctl(fd, GPIO_GET_LINEHANDLE_IOCTL, &hr); // so far so good 
ioctl(fd, GPIO_GET_LINEEVENT_IOCTL, &er); // resource busy 

I have a situation where I am trying to have 1 thread monitor an open drain/source line for events, while another thread writes to it. Not entirely unlike i2c pulse stretching. Is this not possible with the current gpiolib design? Or am I doing something wrong? If not possible, is my only choice to run an endless loop checking for line state? 

NB: I am not subscribed to the list. Please CC me directly in your replies. 

Thank you, 
Dimitry 


                 reply	other threads:[~2018-08-28 13:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=314029050.47161.1535463191699.JavaMail.zimbra@cos.flag.org \
    --to=dimitry@cos.flag.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).