linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David C. Rankin" <drankinatty@gmail.com>
To: linux-gpio@vger.kernel.org
Subject: Re: Documentation for line_config PULL_UP, effect on line_event edges and line_request values?
Date: Mon, 3 Jun 2024 23:39:16 -0500	[thread overview]
Message-ID: <2b815f80-5bc1-499c-9f7c-38749e112269@gmail.com> (raw)
In-Reply-To: <20240604024322.GA45268@rigel>

On 6/3/24 21:43, Kent Gibson wrote:
> Does highlighting that line values are logical help?

Thank you Kent for the reply!

   Chuckling... yes, flashing attributes too and a sledge-hammer waiting to 
fall on my head may also help.

   All kidding aside, the reason I bring it up, is if this is something that I 
scratched my head about after reading the documentation and the header, then 
I'm not alone. It's always the case with documenting code, when you are the 
author (or closely involved in creating the code), everything seems very clear 
and obvious -- you've lived with the code for months or years...

   However, on the other end of the understanding continuum, is the person 
looking to use the v2 uABI for the first time, without any familiarity with 
the code, that reads the chardev.html document will likely never appreciate 
the careful use of the words active/inactive. The comments in gpio.h header 
really do seem to just make that point more clear despite having the same 
text. I know it was that way for me.

   It may not take much of an addition at all to emphasize the logical edge 
and value relationship. In fact, just what you explained in your reply would 
make a perfect addition to help clarify and bridge the gap between those who 
know the uABI inside and out and those who just start working with it.

   Without looking at the code (or isolating the PULL and ACTIVE_LOW) it 
wasn't immediately clear which one was flipping the logical relationship. From 
a hardware standpoint it would make sense that either one could do it. Your 
explanation of bias being physical and the ACTIVE_LOW flag being the one that 
sets the logic makes that point clear. That would be a great addition to the 
doc as well.

>>
>>  * @GPIO_V2_LINE_FLAG_EDGE_RISING: line detects rising (inactive to active)
>>  * edges
>>  * @GPIO_V2_LINE_FLAG_EDGE_FALLING: line detects falling (active to
>>  * inactive) edges
>>  ...
> 
> So that does not makes it clear that the edge definitions are based on
> logical values?
> 

   That does make it clear, but for whatever human-factors reason, it is not 
as apparent in the enum gpio_v2_line_flag section of the chardev.html web 
page. Maybe it just has to do with the way the web-page puts the explanation 
on a separate line below in smaller serif font? But it almost seems the header 
screams "Pay attention to this!" while the doc just reads "Here is some other 
info too". Your idea of highlighting or at least bolding the "(inactive to 
active)" and "(active to inactive)" would certainly help there.

   In chardev.html, adding your explanation on the logical/physical difference 
would work great as a "Note: ...." right before the enum gpio_v2_line_flag 
block (or right after whichever you prefer)

   Anyway, all just good ideas intended to improve the ease of initial 
understanding for what is a great improvement over the v1 uABI. I'll leave the 
rest in your hands, you provided a great, short and concise explanation of the 
logical verses physical implementation of edge detection and value behavior. 
I'd only ask that you give serious thought to adding a few sentences or a 
paragraph precisely as you did in the reply. That really can make all the 
difference in understanding for someone coming anew to the gpio_v2 ABI.

   Thanks again for your reply.

-- 
David C. Rankin, J.D.,P.E.


  reply	other threads:[~2024-06-04  4:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 22:48 Documentation for line_config PULL_UP, effect on line_event edges and line_request values? David C. Rankin
2024-06-04  2:43 ` Kent Gibson
2024-06-04  4:39   ` David C. Rankin [this message]
2024-06-04 12:52     ` Kent Gibson
2024-06-04 22:29       ` David C. Rankin

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=2b815f80-5bc1-499c-9f7c-38749e112269@gmail.com \
    --to=drankinatty@gmail.com \
    --cc=linux-gpio@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).