The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] dt-bindings: net: pse-pd: microchip,pd692x0: add port disable GPIO
@ 2026-05-07 10:46 Robert Marko
  2026-05-07 10:46 ` [PATCH net-next 2/2] net: pse-pd: pd692x0: support disabling disable ports GPIO Robert Marko
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Marko @ 2026-05-07 10:46 UTC (permalink / raw)
  To: o.rempel, kory.maincent, andrew+netdev, davem, edumazet, kuba,
	pabeni, robh, krzk+dt, conor+dt, netdev, devicetree, linux-kernel
  Cc: luka.perkov, Robert Marko

Microchip PSE controllers have a dedicated port disable input that like it
name suggest, will disable PoE on all ports.

So, lets document that GPIO.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 .../devicetree/bindings/net/pse-pd/microchip,pd692x0.yaml     | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/pse-pd/microchip,pd692x0.yaml b/Documentation/devicetree/bindings/net/pse-pd/microchip,pd692x0.yaml
index 03d9ca1cbcc0..f883dca87bf9 100644
--- a/Documentation/devicetree/bindings/net/pse-pd/microchip,pd692x0.yaml
+++ b/Documentation/devicetree/bindings/net/pse-pd/microchip,pd692x0.yaml
@@ -23,6 +23,10 @@ properties:
   reg:
     maxItems: 1
 
+  disable-ports-gpios:
+    description: GPIO pin to disable PoE on all ports
+    maxItems: 1
+
   vdd-supply:
     description: Regulator that provides 3.3V VDD power supply.
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] net: pse-pd: pd692x0: support disabling disable ports GPIO
  2026-05-07 10:46 [PATCH net-next 1/2] dt-bindings: net: pse-pd: microchip,pd692x0: add port disable GPIO Robert Marko
@ 2026-05-07 10:46 ` Robert Marko
  2026-05-08 12:05   ` Oleksij Rempel
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Marko @ 2026-05-07 10:46 UTC (permalink / raw)
  To: o.rempel, kory.maincent, andrew+netdev, davem, edumazet, kuba,
	pabeni, robh, krzk+dt, conor+dt, netdev, devicetree, linux-kernel
  Cc: luka.perkov, Robert Marko

Microchip PSE controllers have a dedicated disable ports input that like it
name says disables PoE on all ports.

So lets support parsing that GPIO and using the GPIO flags to set it to
output high by default and enable PoE on all ports during probe.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 drivers/net/pse-pd/pd692x0.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c
index 44cf9f97be67..670656abd16f 100644
--- a/drivers/net/pse-pd/pd692x0.c
+++ b/drivers/net/pse-pd/pd692x0.c
@@ -7,6 +7,7 @@
 
 #include <linux/delay.h>
 #include <linux/firmware.h>
+#include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/of.h>
@@ -1781,6 +1782,7 @@ static int pd692x0_i2c_probe(struct i2c_client *client)
 	static const char * const regulators[] = { "vdd", "vdda" };
 	struct pd692x0_msg msg, buf = {0}, zero = {0};
 	struct device *dev = &client->dev;
+	struct gpio_desc *disable_ports;
 	struct pd692x0_msg_ver ver;
 	struct pd692x0_priv *priv;
 	struct fw_upload *fwl;
@@ -1808,6 +1810,11 @@ static int pd692x0_i2c_probe(struct i2c_client *client)
 	priv->client = client;
 	i2c_set_clientdata(client, priv);
 
+	disable_ports = devm_gpiod_get_optional(dev, "disable-ports", GPIOD_OUT_HIGH);
+	if (IS_ERR(disable_ports))
+		return dev_err_probe(&client->dev, PTR_ERR(disable_ports),
+				     "Failed to get disable ports GPIO\n");
+
 	ret = i2c_master_recv(client, (u8 *)&buf, sizeof(buf));
 	if (ret != sizeof(buf)) {
 		dev_err(dev, "Failed to get device status\n");
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 2/2] net: pse-pd: pd692x0: support disabling disable ports GPIO
  2026-05-07 10:46 ` [PATCH net-next 2/2] net: pse-pd: pd692x0: support disabling disable ports GPIO Robert Marko
@ 2026-05-08 12:05   ` Oleksij Rempel
  2026-05-09 12:14     ` Robert Marko
  0 siblings, 1 reply; 4+ messages in thread
From: Oleksij Rempel @ 2026-05-08 12:05 UTC (permalink / raw)
  To: Robert Marko
  Cc: kory.maincent, andrew+netdev, davem, edumazet, kuba, pabeni, robh,
	krzk+dt, conor+dt, netdev, devicetree, linux-kernel, luka.perkov

