diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2020-06-30 13:06:02 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-07-05 16:22:33 +0200 |
commit | 5a38c49c3dafe2323c23b07f883df6e904cf86ba (patch) | |
tree | 24231899b94e1a877ecff956198ccc02f196e128 /drivers | |
parent | c6114a600b284d3ef8b1255e7127815c49d20c9d (diff) | |
download | barebox-5a38c49c3dafe2323c23b07f883df6e904cf86ba.tar.gz barebox-5a38c49c3dafe2323c23b07f883df6e904cf86ba.tar.xz |
net: phy: add uapi/linux/mdio.h from kernel for MDIO MMD access
The headerfile is used in the kernel for access of MDIO Managed Devices
(MMD) indirect access. Some drivers already use those device addresses.
We add the headerfile from the kernel and change the current users to
use the defines instead
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/dp83867.c | 3 | ||||
-rw-r--r-- | drivers/net/phy/micrel.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 8e6f198ca2..929a407b09 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -18,9 +18,10 @@ #include <linux/phy.h> #include <dt-bindings/net/ti-dp83867.h> +#include <linux/mdio.h> #define DP83867_PHY_ID 0x2000a231 -#define DP83867_DEVADDR 0x1f +#define DP83867_DEVADDR MDIO_MMD_VEND2 #define MII_DP83867_PHYCTRL 0x10 #define MII_DP83867_MICR 0x12 diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index c13f80cf40..4655430573 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -17,6 +17,7 @@ #include <linux/mii.h> #include <linux/ethtool.h> #include <linux/phy.h> +#include <linux/mdio.h> #include <linux/micrel_phy.h> #include <linux/bitfield.h> @@ -221,7 +222,7 @@ static int ksz9031_of_load_skew_values(struct phy_device *phydev, return 0; if (matches < numfields) - newval = phy_read_mmd_indirect(phydev, reg, 2); + newval = phy_read_mmd_indirect(phydev, reg, MDIO_MMD_WIS); else newval = 0; @@ -235,7 +236,7 @@ static int ksz9031_of_load_skew_values(struct phy_device *phydev, << (field_sz * i)); } - phy_write_mmd_indirect(phydev, reg, 2, newval); + phy_write_mmd_indirect(phydev, reg, MDIO_MMD_WIS, newval); return 0; } |