git: 9de43130f989 - main - regulator_fixed: add support for 'gpios' property

From: Michal Meloun <mmel_at_FreeBSD.org>
Date: Sun, 22 Feb 2026 17:53:55 UTC
The branch main has been updated by mmel:

URL: https://cgit.FreeBSD.org/src/commit/?id=9de43130f989896d92dda22ed73ca3033863efd7

commit 9de43130f989896d92dda22ed73ca3033863efd7
Author:     Michal Meloun <mmel@FreeBSD.org>
AuthorDate: 2025-11-06 19:37:14 +0000
Commit:     Michal Meloun <mmel@FreeBSD.org>
CommitDate: 2026-02-22 17:53:28 +0000

    regulator_fixed: add support for 'gpios' property
    
    This is a newer version of the "gpio" property.
    
    MFC after:      3 weeks
---
 sys/dev/regulator/regulator_fixed.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/sys/dev/regulator/regulator_fixed.c b/sys/dev/regulator/regulator_fixed.c
index 55cdb5e4aeae..148bd28cdd16 100644
--- a/sys/dev/regulator/regulator_fixed.c
+++ b/sys/dev/regulator/regulator_fixed.c
@@ -380,6 +380,7 @@ regfix_parse_fdt(struct regfix_softc * sc)
 {
 	phandle_t node;
 	int rv;
+	char *name;
 	struct regnode_init_def *init_def;
 
 	node = ofw_bus_get_node(sc->dev);
@@ -405,15 +406,21 @@ regfix_parse_fdt(struct regfix_softc * sc)
 	if (OF_hasprop(node, "gpio-open-drain"))
 		sc->init_def.gpio_open_drain = true;
 
-	if (!OF_hasprop(node, "gpio"))
-		return (0);
-	rv = ofw_bus_parse_xref_list_alloc(node, "gpio", "#gpio-cells", 0,
-	    &sc->gpio_prodxref, &sc->gpio_ncells, &sc->gpio_cells);
+	if (OF_hasprop(node, "gpio"))
+		name = "gpio";
+	else if (OF_hasprop(node, "gpios"))
+		name = "gpios";
+	else
+		return(0);
+
+	rv = ofw_bus_parse_xref_list_alloc(node, name, "#gpio-cells",
+	    0, &sc->gpio_prodxref, &sc->gpio_ncells, &sc->gpio_cells);
 	if (rv != 0) {
 		sc->gpio_prodxref = 0;
-		device_printf(sc->dev, "Malformed gpio property\n");
+		device_printf(sc->dev, "Malformed gpios property\n");
 		return (ENXIO);
 	}
+
 	return (0);
 }