net: dsa: lan9303: MDIO access phy registers directly
Indirect access (PMI) to phy register only work in I2C mode. In MDIO mode phy registers must be accessed directly. Introduced struct lan9303_phy_ops to handle the two modes. Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
9e866e5dab
commit
2c3408986c
@@ -63,6 +63,8 @@ static int lan9303_i2c_probe(struct i2c_client *client,
|
||||
i2c_set_clientdata(client, sw_dev);
|
||||
sw_dev->chip.dev = &client->dev;
|
||||
|
||||
sw_dev->chip.ops = &lan9303_indirect_phy_ops;
|
||||
|
||||
ret = lan9303_probe(&sw_dev->chip, client->dev.of_node);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user