From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org
Subject: [PATCH v4 0/6] Add support for software nodes to gpiolib
Date: Fri, 11 Nov 2022 14:19:02 -0800 [thread overview]
Message-ID: <20221031-gpiolib-swnode-v4-0-6c1671890027@gmail.com> (raw)
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 device 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.
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
---
Changes in v4:
- Rebased on top of next-20221111
- Added Andy's reviewed-by for patch #6
- Link to v3: https://lore.kernel.org/r/20221031-gpiolib-swnode-v3-0-0282162b0fa4@gmail.com
Changes in v3:
- Addressed more Andy's comments
- Link to v2: https://lore.kernel.org/r/20221031-gpiolib-swnode-v2-0-81f55af5fa0e@gmail.com
Changes in v2:
- reworked the series to be independent of other in-flight patches.
That meant keeping devm_gpiod_get_from_of_node() for now.
- removed handling of secondary nodes, it deserves a separate patch
series
- fixed refcounting when handling swnodes (Andy)
- added include/linux/gpio/property.h with PROPERTY_ENTRY_GPIO (Andy)
- addressed most of the rest of Andy's comments
- collected reviewed-by and acked-by
- Link to v1: https://lore.kernel.org/r/20221031-gpiolib-swnode-v1-0-a0ab48d229c7@gmail.com
---
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 | 7 +-
drivers/gpio/gpiolib-of.h | 4 +-
drivers/gpio/gpiolib-swnode.c | 123 +++++++++++++++++++++++++
drivers/gpio/gpiolib-swnode.h | 14 +++
drivers/gpio/gpiolib.c | 209 ++++++++++++++++--------------------------
include/linux/gpio/property.h | 11 +++
9 files changed, 315 insertions(+), 240 deletions(-)
---
base-commit: f8f60f322f0640c8edda2942ca5f84b7a27c417a
change-id: 20221031-gpiolib-swnode-948203f49b23
--
Dmitry
next reply other threads:[~2022-11-11 22:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-11 22:19 Dmitry Torokhov [this message]
2022-11-11 22:19 ` [PATCH v4 1/6] gpiolib: of: change of_find_gpio() to accept device node Dmitry Torokhov
2022-11-11 22:19 ` [PATCH v4 2/6] gpiolib: acpi: change acpi_find_gpio() to accept firmware node Dmitry Torokhov
2022-11-11 22:19 ` [PATCH v4 3/6] gpiolib: acpi: teach acpi_find_gpio() to handle data-only nodes Dmitry Torokhov
2022-11-11 22:19 ` [PATCH v4 4/6] gpiolib: acpi: avoid leaking ACPI details into upper gpiolib layers Dmitry Torokhov
2022-11-11 22:19 ` [PATCH v4 5/6] gpiolib: consolidate GPIO lookups Dmitry Torokhov
2022-11-13 13:07 ` Andy Shevchenko
2022-11-15 10:26 ` Bartosz Golaszewski
2022-11-11 22:19 ` [PATCH v4 6/6] gpiolib: add support for software nodes Dmitry Torokhov
2022-11-15 10:28 ` [PATCH v4 0/6] Add support for software nodes to gpiolib Bartosz Golaszewski
2022-11-15 23:19 ` Dmitry Torokhov
2022-11-16 8:08 ` Andy Shevchenko
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=20221031-gpiolib-swnode-v4-0-6c1671890027@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.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 NNTP newsgroup(s).