mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Koichiro Den <koichiro.den@canonical.com>
Cc: linux-gpio@vger.kernel.org, brgl@bgdev.pl,
	linus.walleij@linaro.org,  maciej.borzecki@canonical.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 10/10] Documentation: gpio: document configfs interface for gpio-aggregator
Date: Wed, 12 Feb 2025 16:55:24 +0100	[thread overview]
Message-ID: <CAMuHMdXBJhpWht4eo569h0kdY+evi=JTgMQtccUxf2X+tX-QPQ@mail.gmail.com> (raw)
In-Reply-To: <20250203031213.399914-11-koichiro.den@canonical.com>

Hi Den-san.

On Mon, 3 Feb 2025 at 04:14, Koichiro Den <koichiro.den@canonical.com> wrote:
> Add documentation for the newly added configfs-based interface for GPIO
> aggregator.
>
> Signed-off-by: Koichiro Den <koichiro.den@canonical.com>

Thanks for your patch!

> --- a/Documentation/admin-guide/gpio/gpio-aggregator.rst
> +++ b/Documentation/admin-guide/gpio/gpio-aggregator.rst
> @@ -69,6 +69,99 @@ write-only attribute files in sysfs.
>                     $ echo gpio-aggregator.0 > delete_device
>
>
> +Aggregating GPIOs using Configfs
> +--------------------------------
> +
> +**Group:** ``/config/gpio-aggregator``
> +
> +    This is the root directory of the gpio-aggregator configfs tree.
> +
> +**Group:** ``/config/gpio-aggregator/<example-name>``
> +
> +    This directory represents a GPIO aggregator device. You can assign any
> +    name to ``<example-name>`` (e.g., ``agg0``), except names starting with
> +    ``_auto`` prefix, which are reserved for auto-generated configfs
> +    entries corresponding to devices created via Sysfs.
> +
> +**Attribute:** ``/config/gpio-aggregator/<example-name>/live``
> +
> +    The ``live`` attribute allows to trigger the actual creation of the device
> +    once it's fully configured. The accepted values are: ``1`` to enable the
> +    virtual device and ``0`` to disable and tear it down.

As the code uses kstrtobool(), it accepts variants of
yes/true/on/no/false/off, too.

> +
> +**Attribute:** ``/config/gpio-aggregator/<example-name>/dev_name``
> +
> +    The read-only ``dev_name`` attribute exposes the name of the device as it
> +    will appear in the system on the platform bus (e.g. ``gpio-aggregator.0``).
> +    This is useful for identifying a character device for the newly created
> +    aggregator. If it's ``gpio-aggregator.0``,
> +    ``/sys/devices/platform/gpio-aggregator.0/gpiochipX`` path tells you that the
> +    GPIO device id is ``X``.
> +
> +You must create subdirectories for each virtual line you want to
> +instantiate, named exactly as ``line0``, ``line1``, ..., ``lineY``, when
> +you want to instantiate ``Y+1`` (Y >= 0) lines.  Configure all lines before
> +activating the device by setting ``live`` to 1.
> +
> +**Group:** ``/config/gpio-aggregator/<example-name>/<lineY>/``
> +
> +    This directory represents a GPIO line to include in the aggregator.
> +
> +**Attribute:** ``/config/gpio-aggregator/<example-name>/<lineY>/key``
> +
> +**Attribute:** ``/config/gpio-aggregator/<example-name>/<lineY>/offset``
> +
> +    If ``offset`` is >= 0:
> +        * ``key`` specifies the name of the chip this GPIO belongs to
> +        * ``offset`` specifies the line offset within that chip.
> +    If ``offset`` is <0:

Missing space before 0.
Please add "(default)", so the user knows he can skip writing to this
file when specifying a GPIO line name.

> +        * ``key`` needs to specify the GPIO line name.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2025-02-12 15:55 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03  3:12 [PATCH v2 00/10] Introduce configfs-based " Koichiro Den
2025-02-03  3:12 ` [PATCH v2 01/10] gpio: aggregator: reorder functions to prepare for configfs introduction Koichiro Den
2025-02-11 15:48   ` Geert Uytterhoeven
2025-02-03  3:12 ` [PATCH v2 02/10] gpio: aggregator: introduce basic configfs interface Koichiro Den
2025-02-04 12:48   ` Bartosz Golaszewski
2025-02-04 14:41     ` Koichiro Den
2025-02-05 13:39       ` Koichiro Den
2025-02-12 13:48   ` Geert Uytterhoeven
2025-02-13 14:12     ` Koichiro Den
2025-02-13 14:31       ` Geert Uytterhoeven
2025-02-03  3:12 ` [PATCH v2 03/10] gpio: aggregator: add read-only 'dev_name' configfs attribute Koichiro Den
2025-02-04 12:49   ` Bartosz Golaszewski
2025-02-04 14:44     ` Koichiro Den
2025-02-12 14:20   ` Geert Uytterhoeven
2025-02-13 14:13     ` Koichiro Den
2025-02-03  3:12 ` [PATCH v2 04/10] gpio: aggregator: add read-write 'name' attribute Koichiro Den
2025-02-12 14:27   ` Geert Uytterhoeven
2025-02-13 14:13     ` Koichiro Den
2025-02-03  3:12 ` [PATCH v2 05/10] gpio: aggregator: expose custom line names to forwarder gpio_chip Koichiro Den
2025-02-12 14:44   ` Geert Uytterhoeven
2025-02-13 14:13     ` Koichiro Den
2025-02-03  3:12 ` [PATCH v2 06/10] gpio: aggregator: rename 'name' to 'key' in aggr_parse() Koichiro Den
2025-02-12 14:45   ` Geert Uytterhoeven
2025-02-03  3:12 ` [PATCH v2 07/10] gpio: aggregator: clean up gpio_aggregator_free() Koichiro Den
2025-02-12 14:47   ` Geert Uytterhoeven
2025-02-03  3:12 ` [PATCH v2 08/10] gpio: aggregator: expoose aggregator created via legacy sysfs to configfs Koichiro Den
2025-02-04 13:12   ` Bartosz Golaszewski
2025-02-04 14:47     ` Koichiro Den
2025-02-12 15:36   ` Geert Uytterhoeven
2025-02-13 14:15     ` Koichiro Den
2025-02-03  3:12 ` [PATCH v2 09/10] gpio: aggregator: cancel deferred probe for devices created via configfs Koichiro Den
2025-02-04 13:14   ` Bartosz Golaszewski
2025-02-12 15:49     ` Geert Uytterhoeven
2025-02-16 13:15       ` Koichiro Den
2025-02-16 15:58         ` Bartosz Golaszewski
2025-02-17 12:52           ` Koichiro Den
2025-02-03  3:12 ` [PATCH v2 10/10] Documentation: gpio: document configfs interface for gpio-aggregator Koichiro Den
2025-02-12 15:55   ` Geert Uytterhoeven [this message]
2025-02-13 14:17     ` Koichiro Den
2025-02-12 13:14 ` [PATCH v2 00/10] Introduce configfs-based " Geert Uytterhoeven
2025-02-13 14:09   ` Koichiro Den

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='CAMuHMdXBJhpWht4eo569h0kdY+evi=JTgMQtccUxf2X+tX-QPQ@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=brgl@bgdev.pl \
    --cc=koichiro.den@canonical.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.borzecki@canonical.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®