summaryrefslogtreecommitdiff
path: root/drivers/net/phy/mdio-i2c.h
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2017-07-25 17:03:08 +0300
committerDavid S. Miller <davem@davemloft.net>2017-08-07 06:55:28 +0300
commit453d00defba502a48e3f9a218a519b233ff83d16 (patch)
tree399004eb51b90393cd31c2ab03474bbb63a5bc24 /drivers/net/phy/mdio-i2c.h
parent5e5758d9d84256d55da831e940276c3216997f3e (diff)
downloadlinux-453d00defba502a48e3f9a218a519b233ff83d16.tar.xz
net: phy: add I2C mdio bus
Add an I2C MDIO bus bridge library, to allow phylib to access PHYs which are connected to an I2C bus instead of the more conventional MDIO bus. Such PHYs can be found in SFP adapters and SFF modules. Since PHYs appear at I2C bus address 0x40..0x5f, and 0x50/0x51 are reserved for SFP EEPROMs/diagnostics, we must not allow the MDIO bus to access these I2C addresses. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mdio-i2c.h')
-rw-r--r--drivers/net/phy/mdio-i2c.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/phy/mdio-i2c.h b/drivers/net/phy/mdio-i2c.h
new file mode 100644
index 000000000000..889ab57d7f3e
--- /dev/null
+++ b/drivers/net/phy/mdio-i2c.h
@@ -0,0 +1,19 @@
+/*
+ * MDIO I2C bridge
+ *
+ * Copyright (C) 2015 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef MDIO_I2C_H
+#define MDIO_I2C_H
+
+struct device;
+struct i2c_adapter;
+struct mii_bus;
+
+struct mii_bus *mdio_i2c_alloc(struct device *parent, struct i2c_adapter *i2c);
+
+#endif