* [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; 5+ 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] 5+ 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 2026-05-08 17:14 ` sashiko-bot 0 siblings, 2 replies; 5+ 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] 5+ 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 2026-05-08 17:14 ` sashiko-bot 1 sibling, 1 reply; 5+ 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] 5+ 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; 5+ 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] 5+ 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-08 17:14 ` sashiko-bot 1 sibling, 0 replies; 5+ messages in thread From: sashiko-bot @ 2026-05-08 17:14 UTC (permalink / raw) To: Robert Marko; +Cc: robh, conor+dt, krzk+dt, devicetree Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] The driver requests the 'disable-ports' GPIO with `GPIOD_OUT_HIGH`, which logically asserts the disable signal, contradicting the goal of enabling PoE. -- commit bef0e9b8a1213b027391963a1e52c45fae73be60 Author: Robert Marko <robert.marko@sartura.hr> net: pse-pd: pd692x0: support disabling disable ports GPIO This commit adds support for parsing a disable-ports GPIO in the Microchip PSE controller driver. It attempts to set this GPIO to output high by default to enable PoE on all ports during probe. > diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c > --- a/drivers/net/pse-pd/pd692x0.c > +++ b/drivers/net/pse-pd/pd692x0.c [ ... ] > @@ -1780,6 +1782,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); Will requesting this GPIO with GPIOD_OUT_HIGH actually disable the ports instead of enabling them? The gpiod API operates on logical states rather than physical voltage levels. By requesting a GPIO named disable-ports with GPIOD_OUT_HIGH, the disable signal is logically asserted. This activates the disable condition and turns off PoE on the ports. To de-assert the disable signal and enable PoE as intended, should this be requested with GPIOD_OUT_LOW instead? > + 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)); -- Sashiko AI review · https://sashiko.dev/#/patchset/20260507104720.262641-1-robert.marko@sartura.hr?part=2 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-09 12:15 UTC | newest] Thread overview: 5+ 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 2026-05-08 17:14 ` sashiko-bot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox