From: Bartosz Golaszewski <brgl@kernel.org>
To: Linus Walleij <linusw@kernel.org>
Cc: linux-mips@vger.kernel.org, linux-input@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-mtd@lists.infradead.org,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Bartosz Golaszewski <brgl@kernel.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH 1/2] MIPS/input: Move RB532 button to GPIO descriptors
Date: Mon, 30 Mar 2026 02:12:00 -0700 [thread overview]
Message-ID: <CAMRc=Mct_F-LPAsvsHWxS1SeT+SBXQ7opikmf33eR7tz_5tJwA@mail.gmail.com> (raw)
In-Reply-To: <20260328-mips-input-rb532-button-v1-1-98e201621501@kernel.org>
On Sat, 28 Mar 2026 16:55:47 +0100, Linus Walleij <linusw@kernel.org> said:
> Convert the Mikrotik RouterBoard RB532 to use GPIO descriptors
> by defining a software node for the GPIO chip, then register
> the button platform device with full info passing the GPIO
> as a device property.
>
> This can be used as a base to move more of the RB532 devices
> over to passing GPIOs using device properties.
>
> Use the GPIO_ACTIVE_LOW flag and drop the inversion in the
> rb532_button_pressed() function.
>
> Signed-off-by: Linus Walleij <linusw@kernel.org>
> ---
> arch/mips/rb532/devices.c | 47 +++++++++++++++++++++++++++++++++------
> drivers/input/misc/rb532_button.c | 35 ++++++++++++++++++++++++-----
> 2 files changed, 69 insertions(+), 13 deletions(-)
>
> diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
> index 4f027efbf27b..3f56d9feb73a 100644
> --- a/arch/mips/rb532/devices.c
> +++ b/arch/mips/rb532/devices.c
> @@ -16,8 +16,10 @@
> #include <linux/mtd/mtd.h>
> #include <linux/gpio.h>
> #include <linux/gpio/machine.h>
> +#include <linux/gpio/property.h>
> #include <linux/gpio_keys.h>
> #include <linux/input.h>
> +#include <linux/property.h>
> #include <linux/serial_8250.h>
>
> #include <asm/bootinfo.h>
> @@ -38,6 +40,10 @@ extern unsigned int idt_cpu_freq;
>
> static struct mpmc_device dev3;
>
> +static const struct software_node rb532_gpio0_node = {
> + .name = "gpio0",
> +};
> +
Hi Linus!
I'm seeing patches from you lately using the pattern of "dangling software"
nodes that's documented under Documentation/driver-api/gpio/board.rst as the
recommended approach but which I have been trying to come up with a better
alternetive for and eventually phase out. I will post a series providing a way
to automatically assign software nodes as secondary firmware nodes for devices
and this series will also remove the offending bits from the docs.
As you're dealing with a board file here: could you assign the firmware node
you get after registering this software node to the target GPIO controller
under arch/mips/rb532/gpio.c so that the firmware node lookup can work by
matching the address rather than falling back to the label string matching?
Thanks,
Bartosz
next prev parent reply other threads:[~2026-03-30 9:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-28 15:55 [PATCH 0/2] MIPS RB532 GPIO descriptor conversion Linus Walleij
2026-03-28 15:55 ` [PATCH 1/2] MIPS/input: Move RB532 button to GPIO descriptors Linus Walleij
2026-03-29 22:38 ` Dmitry Torokhov
2026-03-30 9:12 ` Bartosz Golaszewski [this message]
2026-03-28 15:55 ` [PATCH 2/2] MIPS/mtd: Handle READY GPIO in generic NAND platform data Linus Walleij
2026-03-30 8:04 ` Miquel Raynal
2026-04-13 13:43 ` [PATCH 0/2] MIPS RB532 GPIO descriptor conversion Thomas Bogendoerfer
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='CAMRc=Mct_F-LPAsvsHWxS1SeT+SBXQ7opikmf33eR7tz_5tJwA@mail.gmail.com' \
--to=brgl@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=tsbogend@alpha.franken.de \
--cc=vigneshr@ti.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).