[PATCH 0/9] gpio: make gpiolib-shared more fwnode-centric
From: Bartosz Golaszewski
Date: Wed Nov 04 2026 - 09:04:38 EST
Currently the code in gpiolib-shared.c only supports OF nodes and uses a
lot of OF-specific APIs. This series attempts to make the code more
generic, ahead of extending support for sharing GPIOs to other types of
firmware nodes, by defining two new fwnode operations, implementing them
for OF nodes and using them in GPIOLIB in order to limit the OF-specific
API usage to only a few places guarded by ifdefs.
The new fwnode APIs are:
a) property_get_names() - this closes the gap between OF nodes and
fwnodes: OF nodes allow users to iterate over all properties while
fwnodes don't advertise all properties in any way at the moment
b) count_references() - there's currently no way of counting references
in an fwnode reliably: using fwnode_property_get_reference_args()
does not work for empty references (e.g.: phandle = <0>, <&foo 1 2>;)
The first patch is a fix to fwnode_name_eq(). The second adds a CLASS()
for string arrays. The following 6 define and implement new fwnode
operations. The final patch generalizes the code in gpiolib-shared.c.
Merging strategy: patches 1-8 should go through the driver core tree and
be provided on an immutable branch to me so that I can pull it and queue
the final patch via the GPIO tree.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
---
Bartosz Golaszewski (9):
device property: fix fwnode_name_eq() for empty node names
lib: string_helpers: implement a CLASS() for string arrays
fwnode: define the property_get_names() operation
device property: provide fwnode_property_get_names()
of: property: implement the .property_get_names() fwnode operation
fwnode: define the count_references() fwnode operation
device property: provide fwnode_property_count_references()
of: property: implement the count_references() fwnode operation
gpio: shared: generalize most code to firmware nodes
drivers/base/property.c | 114 ++++++++++++++++++-
drivers/gpio/gpiolib-shared.c | 241 ++++++++++++++++++++++-------------------
drivers/of/property.c | 37 +++++++
include/linux/fwnode.h | 15 +++
include/linux/property.h | 4 +
include/linux/string_helpers.h | 12 ++
6 files changed, 312 insertions(+), 111 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20260916-fwnode-for-each-prop-d7a6f90e7338
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>