All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Dirk Behme <dirk.behme@gmail.com>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH] Documentation: gpio: consumer: describe active low property
Date: Tue, 14 Jul 2015 14:06:39 +0900	[thread overview]
Message-ID: <CAAVeFu+5WyxaLzxVuta2JW9P5=SUPKnkiuBtu0Y7b-QLpWjBPQ@mail.gmail.com> (raw)
In-Reply-To: <1436026748-4452-1-git-send-email-dirk.behme@gmail.com>

On Sun, Jul 5, 2015 at 1:19 AM, Dirk Behme <dirk.behme@gmail.com> wrote:
> I've been searching for any documentation of 'the active-low property of a GPIO'
> already mentioned in this documenation. But couldn't find any. Add it.
>
> Sigend-off-by: Dirk Behme <dirk.behme@gmail.com>
> ---
>  Documentation/gpio/consumer.txt | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/Documentation/gpio/consumer.txt b/Documentation/gpio/consumer.txt
> index 75542b9..f1a6e20 100644
> --- a/Documentation/gpio/consumer.txt
> +++ b/Documentation/gpio/consumer.txt
> @@ -236,6 +236,32 @@ The active-low state of a GPIO can also be queried using the following call:
>  Note that these functions should only be used with great moderation ; a driver
>  should not have to care about the physical line level.
>
> +The active-low property
> +-----------------------
> +
> +As a driver should not have to care about the physical line level, all of the
> +gpiod_set_xxx_value_xxx() functions do take the active-low property into account.
> +This does mean that they check whether the GPIO is configured to be active-low. And
> +if so, they manipulate the passed value before the physical line level is driven.

This would be "all of the gpiod_set_value_xxx() functions, since
gpiod_set_raw_value_xxx() ignores the active-low setting.

I think it would also be worth to explain that the set_raw/get_raw
functions should be avoided as much as possible, especially by drivers
which should not care about the actual physical line level and worry
about the logical value instead.

> +
> +With this, all the gpiod_set_xxx_value_xxx() functions interpret the parameter
> +"value" as "active" ("1") or "inactive" ("0"). The physical line level will be
> +driven accordingly.
> +
> +As an example, if the active-low poperty for a dedicated GPIO is set, and the
> +gpiod_set_xxx_value_xxx() passes "active" ("1"), the physical line level will be
> +driven low.
> +
> +To summarize:
> +
> +Function (example)             active-low proporty  physical line
> +gpiod_set_raw_value(desc, 0);      don't care           low
> +gpiod_set_raw_value(desc, 1);      don't care           high
> +gpiod_set_value(desc, 0);              n/a              low
> +gpiod_set_value(desc, 1);              n/a              high

What is n/a here? Shouldn't it be "active high (default)"?

Once clarified,

Acked-by: Alexandre Courbot <acourbot@nvidia.com>

      reply	other threads:[~2015-07-14  5:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-04 16:19 [PATCH] Documentation: gpio: consumer: describe active low property Dirk Behme
2015-07-14  5:06 ` Alexandre Courbot [this message]

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='CAAVeFu+5WyxaLzxVuta2JW9P5=SUPKnkiuBtu0Y7b-QLpWjBPQ@mail.gmail.com' \
    --to=gnurou@gmail.com \
    --cc=dirk.behme@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 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.