Skip to content

Commit db48fe9

Browse files
nikita-youshkuba-moo
authored andcommitted
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 <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Tested-by: Yoshihiro Shimoda <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2aa722b commit db48fe9

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
@@ -1253,6 +1253,23 @@ static int rswitch_etha_mii_write_c45(struct mii_bus *bus, int addr, int devad,
12531253
MPSM_POP_WRITE, val);
12541254
}
12551255

1256+
static int rswitch_etha_mii_read_c22(struct mii_bus *bus, int phyad, int regad)
1257+
{
1258+
struct rswitch_etha *etha = bus->priv;
1259+
1260+
return rswitch_etha_mpsm_op(etha, true, MPSM_MMF_C22, phyad, regad,
1261+
MPSM_POP_READ_C22, 0);
1262+
}
1263+
1264+
static int rswitch_etha_mii_write_c22(struct mii_bus *bus, int phyad,
1265+
int regad, u16 val)
1266+
{
1267+
struct rswitch_etha *etha = bus->priv;
1268+
1269+
return rswitch_etha_mpsm_op(etha, false, MPSM_MMF_C22, phyad, regad,
1270+
MPSM_POP_WRITE, val);
1271+
}
1272+
12561273
/* Call of_node_put(port) after done */
12571274
static struct device_node *rswitch_get_port_node(struct rswitch_device *rdev)
12581275
{
@@ -1335,6 +1352,8 @@ static int rswitch_mii_register(struct rswitch_device *rdev)
13351352
mii_bus->priv = rdev->etha;
13361353
mii_bus->read_c45 = rswitch_etha_mii_read_c45;
13371354
mii_bus->write_c45 = rswitch_etha_mii_write_c45;
1355+
mii_bus->read = rswitch_etha_mii_read_c22;
1356+
mii_bus->write = rswitch_etha_mii_write_c22;
13381357
mii_bus->parent = &rdev->priv->pdev->dev;
13391358

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

0 commit comments

Comments
 (0)