From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
To: Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Frank Rowand <frowand.list@gmail.com>,
Mika Westerberg <westeri@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Aaro Koskinen <aaro.koskinen@iki.fi>,
Janusz Krzysztofik <jmkrzyszt@gmail.com>,
Tony Lindgren <tony@atomide.com>,
Russell King <linux@armlinux.org.uk>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-omap@vger.kernel.org, linux-doc@vger.kernel.org,
brgl@kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
stable@vger.kernel.org,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Kevin Hilman <khilman@baylibre.com>
Subject: [PATCH v2 0/6] gpiolib: unify gpio-hog code
Date: Mon, 09 Mar 2026 13:42:36 +0100 [thread overview]
Message-ID: <20260309-gpio-hog-fwnode-v2-0-4e61f3dbf06a@oss.qualcomm.com> (raw)
GPIO hogs are handled separately in three places: for OF, ACPI and
machine lookup. In addition hogs cannot be set up using software nodes.
A lot of that code is actually redundant and - except for some special
handling of OF nodes - can be unified in one place.
This series moves hogging into GPIO core and bases it on fwnode API
(with a single helper from OF to translate devicetree properties into
lookup flags), converts the two remaining users of machine hogs to using
software node approach and removes machine hog support entirely. In
addition, there's a patch extending the configurability of gpio-sim now
that it uses software nodes for hogs.
For merging: I think this should go through the GPIO tree with an Ack
from OMAP1 maintainers.
Even with the new feature for gpio-sim, this series still removes twice
the number of lines, it adds.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Changes in v2:
- reduce the leakage of OF APIs into GPIO core by replacing
of_phandle_args with fwnode_reference_args
- fix return value check in patch 2/6
- shrink code in patch 2/6
- don't allow #gpio-cells to be 0
- extend commit message of patch 6/6 to explain the need for this new
feature
- Link to v1: https://patch.msgid.link/20260305-gpio-hog-fwnode-v1-0-97d7df6bbd17@oss.qualcomm.com
---
Bartosz Golaszewski (6):
gpio: of: clear OF_POPULATED on hog nodes in remove path
gpio: move hogs into GPIO core
gpio: sim: use fwnode-based GPIO hogs
ARM: omap1: ams-delta: convert GPIO hogs to using firmware nodes
gpio: remove machine hogs
gpio: sim: allow to define the active-low setting of a simulated hog
Documentation/driver-api/gpio/board.rst | 16 ---
arch/arm/mach-omap1/board-ams-delta.c | 32 ++++-
drivers/gpio/gpio-sim.c | 200 +++++++++++++++-----------------
drivers/gpio/gpiolib-acpi-core.c | 70 -----------
drivers/gpio/gpiolib-of.c | 152 ++++--------------------
drivers/gpio/gpiolib-of.h | 10 ++
drivers/gpio/gpiolib.c | 137 +++++++++++++---------
drivers/gpio/gpiolib.h | 3 +
include/linux/gpio/machine.h | 33 ------
9 files changed, 238 insertions(+), 415 deletions(-)
---
base-commit: a0ae2a256046c0c5d3778d1a194ff2e171f16e5f
change-id: 20260224-gpio-hog-fwnode-b46a53196253
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
next reply other threads:[~2026-03-09 12:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 12:42 Bartosz Golaszewski [this message]
2026-03-09 12:42 ` [PATCH v2 1/6] gpio: of: clear OF_POPULATED on hog nodes in remove path Bartosz Golaszewski
2026-03-09 12:42 ` [PATCH v2 2/6] gpio: move hogs into GPIO core Bartosz Golaszewski
2026-03-24 16:16 ` Geert Uytterhoeven
2026-03-09 12:42 ` [PATCH v2 3/6] gpio: sim: use fwnode-based GPIO hogs Bartosz Golaszewski
2026-03-09 12:42 ` [PATCH v2 4/6] ARM: omap1: ams-delta: convert GPIO hogs to using firmware nodes Bartosz Golaszewski
2026-03-09 12:42 ` [PATCH v2 5/6] gpio: remove machine hogs Bartosz Golaszewski
2026-05-20 0:46 ` Dmitry Torokhov
2026-05-20 5:27 ` Dmitry Torokhov
2026-05-20 6:55 ` Bartosz Golaszewski
2026-03-09 12:42 ` [PATCH v2 6/6] gpio: sim: allow to define the active-low setting of a simulated hog Bartosz Golaszewski
2026-03-16 9:11 ` [PATCH v2 0/6] gpiolib: unify gpio-hog code Bartosz Golaszewski
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=20260309-gpio-hog-fwnode-v2-0-4e61f3dbf06a@oss.qualcomm.com \
--to=bartosz.golaszewski@oss.qualcomm.com \
--cc=aaro.koskinen@iki.fi \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@kernel.org \
--cc=corbet@lwn.net \
--cc=frowand.list@gmail.com \
--cc=geert+renesas@glider.be \
--cc=jmkrzyszt@gmail.com \
--cc=khilman@baylibre.com \
--cc=linusw@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mika.westerberg@linux.intel.com \
--cc=skhan@linuxfoundation.org \
--cc=stable@vger.kernel.org \
--cc=tony@atomide.com \
--cc=westeri@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 read-only IMAP folder(s) and NNTP newsgroup(s).