aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch')
-rw-r--r--target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch50
1 files changed, 15 insertions, 35 deletions
diff --git a/target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch b/target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch
index a80482d94a..4d851d05bd 100644
--- a/target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch
+++ b/target/linux/realtek/patches-5.15/711-net-phy-add-an-MDIO-SMBus-library.patch
@@ -120,49 +120,29 @@ Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
--- a/include/linux/mdio/mdio-i2c.h
+++ b/include/linux/mdio/mdio-i2c.h
-@@ -12,5 +12,21 @@ struct i2c_adapter;
+@@ -12,5 +12,8 @@ struct i2c_adapter;
struct mii_bus;
struct mii_bus *mdio_i2c_alloc(struct device *parent, struct i2c_adapter *i2c);
+struct mii_bus *mdio_smbus_alloc(struct device *parent, struct i2c_adapter *i2c);
-+
-+/*
-+ * I2C bus addresses 0x50 and 0x51 are normally an EEPROM, which is
-+ * specified to be present in SFP modules. These correspond with PHY
-+ * addresses 16 and 17. Disallow access to these "phy" addresses.
-+ */
-+static bool i2c_mii_valid_phy_id(int phy_id)
-+{
-+ return phy_id != 0x10 && phy_id != 0x11;
-+}
-+
-+static unsigned int i2c_mii_phy_addr(int phy_id)
-+{
-+ return phy_id + 0x40;
-+}
++bool i2c_mii_valid_phy_id(int phy_id);
++unsigned int i2c_mii_phy_addr(int phy_id);
#endif
--- a/drivers/net/mdio/mdio-i2c.c
+++ b/drivers/net/mdio/mdio-i2c.c
-@@ -13,21 +13,6 @@
- #include <linux/mdio/mdio-i2c.h>
- #include <linux/phy.h>
-
--/*
-- * I2C bus addresses 0x50 and 0x51 are normally an EEPROM, which is
-- * specified to be present in SFP modules. These correspond with PHY
-- * addresses 16 and 17. Disallow access to these "phy" addresses.
-- */
+@@ -18,12 +18,12 @@
+ * specified to be present in SFP modules. These correspond with PHY
+ * addresses 16 and 17. Disallow access to these "phy" addresses.
+ */
-static bool i2c_mii_valid_phy_id(int phy_id)
--{
-- return phy_id != 0x10 && phy_id != 0x11;
--}
--
++bool i2c_mii_valid_phy_id(int phy_id)
+ {
+ return phy_id != 0x10 && phy_id != 0x11;
+ }
+
-static unsigned int i2c_mii_phy_addr(int phy_id)
--{
-- return phy_id + 0x40;
--}
--
- static int i2c_mii_read(struct mii_bus *bus, int phy_id, int reg)
++unsigned int i2c_mii_phy_addr(int phy_id)
{
- struct i2c_adapter *i2c = bus->priv;
+ return phy_id + 0x40;
+ }