summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2018-11-10 00:39:14 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-22 12:47:17 +0100
commitd1e6bbd9d77163013d01827a18e593a271ea9d6a (patch)
tree6ad24b9d29daf2a276861824dd293d2eb7799e12 /include/linux
parent00d9e212b8a39e6ffcf31b9d2e503d2bf6009d45 (diff)
downloadlinux-stable-d1e6bbd9d77163013d01827a18e593a271ea9d6a.tar.gz
linux-stable-d1e6bbd9d77163013d01827a18e593a271ea9d6a.tar.bz2
linux-stable-d1e6bbd9d77163013d01827a18e593a271ea9d6a.zip
net: phy: add macros for PHYID matching
[ Upstream commit aa2af2eb447c9a21c8c9e8d2336672bb620cf900 ] Add macros for PHYID matching to be used in PHY driver configs. By using these macros some boilerplate code can be avoided. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Stable-dep-of: 69ff53e4a4c9 ("net: phy: meson-gxl: use MMD access dummy stubs for GXL, internal PHY") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/phy.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 42766e7179d3..86a3792c568c 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -667,6 +667,10 @@ struct phy_driver {
#define PHY_ANY_ID "MATCH ANY PHY"
#define PHY_ANY_UID 0xffffffff
+#define PHY_ID_MATCH_EXACT(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 0)
+#define PHY_ID_MATCH_MODEL(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 4)
+#define PHY_ID_MATCH_VENDOR(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 10)
+
/* A Structure for boards to register fixups with the PHY Lib */
struct phy_fixup {
struct list_head list;