From: Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx> PHY devices on an MDIO bus can have their own regulators. This is currently mostly modeled using the semi-standard phy-supply property on the MAC node. This seems to be conceptually wrong though, as the MAC shouldn't need to care about enabling the PHY regulator explicitly. Instead this should be done by the core PHY/MDIO code. This series introduces a new DT property at the PHY node level in mdio.yaml and adds support for PHY regulator, then uses the new property on pumpkin boards. It also addresses several issues I noticed when working on this feature. First four patches are just cosmetic improvements in source files we'll modify later in this series. Patches 5 and 6 modify the way PHY reset handling works. Currently the probe() callback needs to be implemented to take the PHY out of reset but PHY drivers without probe() can have resets defined as well. Patches 7-11 address an issue where we probe the PHY for ID without deasserting its reset signal. We delay the ID read until after the logical device is created and resets have been configured. Last four patches add the new DT property, implement support for PHY regulator in phy and mdio code and set the new property in the DT file for MediaTek's pumpkin boards. Bartosz Golaszewski (15): net: phy: arrange headers in mdio_bus.c alphabetically net: phy: arrange headers in mdio_device.c alphabetically net: phy: arrange headers in phy_device.c alphabetically net: mdio: add a forward declaration for reset_control to mdio.h net: phy: reset the PHY even if probe() is not implemented net: phy: mdio: reset MDIO devices even if probe() is not implemented net: phy: split out the PHY driver request out of phy_device_create() net: phy: check the PHY presence in get_phy_id() net: phy: delay PHY driver probe until PHY registration net: phy: simplify phy_device_create() net: phy: drop get_phy_device() dt-bindings: mdio: add phy-supply property to ethernet phy node net: phy: mdio: add support for PHY supply regulator net: phy: add PHY regulator support ARM64: dts: mediatek: add a phy regulator to pumpkin-common.dtsi .../devicetree/bindings/net/mdio.yaml | 4 + .../boot/dts/mediatek/pumpkin-common.dtsi | 1 + drivers/net/dsa/ocelot/felix_vsc9959.c | 3 +- drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 5 +- .../net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 2 +- drivers/net/ethernet/socionext/netsec.c | 3 +- drivers/net/phy/fixed_phy.c | 2 +- drivers/net/phy/mdio-xgene.c | 2 +- drivers/net/phy/mdio_bus.c | 55 +++-- drivers/net/phy/mdio_device.c | 51 ++++- drivers/net/phy/nxp-tja11xx.c | 2 +- drivers/net/phy/phy_device.c | 216 ++++++++++-------- drivers/net/phy/sfp.c | 2 +- drivers/of/of_mdio.c | 11 +- include/linux/mdio.h | 4 + include/linux/phy.h | 21 +- 16 files changed, 240 insertions(+), 144 deletions(-) -- 2.26.1