From nobody Wed Dec 17 07:32:11 2025 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EC7B24A04C; Wed, 16 Apr 2025 13:45:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744811103; cv=none; b=QiiO38YOLTKTNzEaEunzm3xEUfqdouUHHiQxSwQz33dAv+Av+tA/iP3D9K/bUZ3WLUfCrqGg3eNsULWDni0w0OSElsktMeC2IeEZz1fOHXcbvXqDN3rEoB5sSMFd3kgE7mp9oZzPAvkDaKZxpOzSC/H9YwxZmTeuN9RiIwVChrk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744811103; c=relaxed/simple; bh=fN68wFW+Q66Yde3T7GiPb70QZM/v05mEijLD8XUj75I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NmUEGiTW5sk+WU1WTQ4K0HvjT53UVCe0xOiA7UDPWW7c8+0gGMMV14KwxeX4on2cGJufmNvo+c9f4XeA4L5hP69hDRN1bkhSjba/8+WRMwbRMjrw6D/NUxDNXcFhjtUUKpeeRppTDNSLm8857vLcoxLFe7O3aAqQdBBi91vZoNA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=LK4R/gfx; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="LK4R/gfx" Received: by mail.gandi.net (Postfix) with ESMTPSA id E514043920; Wed, 16 Apr 2025 13:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744811099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=77Jjs/0bsmhIoinBMTM0h0vyZLJuM1IvY0/zaBIcGbM=; b=LK4R/gfxePUiqQNxGWhgczmUvVen9sovJcNHwsOFRcF/ChOzesrGwqmZFp3fm73k6KbT8W E1YX64h5Co4WtwPA9CdOCBT1pZCnTZNZqY1L0gH7Nczz1awFMMN5HzQ+C53QxWwqHrLkd2 aZDzpy9S78LQ4ql5C7mSpN+GnEpRuIWSmqsjwwydY4l6CdABacPPvbHly1Xt7SWuesjC67 CFbv6ShBkjleB3NIWCwlCVTtQnynqLu2AK3Kmt1yLwHK4wneMUas7yuf/5VL98Ezk8EpnO TISQ10eALnUReV9U/x0CHH2O8U32W/XFKYyJXYZrVhAEIX2y1KgzwGxa/uqISQ== From: Kory Maincent Date: Wed, 16 Apr 2025 15:44:25 +0200 Subject: [PATCH net-next v8 10/13] net: pse-pd: pd692x0: Add support for controller and manager power supplies Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250416-feature_poe_port_prio-v8-10-446c39dc3738@bootlin.com> References: <20250416-feature_poe_port_prio-v8-0-446c39dc3738@bootlin.com> In-Reply-To: <20250416-feature_poe_port_prio-v8-0-446c39dc3738@bootlin.com> To: Andrew Lunn , Oleksij Rempel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Donald Hunter , Rob Herring , Andrew Lunn , Simon Horman , Heiner Kallweit , Russell King , Krzysztof Kozlowski , Conor Dooley Cc: Liam Girdwood , Mark Brown , Thomas Petazzoni , netdev@vger.kernel.org, linux-doc@vger.kernel.org, Kyle Swenson , Dent Project , kernel@pengutronix.de, Maxime Chevallier , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Kory Maincent (Dent Project)" X-Mailer: b4 0.15-dev-8cb71 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdeiheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepmfhorhihucforghinhgtvghnthcuoehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeevgfdvgfektefgfefggeekudfggffhtdfffedtueetheejtddvledvvdelhedtveenucfkphepledtrdekledrudeifedruddvjeenucevlhhushhtvghrufhiiigvpeeknecurfgrrhgrmhepihhnvghtpeeltddrkeelrdduieefrdduvdejpdhhvghloheplgduvdejrddtrddurddungdpmhgrihhlfhhrohhmpehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvjedprhgtphhtthhopehrohgshheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegurghvvghmsegurghvvghmlhhofhhtrdhnvghtpdhrtghpthhtohephhhkrghllhifvghithdusehgmhgrihhlrdgtohhmpdhrtghpthhtohepkhgvrhhnvghlsehpvghnghhuthhrohhnihigrdguvgdprhgtphhtthhopehhohhrmhhssehkvghrn hgvlhdrohhrghdprhgtphhtthhopehordhrvghmphgvlhesphgvnhhguhhtrhhonhhigidruggvpdhrtghpthhtohepughonhgrlhgurdhhuhhnthgvrhesghhmrghilhdrtghomh X-GND-Sasl: kory.maincent@bootlin.com From: Kory Maincent (Dent Project) Add support for managing the VDD and VDDA power supplies for the PD692x0 PSE controller, as well as the VAUX5 and VAUX3P3 power supplies for the PD6920x PSE managers. Signed-off-by: Kory Maincent (Dent Project) Reviewed-by: Oleksij Rempel --- Changes in v5: - New patch --- drivers/net/pse-pd/pd692x0.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c index a4766c18f333..4de004813560 100644 --- a/drivers/net/pse-pd/pd692x0.c +++ b/drivers/net/pse-pd/pd692x0.c @@ -976,8 +976,10 @@ pd692x0_register_managers_regulator(struct pd692x0_pri= v *priv, reg_name_len =3D strlen(dev_name(dev)) + 23; =20 for (i =3D 0; i < nmanagers; i++) { + static const char * const regulators[] =3D { "vaux5", "vaux3p3" }; struct regulator_dev *rdev; char *reg_name; + int ret; =20 reg_name =3D devm_kzalloc(dev, reg_name_len, GFP_KERNEL); if (!reg_name) @@ -988,6 +990,17 @@ pd692x0_register_managers_regulator(struct pd692x0_pri= v *priv, if (IS_ERR(rdev)) return PTR_ERR(rdev); =20 + /* VMAIN is described as main supply for the manager. + * Add other VAUX power supplies and link them to the + * virtual device rdev->dev. + */ + ret =3D devm_regulator_bulk_get_enable(&rdev->dev, + ARRAY_SIZE(regulators), + regulators); + if (ret) + return dev_err_probe(&rdev->dev, ret, + "Failed to enable regulators\n"); + priv->manager_reg[i] =3D rdev; } =20 @@ -1640,6 +1653,7 @@ static const struct fw_upload_ops pd692x0_fw_ops =3D { =20 static int pd692x0_i2c_probe(struct i2c_client *client) { + static const char * const regulators[] =3D { "vdd", "vdda" }; struct pd692x0_msg msg, buf =3D {0}, zero =3D {0}; struct device *dev =3D &client->dev; struct pd692x0_msg_ver ver; @@ -1647,6 +1661,12 @@ static int pd692x0_i2c_probe(struct i2c_client *clie= nt) struct fw_upload *fwl; int ret; =20 + ret =3D devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(regulators), + regulators); + if (ret) + return dev_err_probe(dev, ret, + "Failed to enable regulators\n"); + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_err(dev, "i2c check functionality failed\n"); return -ENXIO; --=20 2.34.1