On Thu, May 07, 2026 at 12:46:55PM +0200, Robert Marko wrote:
> Microchip PSE controllers have a dedicated disable ports input that like it
> name says disables PoE on all ports.
> 
> So lets support parsing that GPIO and using the GPIO flags to set it to
> output high by default and enable PoE on all ports during probe.
> 
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> ---
>  drivers/net/pse-pd/pd692x0.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c
> index 44cf9f97be67..670656abd16f 100644
> --- a/drivers/net/pse-pd/pd692x0.c
> +++ b/drivers/net/pse-pd/pd692x0.c
> @@ -7,6 +7,7 @@
>  
>  #include <linux/delay.h>
>  #include <linux/firmware.h>
> +#include <linux/gpio/consumer.h>
>  #include <linux/i2c.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> @@ -1781,6 +1782,7 @@ static int pd692x0_i2c_probe(struct i2c_client *client)
>  	static const char * const regulators[] = { "vdd", "vdda" };
>  	struct pd692x0_msg msg, buf = {0}, zero = {0};
>  	struct device *dev = &client->dev;
> +	struct gpio_desc *disable_ports;
>  	struct pd692x0_msg_ver ver;
>  	struct pd692x0_priv *priv;
>  	struct fw_upload *fwl;
> @@ -1808,6 +1810,11 @@ static int pd692x0_i2c_probe(struct i2c_client *client)
>  	priv->client = client;
>  	i2c_set_clientdata(client, priv);
>  
> +	disable_ports = devm_gpiod_get_optional(dev, "disable-ports", GPIOD_OUT_HIGH);

I guess this signal is active low. Since gpio framework operates with
logical values, more natural would be here to use GPIOD_OUT_LOW to
signal that disable-ports mode is disabled. And in the devicetree use
GPIO_ACTIVE_LOW.

-- 
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 |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 2/2] net: pse-pd: pd692x0: support disabling disable ports GPIO
  2026-05-08 12:05   ` Oleksij Rempel
@ 2026-05-09 12:14     ` Robert Marko
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Marko @ 2026-05-09 12:14 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: kory.maincent, andrew+netdev, davem, edumazet, kuba, pabeni, robh,
	krzk+dt, conor+dt, netdev, devicetree, linux-kernel, luka.perkov

On Fri, May 8, 2026 at 2:06 PM Oleksij Rempel <o.rempel@pengutronix.de> wrote:
>
> On Thu, May 07, 2026 at 12:46:55PM +0200, Robert Marko wrote:
> > Microchip PSE controllers have a dedicated disable ports input that like it
> > name says disables PoE on all ports.
> >
> > So lets support parsing that GPIO and using the GPIO flags to set it to
> > output high by default and enable PoE on all ports during probe.
> >
> > Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> > ---
> >  drivers/net/pse-pd/pd692x0.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c
> > index 44cf9f97be67..670656abd16f 100644
> > --- a/drivers/net/pse-pd/pd692x0.c
> > +++ b/drivers/net/pse-pd/pd692x0.c
> > @@ -7,6 +7,7 @@
> >
> >  #include <linux/delay.h>
> >  #include <linux/firmware.h>
> > +#include <linux/gpio/consumer.h>
> >  #include <linux/i2c.h>
> >  #include <linux/module.h>
> >  #include <linux/of.h>
> > @@ -1781,6 +1782,7 @@ static int pd692x0_i2c_probe(struct i2c_client *client)
> >       static const char * const regulators[] = { "vdd", "vdda" };
> >       struct pd692x0_msg msg, buf = {0}, zero = {0};
> >       struct device *dev = &client->dev;
> > +     struct gpio_desc *disable_ports;
> >       struct pd692x0_msg_ver ver;
> >       struct pd692x0_priv *priv;
> >       struct fw_upload *fwl;
> > @@ -1808,6 +1810,11 @@ static int pd692x0_i2c_probe(struct i2c_client *client)
> >       priv->client = client;
> >       i2c_set_clientdata(client, priv);
> >
> > +     disable_ports = devm_gpiod_get_optional(dev, "disable-ports", GPIOD_OUT_HIGH);
>
> I guess this signal is active low. Since gpio framework operates with
> logical values, more natural would be here to use GPIOD_OUT_LOW to
> signal that disable-ports mode is disabled. And in the devicetree use
> GPIO_ACTIVE_LOW.

Yeah, you are correct, the signal is active LOW, I will update to your
suggestion in v2.

Regards,
Robert
>
> --
> 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 |



-- 
Robert Marko
Staff Embedded Linux Engineer
Sartura d.d.
Lendavska ulica 16a
10000 Zagreb, Croatia
Email: robert.marko@sartura.hr
Web: www.sartura.hr

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-09 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 10:46 [PATCH net-next 1/2] dt-bindings: net: pse-pd: microchip,pd692x0: add port disable GPIO Robert Marko
2026-05-07 10:46 ` [PATCH net-next 2/2] net: pse-pd: pd692x0: support disabling disable ports GPIO Robert Marko
2026-05-08 12:05   ` Oleksij Rempel
2026-05-09 12:14     ` Robert Marko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox