summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Marko <robert.marko@sartura.hr>2026-06-07 19:55:36 +0300
committerJakub Kicinski <kuba@kernel.org>2026-06-10 04:52:03 +0300
commit90e63d5354951d37fa2b3b91e6f17b95d2bf9bee (patch)
tree386c4eb62bbb38ce528dca02ec3de95688994458
parenta1c4fa71bbbd10c6a71535a6426444d4a4bc8584 (diff)
downloadlinux-90e63d5354951d37fa2b3b91e6f17b95d2bf9bee.tar.xz
net: pse-pd: pd692x0: support disabling disable ports GPIO
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 low by default and enable PoE on all ports during probe. Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Robert Marko <robert.marko@sartura.hr> Reviewed-by: Kory Maincent <kory.maincent@bootlin.com> Link: https://patch.msgid.link/20260607165600.1260210-2-robert.marko@sartura.hr Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/pse-pd/pd692x0.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c
index 49b1527829ad..cb377d5ba7af 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>
@@ -1757,6 +1758,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;
@@ -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_LOW);
+ 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");