[PATCH v1 07/10] gpio: add Microchip SGPIO (serial GPIO) driver

Sascha Hauer s.hauer at pengutronix.de
Mon Jun 15 00:32:46 PDT 2026


On 2026-06-12 07:59, Oleksij Rempel wrote:
> Add a driver for the Microchip Serial GPIO (SGPIO) controller used on
> the sparx5 / LAN969X switch SoCs to drive LED chains and per-port
> signals (SFP TX-disable, presence detect, etc.).
> 
> Ported from Linux drivers/pinctrl/pinctrl-microchip-sgpio.c at tag
> v7.1-rc7.
> 
> barebox doesn't carry the full Linux pinctrl subsystem, so the driver
> is placed under drivers/gpio/ and exposes only the GPIO/output subset;
> the pin-claim and IRQ paths from the Linux source are dropped.
> 
> Signed-off-by: Oleksij Rempel <o.rempel at pengutronix.de>
> ---
>  drivers/gpio/Kconfig                |   8 +
>  drivers/gpio/Makefile               |   1 +
>  drivers/gpio/gpio-microchip-sgpio.c | 464 ++++++++++++++++++++++++++++
>  3 files changed, 473 insertions(+)
>  create mode 100644 drivers/gpio/gpio-microchip-sgpio.c
> 

> +
> +static int microchip_sgpio_probe(struct device *dev)
> +{
> +	struct sgpio_priv *priv;
> +	struct reset_control *reset;
> +	struct clk *clk;
> +	struct resource *iores;
> +	void __iomem *base;
> +	int ret, port;
> +	u32 div_clock, val;
> +
> +	if (of_device_is_compatible(dev->of_node, "microchip,sparx5-sgpio-bank"))
> +		return microchip_sgpio_bank_probe(dev);

I think it would be cleaner just to register two drivers instead of
repurposing a single driver for something different.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list