From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Kent Gibson <warthog618@gmail.com>,
Vincent Fazio <vfazio@xes-inc.com>,
Alexander Dahl <post@lespocky.de>
Cc: brgl@kernel.org, linux-gpio@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: [PATCH 0/2] tools: provide a shared library with high-level functions used by gpio-tools
Date: Wed, 13 May 2026 13:47:11 +0200 [thread overview]
Message-ID: <20260513-tools-common-shared-lib-v1-0-58ac28a9f1d5@oss.qualcomm.com> (raw)
The API of libgpiod v2 is a bit more limited than that of v1. Notably:
the whole category of high-level helpers as well as functions allowing
to look up lines and chips by names/labels have been removed and replaced
by low-level interfaces which require users to implement the look-up
logic locally.
It's been requested several times that equivalents of these functions
should be provided in some form. I don't want to expose more
functionality in libgpiod core API than what the linux kernel uAPI
provides. However, the gpio-tools already contain a shared library -
tools-common - which implements the bulk of the desired functions in a
new form.
This series splits out parts of tools-common into a new shared library:
libgpiotools, and reuses it in tools-common while keeping the existing
interface facing the gpio-tools in order to not have to adapt them to
the new API.
Kent: I allowed myself to change the license of the factored out code to
LGPL-v2.1-or-later to enable linking against libgpiotools in line with
libgpiod and other shared libraries from this project. Your Ack would be
appreciated.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Bartosz Golaszewski (2):
tools: provide the libgpiotools shared library
tools: reuse libgpiotools
docs/Doxyfile | 1 +
docs/gpio_tools.rst | 16 ++
docs/gpio_tools_lib.rst | 12 ++
meson.build | 3 +
tools/gpiotools.c | 437 ++++++++++++++++++++++++++++++++++++++++++++++++
tools/gpiotools.h | 236 ++++++++++++++++++++++++++
tools/meson.build | 28 +++-
tools/tools-common.c | 316 ++++------------------------------
tools/tools-common.h | 63 +------
9 files changed, 772 insertions(+), 340 deletions(-)
---
base-commit: 5eed939e0d544afa311a4dd6dac90833d38d7d29
change-id: 20260311-tools-common-shared-lib-97b58de050e2
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
next reply other threads:[~2026-05-13 11:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 11:47 Bartosz Golaszewski [this message]
2026-05-13 11:47 ` [PATCH 1/2] tools: provide the libgpiotools shared library Bartosz Golaszewski
2026-05-13 11:47 ` [PATCH 2/2] tools: reuse libgpiotools Bartosz Golaszewski
2026-05-13 15:18 ` [PATCH 0/2] tools: provide a shared library with high-level functions used by gpio-tools Kent Gibson
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=20260513-tools-common-shared-lib-v1-0-58ac28a9f1d5@oss.qualcomm.com \
--to=bartosz.golaszewski@oss.qualcomm.com \
--cc=brgl@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=post@lespocky.de \
--cc=vfazio@xes-inc.com \
--cc=warthog618@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox