linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Add support for software nodes to gpiolib
@ 2022-11-04  6:10 Dmitry Torokhov
  2022-11-04  6:10 ` [PATCH 1/6] gpiolib: of: change of_find_gpio() to accept device node Dmitry Torokhov
                   ` (8 more replies)
  0 siblings, 9 replies; 23+ messages in thread
From: Dmitry Torokhov @ 2022-11-04  6:10 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko
  Cc: linux-acpi, linux-gpio, linux-kernel

This series attempts to add support for software nodes to gpiolib, using
software node references. This allows us to convert more drivers to the
generic device properties and drop support for custom platform data.

To describe a GPIO via software nodes we can create the following data
items:

/* Node representing the GPIO controller/GPIO bank */
static const struct software_node gpio_bank_b_node = {
        .name = "B",
};

/*
 * Properties that will be assigned to a software node assigned to
 * the devicei that used platform data.
 */
static const struct property_entry simone_key_enter_props[] = {
        PROPERTY_ENTRY_U32("linux,code", KEY_ENTER),
        PROPERTY_ENTRY_STRING("label", "enter"),
        PROPERTY_ENTRY_REF("gpios", &gpio_bank_b_node, 123, GPIO_ACTIVE_LOW),
        { }
};

The code in gpiolib handling software nodes uses the name in the
software node representing GPIO controller to locate the actual instance
of GPIO controller.

Note that kbuild robot is likely to complain about this patchset because
it depends on patches removing [devm_]gpiod_get_from_of_node() and
devm_fwnode_get_[index_]gpiod_from_child() APIs that are still pending.
I pushed them to

git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git tmp-gpiolib

for your reference.

To: Linus Walleij <linus.walleij@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-acpi@vger.kernel.org

---
Dmitry Torokhov (6):
      gpiolib: of: change of_find_gpio() to accept device node
      gpiolib: acpi: change acpi_find_gpio() to accept firmware node
      gpiolib: acpi: teach acpi_find_gpio() to handle data-only nodes
      gpiolib: acpi: avoid leaking ACPI details into upper gpiolib layers
      gpiolib: consolidate GPIO lookups
      gpiolib: add support for software nodes

 drivers/gpio/Makefile         |   1 +
 drivers/gpio/gpiolib-acpi.c   | 132 +++++++++++++----------
 drivers/gpio/gpiolib-acpi.h   |  54 +---------
 drivers/gpio/gpiolib-of.c     |  52 +--------
 drivers/gpio/gpiolib-of.h     |  16 +--
 drivers/gpio/gpiolib-swnode.c | 106 +++++++++++++++++++
 drivers/gpio/gpiolib-swnode.h |  13 +++
 drivers/gpio/gpiolib.c        | 239 ++++++++++++++++++++----------------------
 8 files changed, 316 insertions(+), 297 deletions(-)
---
base-commit: dc04f5ab1b1114aa19b9026f816fc01ca9c9941d
change-id: 20221031-gpiolib-swnode-948203f49b23

-- 
Dmitry


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-11-08 10:56 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-04  6:10 [PATCH 0/6] Add support for software nodes to gpiolib Dmitry Torokhov
2022-11-04  6:10 ` [PATCH 1/6] gpiolib: of: change of_find_gpio() to accept device node Dmitry Torokhov
2022-11-04  6:10 ` [PATCH 2/6] gpiolib: acpi: change acpi_find_gpio() to accept firmware node Dmitry Torokhov
2022-11-04  6:10 ` [PATCH 3/6] gpiolib: acpi: teach acpi_find_gpio() to handle data-only nodes Dmitry Torokhov
2022-11-04  6:10 ` [PATCH 4/6] gpiolib: acpi: avoid leaking ACPI details into upper gpiolib layers Dmitry Torokhov
2022-11-04  6:10 ` [PATCH 5/6] gpiolib: consolidate GPIO lookups Dmitry Torokhov
2022-11-04 17:17   ` Andy Shevchenko
2022-11-04 18:52     ` Dmitry Torokhov
2022-11-04 21:06       ` Andy Shevchenko
2022-11-05  4:56         ` Dmitry Torokhov
2022-11-07 10:44           ` Andy Shevchenko
2022-11-04  6:10 ` [PATCH 6/6] gpiolib: add support for software nodes Dmitry Torokhov
2022-11-04 18:08   ` Andy Shevchenko
2022-11-04 19:33     ` Dmitry Torokhov
2022-11-04 20:57       ` Andy Shevchenko
2022-11-05  4:48         ` Dmitry Torokhov
2022-11-07 11:08           ` Andy Shevchenko
2022-11-07 16:12             ` Dmitry Torokhov
2022-11-07 20:59               ` Andy Shevchenko
2022-11-07 21:02                 ` Andy Shevchenko
2022-11-04 15:50 ` [PATCH 0/6] Add support for software nodes to gpiolib Bartosz Golaszewski
2022-11-04 17:18 ` Andy Shevchenko
2022-11-08 10:55 ` Linus Walleij

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 NNTP newsgroup(s).