aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/lan9303_i2c.c
diff options
context:
space:
mode:
authorEgil Hjelmeland <privat@egil-hjelmeland.no>2017-07-30 19:58:56 +0200
committerDavid S. Miller <davem@davemloft.net>2017-07-30 19:23:29 -0700
commit2c3408986c07515abcbad5dc584a33892e3621da (patch)
tree98338ed0c8b39e3c60a06a406620d0b23137e756 /drivers/net/dsa/lan9303_i2c.c
parentnet: dsa: lan9303: Renamed indirect phy access functions (diff)
downloadlinux-dev-2c3408986c07515abcbad5dc584a33892e3621da.tar.xz
linux-dev-2c3408986c07515abcbad5dc584a33892e3621da.zip
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>
Diffstat (limited to 'drivers/net/dsa/lan9303_i2c.c')
-rw-r--r--drivers/net/dsa/lan9303_i2c.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/dsa/lan9303_i2c.c b/drivers/net/dsa/lan9303_i2c.c
index ab3ce0da5071..24ec20f7f444 100644
--- a/drivers/net/dsa/lan9303_i2c.c
+++ b/drivers/net/dsa/lan9303_i2c.c
@@ -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;