summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-11-11 09:44:14 -0800
committerDavid S. Miller <davem@davemloft.net>2018-11-11 09:44:14 -0800
commitd1ce01144e75c82bc3c036863f57ac3029354429 (patch)
tree2cea320dadd703511276288db1c08a67a8d88276 /include
parentfa28a2b244a90158319dcc3bc2e21970f32160e0 (diff)
parentca49493633fc3f50836cc6ee690721f2c3527084 (diff)
downloadlinux-d1ce01144e75c82bc3c036863f57ac3029354429.tar.bz2
Merge branch 'PHYID-matching-macros'
Heiner Kallweit says: ==================== net: phy: add macros for PHYID matching in PHY driver config Add macros for PHYID matching to be used in PHY driver configs. By using these macros some boilerplate code can be avoided. Use them initially in the Realtek PHY drivers. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-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 17d1f64723e4..03005c65e02d 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -651,6 +651,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;