[PATCH net-next v14 10/13] net: mdio: realtek-rtl9300: Open up C22 and C45 space in parallel
Markus Stockhausen <[email protected]>
| Newsgroups | org.kernel.vger.linux-devicetree,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
Until now the MDIO driver supports either access to the C22 or to the C45 address space of the PHYs. This is due to the fact that the polling configuration favours one of the address spaces and limits access to the other space. E.g. when polling is set to C22 most of the C45 space can not be accessed. There are however some exceptions from that. EEE register access is allowed independently from the polling mode [1]. As the downstream driver already allows parallel C22/C45 access [2] do this in upstream too. [1] https://github.com/openwrt/openwrt/blob/main/target/linux/realtek/files-6.18/drivers/net/phy/realtek/realtek_multiport.c#L349 [2] https://github.com/openwrt/openwrt/blob/main/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c#L1072 Signed-off-by: Markus Stockhausen <[email protected]> --- drivers/net/mdio/mdio-realtek-rtl9300.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/mdio/mdio-realtek-rtl9300.c b/drivers/net/mdio/mdio-realtek-rtl9300.c index f3777c61705a..c417a2e3d613 100644 --- a/drivers/net/mdio/mdio-realtek-rtl9300.c +++ b/drivers/net/mdio/mdio-realtek-rtl9300.c @@ -683,13 +683,10 @@ static int otto_emdio_probe_one(struct device *dev, struct otto_emdio_priv *priv return -ENOMEM; bus->name = "Realtek Switch MDIO Bus"; - if (priv->smi_bus_is_c45[mdio_bus]) { - bus->read_c45 = otto_emdio_read_c45; - bus->write_c45 = otto_emdio_write_c45; - } else { - bus->read = otto_emdio_read_c22; - bus->write = otto_emdio_write_c22; - } + bus->read_c45 = otto_emdio_read_c45; + bus->write_c45 = otto_emdio_write_c45; + bus->read = otto_emdio_read_c22; + bus->write = otto_emdio_write_c22; bus->parent = dev; bus->notify_phy_attach = otto_emdio_notify_phy_attach; bus->notify_phy_detach = otto_emdio_notify_phy_detach; -- 2.55.0