From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] MIPS: alchemy: db1000: use nodes attached to GPIO chips in properties
Date: Mon, 09 Mar 2026 23:11:59 -0700 [thread overview]
Message-ID: <20260309-alchemy-v1-2-f55e9dc60ba1@gmail.com> (raw)
In-Reply-To: <20260309-alchemy-v1-0-f55e9dc60ba1@gmail.com>
GPIO subsystem is switching the way it locates GPIO chip instances for
GPIO references in software nodes by doing identity matching instead of
matching on node names. Switch to using software nodes attached to gpio
chips instead of using freestanding software nodes.
Also stop supplying platform data for the spi-gpio controller since
spi-gpio driver can derive number of chipselect lines from device
properties.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
arch/mips/alchemy/devboards/db1000.c | 36 +++++++++++-------------------------
1 file changed, 11 insertions(+), 25 deletions(-)
diff --git a/arch/mips/alchemy/devboards/db1000.c b/arch/mips/alchemy/devboards/db1000.c
index 6984cd5169b5..d9dffacc5f5a 100644
--- a/arch/mips/alchemy/devboards/db1000.c
+++ b/arch/mips/alchemy/devboards/db1000.c
@@ -19,7 +19,6 @@
#include <linux/property.h>
#include <linux/pm.h>
#include <linux/spi/spi.h>
-#include <linux/spi/spi_gpio.h>
#include <asm/mach-au1x00/au1000.h>
#include <asm/mach-au1x00/gpio-au1000.h>
#include <asm/mach-au1x00/au1000_dma.h>
@@ -375,20 +374,14 @@ static struct platform_device db1100_mmc1_dev = {
/******************************************************************************/
-static const struct software_node db1100_alchemy2_gpiochip = {
- .name = "alchemy-gpio2",
-};
-
-static const struct property_entry db1100_ads7846_properties[] = {
- PROPERTY_ENTRY_U16("ti,vref_min", 3300),
- PROPERTY_ENTRY_GPIO("pendown-gpios",
- &db1100_alchemy2_gpiochip, 21, GPIO_ACTIVE_LOW),
- { }
-};
-
static const struct software_node db1100_ads7846_swnode = {
.name = "ads7846",
- .properties = db1100_ads7846_properties,
+ .properties = (const struct property_entry[]){
+ PROPERTY_ENTRY_U16("ti,vref_min", 3300),
+ PROPERTY_ENTRY_GPIO("pendown-gpios",
+ &alchemy_gpio2_node, 21, GPIO_ACTIVE_LOW),
+ { }
+ },
};
static struct spi_board_info db1100_spi_info[] __initdata = {
@@ -403,32 +396,26 @@ static struct spi_board_info db1100_spi_info[] __initdata = {
},
};
-static const struct spi_gpio_platform_data db1100_spictl_pd __initconst = {
- .num_chipselect = 1,
-};
-
/*
* Alchemy GPIO 2 has its base at 200 so the GPIO lines
* 207 thru 210 are GPIOs at offset 7 thru 10 at this chip.
*/
static const struct property_entry db1100_spi_dev_properties[] __initconst = {
PROPERTY_ENTRY_GPIO("miso-gpios",
- &db1100_alchemy2_gpiochip, 7, GPIO_ACTIVE_HIGH),
+ &alchemy_gpio2_node, 7, GPIO_ACTIVE_HIGH),
PROPERTY_ENTRY_GPIO("mosi-gpios",
- &db1100_alchemy2_gpiochip, 8, GPIO_ACTIVE_HIGH),
+ &alchemy_gpio2_node, 8, GPIO_ACTIVE_HIGH),
PROPERTY_ENTRY_GPIO("sck-gpios",
- &db1100_alchemy2_gpiochip, 9, GPIO_ACTIVE_HIGH),
+ &alchemy_gpio2_node, 9, GPIO_ACTIVE_HIGH),
PROPERTY_ENTRY_GPIO("cs-gpios",
- &db1100_alchemy2_gpiochip, 10, GPIO_ACTIVE_HIGH),
+ &alchemy_gpio2_node, 10, GPIO_ACTIVE_HIGH),
{ }
};
static const struct platform_device_info db1100_spi_dev_info __initconst = {
.name = "spi_gpio",
.id = 0,
- .data = &db1100_spictl_pd,
- .size_data = sizeof(db1100_spictl_pd),
- .dma_mask = DMA_BIT_MASK(32),
+ .dma_mask = DMA_BIT_MASK(32),
.properties = db1100_spi_dev_properties,
};
@@ -481,7 +468,6 @@ int __init db1000_dev_setup(void)
pfc |= (1 << 0); /* SSI0 pins as GPIOs */
alchemy_wrsys(pfc, AU1000_SYS_PINFUNC);
- software_node_register(&db1100_alchemy2_gpiochip);
spi_register_board_info(db1100_spi_info,
ARRAY_SIZE(db1100_spi_info));
--
2.53.0.473.g4a7958ca14-goog
next prev parent reply other threads:[~2026-03-10 6:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 6:11 [PATCH 0/4] MIPS: alchemy: attach software nodes to GPIO controllers and use properties Dmitry Torokhov
2026-03-10 6:11 ` [PATCH 1/4] MIPS: alchemy: mtx1: attach software nodes to GPIO chips Dmitry Torokhov
2026-03-10 6:11 ` Dmitry Torokhov [this message]
2026-03-10 6:12 ` [PATCH 3/4] MIPS: alchemy: gpr: switch to static device properties Dmitry Torokhov
2026-03-10 6:12 ` [PATCH 4/4] MIPS: alchemy: db1300: " Dmitry Torokhov
2026-04-30 9:30 ` [PATCH 0/4] MIPS: alchemy: attach software nodes to GPIO controllers and use properties 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-alchemy-v1-2-f55e9dc60ba1@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=tsbogend@alpha.franken.de \
/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).