Skip to content

Commit 05a58d3

Browse files
committed
net: renesas: rswitch: add mdio C22 support
JIRA: https://issues.redhat.com/browse/RHEL-78074 commit db48fe9 Author: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Date: Mon Dec 16 12:19:57 2024 +0500 net: renesas: rswitch: add mdio C22 support The generic MPSM operation added by the previous patch can be used both for C45 and C22. Add handlers for C22 operations. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Link: https://patch.msgid.link/20241216071957.2587354-6-nikita.yoush@cogentembedded.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Radu Rendec <rrendec@redhat.com>
1 parent e43216a commit 05a58d3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/net/ethernet/renesas/rswitch.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,23 @@ static int rswitch_etha_mii_write_c45(struct mii_bus *bus, int addr, int devad,
12591259
MPSM_POP_WRITE, val);
12601260
}
12611261

1262+
static int rswitch_etha_mii_read_c22(struct mii_bus *bus, int phyad, int regad)
1263+
{
1264+
struct rswitch_etha *etha = bus->priv;
1265+
1266+
return rswitch_etha_mpsm_op(etha, true, MPSM_MMF_C22, phyad, regad,
1267+
MPSM_POP_READ_C22, 0);
1268+
}
1269+
1270+
static int rswitch_etha_mii_write_c22(struct mii_bus *bus, int phyad,
1271+
int regad, u16 val)
1272+
{
1273+
struct rswitch_etha *etha = bus->priv;
1274+
1275+
return rswitch_etha_mpsm_op(etha, false, MPSM_MMF_C22, phyad, regad,
1276+
MPSM_POP_WRITE, val);
1277+
}
1278+
12621279
/* Call of_node_put(port) after done */
12631280
static struct device_node *rswitch_get_port_node(struct rswitch_device *rdev)
12641281
{
@@ -1341,6 +1358,8 @@ static int rswitch_mii_register(struct rswitch_device *rdev)
13411358
mii_bus->priv = rdev->etha;
13421359
mii_bus->read_c45 = rswitch_etha_mii_read_c45;
13431360
mii_bus->write_c45 = rswitch_etha_mii_write_c45;
1361+
mii_bus->read = rswitch_etha_mii_read_c22;
1362+
mii_bus->write = rswitch_etha_mii_write_c22;
13441363
mii_bus->parent = &rdev->priv->pdev->dev;
13451364

13461365
mdio_np = of_get_child_by_name(rdev->np_port, "mdio");

0 commit comments

Comments
 (0)