]> git.ipfire.org Git - thirdparty/linux.git/commit
net: dsa: microchip: parse PHY config from device tree
authorOleksij Rempel <o.rempel@pengutronix.de>
Wed, 6 Nov 2024 07:59:41 +0000 (08:59 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Nov 2024 00:04:32 +0000 (16:04 -0800)
commit34125ac851b8926a94727e2a20246551fe691551
tree3225efca8e6a60b99b523c0ade1f35463ae98e0b
parentf47e6e1e79a107cd389519da224f10e58bddcee2
net: dsa: microchip: parse PHY config from device tree

Introduce ksz_parse_dt_phy_config() to validate and parse PHY
configuration from the device tree for KSZ switches. This function
ensures proper setup of internal PHYs by checking `phy-handle`
properties, verifying expected PHY IDs, and handling parent node
mismatches. Sets the PHY mask on the MII bus if validation is
successful. Returns -EINVAL on configuration errors.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20241106075942.1636998-7-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/microchip/ksz_common.c