mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 10:00:03 -04:00
gpio: sa1100: register software node for GPIO controller
Define and register a static software node (sa1100_gpiochip_node) for the SA-1100 GPIO controller during sa1100_init_gpio(). Assign its firmware node directly to the GPIO chip prior to calling gpiochip_add_data(). This allows StrongARM SA-1100 board setup files to reference the SoC GPIO controller in property entries when converting legacy platform data to software nodes, resolving pin bindings directly via the attached firmware node without relying on name matching. Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20260706-sa1100-swnode-v1-1-332759bbd930@gmail.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
committed by
Arnd Bergmann
parent
9212f660d3
commit
e4671f292e
@@ -48,6 +48,9 @@ int sa11xx_clk_init(void);
|
||||
struct gpiod_lookup_table;
|
||||
void sa11x0_register_pcmcia(int socket, struct gpiod_lookup_table *);
|
||||
|
||||
struct software_node;
|
||||
extern const struct software_node sa1100_gpiochip_node;
|
||||
|
||||
struct fixed_voltage_config;
|
||||
struct regulator_consumer_supply;
|
||||
int sa11x0_register_fixed_regulator(int n, struct fixed_voltage_config *cfg,
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/generic.h>
|
||||
#include <linux/property.h>
|
||||
|
||||
const struct software_node sa1100_gpiochip_node = {
|
||||
.name = "sa1100-gpio",
|
||||
};
|
||||
|
||||
struct sa1100_gpio_chip {
|
||||
struct gpio_chip chip;
|
||||
@@ -317,6 +322,7 @@ static const int sa1100_gpio_irqs[] __initconst = {
|
||||
void __init sa1100_init_gpio(void)
|
||||
{
|
||||
struct sa1100_gpio_chip *sgc = &sa1100_gpio_chip;
|
||||
struct gpio_chip *gc = &sgc->chip;
|
||||
int i;
|
||||
|
||||
/* clear all GPIO edge detects */
|
||||
@@ -324,7 +330,9 @@ void __init sa1100_init_gpio(void)
|
||||
writel_relaxed(0, sgc->membase + R_GRER);
|
||||
writel_relaxed(-1, sgc->membase + R_GEDR);
|
||||
|
||||
gpiochip_add_data(&sa1100_gpio_chip.chip, NULL);
|
||||
software_node_register(&sa1100_gpiochip_node);
|
||||
gc->fwnode = software_node_fwnode(&sa1100_gpiochip_node);
|
||||
gpiochip_add_data(gc, NULL);
|
||||
|
||||
sa1100_gpio_irqdomain = irq_domain_create_simple(NULL,
|
||||
28, IRQ_GPIO0,
|
||||
|
||||
Reference in New Issue
Block a user