Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: pse-pd: pd692x0: Add support for controller and manager power supplies

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) <kory.maincent@bootlin.com>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20250617-feature_poe_port_prio-v14-10-78a1a645e2ee@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kory Maincent (Dent Project) and committed by
Jakub Kicinski
24a4e3a0 35975401

+20
+20
drivers/net/pse-pd/pd692x0.c
··· 976 976 reg_name_len = strlen(dev_name(dev)) + 23; 977 977 978 978 for (i = 0; i < nmanagers; i++) { 979 + static const char * const regulators[] = { "vaux5", "vaux3p3" }; 979 980 struct regulator_dev *rdev; 980 981 char *reg_name; 982 + int ret; 981 983 982 984 reg_name = devm_kzalloc(dev, reg_name_len, GFP_KERNEL); 983 985 if (!reg_name) ··· 989 987 manager[i].node); 990 988 if (IS_ERR(rdev)) 991 989 return PTR_ERR(rdev); 990 + 991 + /* VMAIN is described as main supply for the manager. 992 + * Add other VAUX power supplies and link them to the 993 + * virtual device rdev->dev. 994 + */ 995 + ret = devm_regulator_bulk_get_enable(&rdev->dev, 996 + ARRAY_SIZE(regulators), 997 + regulators); 998 + if (ret) 999 + return dev_err_probe(&rdev->dev, ret, 1000 + "Failed to enable regulators\n"); 992 1001 993 1002 priv->manager_reg[i] = rdev; 994 1003 } ··· 1653 1640 1654 1641 static int pd692x0_i2c_probe(struct i2c_client *client) 1655 1642 { 1643 + static const char * const regulators[] = { "vdd", "vdda" }; 1656 1644 struct pd692x0_msg msg, buf = {0}, zero = {0}; 1657 1645 struct device *dev = &client->dev; 1658 1646 struct pd692x0_msg_ver ver; 1659 1647 struct pd692x0_priv *priv; 1660 1648 struct fw_upload *fwl; 1661 1649 int ret; 1650 + 1651 + ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(regulators), 1652 + regulators); 1653 + if (ret) 1654 + return dev_err_probe(dev, ret, 1655 + "Failed to enable regulators\n"); 1662 1656 1663 1657 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 1664 1658 dev_err(dev, "i2c check functionality failed\n");