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

net: dsa: b53: Add phy_enable(), phy_disable() methods

Add phy enable/disable to b53 ops to be called when
enabling/disabling ports.

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20250724035300.20497-2-kylehendrydev@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kyle Hendry and committed by
Jakub Kicinski
be7a7914 33360f25

+8
+6
drivers/net/dsa/b53/b53_common.c
··· 689 689 690 690 cpu_port = dsa_to_port(ds, port)->cpu_dp->index; 691 691 692 + if (dev->ops->phy_enable) 693 + dev->ops->phy_enable(dev, port); 694 + 692 695 if (dev->ops->irq_enable) 693 696 ret = dev->ops->irq_enable(dev, port); 694 697 if (ret) ··· 729 726 b53_read8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), &reg); 730 727 reg |= PORT_CTRL_RX_DISABLE | PORT_CTRL_TX_DISABLE; 731 728 b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), reg); 729 + 730 + if (dev->ops->phy_disable) 731 + dev->ops->phy_disable(dev, port); 732 732 733 733 if (dev->ops->irq_disable) 734 734 dev->ops->irq_disable(dev, port);
+2
drivers/net/dsa/b53/b53_priv.h
··· 45 45 int (*phy_write16)(struct b53_device *dev, int addr, int reg, u16 value); 46 46 int (*irq_enable)(struct b53_device *dev, int port); 47 47 void (*irq_disable)(struct b53_device *dev, int port); 48 + void (*phy_enable)(struct b53_device *dev, int port); 49 + void (*phy_disable)(struct b53_device *dev, int port); 48 50 void (*phylink_get_caps)(struct b53_device *dev, int port, 49 51 struct phylink_config *config); 50 52 struct phylink_pcs *(*phylink_mac_select_pcs)(struct b53_device *dev,