]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: pcs: xpcs: Move native device ID macro to linux/pcs/pcs-xpcs.h
authorSerge Semin <fancer.lancer@gmail.com>
Mon, 1 Jul 2024 18:28:32 +0000 (21:28 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jul 2024 08:35:49 +0000 (09:35 +0100)
One of the next commits will alter the DW XPCS driver to support setting a
custom device ID for the particular MDIO-device detected on the platform.
The generic DW XPCS ID can be used as a custom ID as well in case if the
DW XPCS-device was erroneously synthesized with no or some undefined ID.
In addition to that having all supported DW XPCS device IDs defined in a
single place will improve the code maintainability and readability.

Note while at it rename the macros to being shorter and looking alike to
the already defined NXP XPCS ID macro.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pcs/pcs-xpcs.c
drivers/net/pcs/pcs-xpcs.h
include/linux/pcs/pcs-xpcs.h

index 31525fe9c32e98ead81031d4c0da59b17ed0d4bf..99adbf15ab360703bb240f32cda4af33a77e05d5 100644 (file)
@@ -1343,16 +1343,16 @@ static const struct xpcs_compat nxp_sja1110_xpcs_compat[DW_XPCS_INTERFACE_MAX] =
 
 static const struct xpcs_id xpcs_id_list[] = {
        {
-               .id = SYNOPSYS_XPCS_ID,
-               .mask = SYNOPSYS_XPCS_MASK,
+               .id = DW_XPCS_ID,
+               .mask = DW_XPCS_ID_MASK,
                .compat = synopsys_xpcs_compat,
        }, {
                .id = NXP_SJA1105_XPCS_ID,
-               .mask = SYNOPSYS_XPCS_MASK,
+               .mask = DW_XPCS_ID_MASK,
                .compat = nxp_sja1105_xpcs_compat,
        }, {
                .id = NXP_SJA1110_XPCS_ID,
-               .mask = SYNOPSYS_XPCS_MASK,
+               .mask = DW_XPCS_ID_MASK,
                .compat = nxp_sja1110_xpcs_compat,
        },
 };
index 96c36b32ca99eda5d898eaaacbde716e5067dd06..369e9196f45a5f521f983ed4ed8a6649137bb310 100644 (file)
@@ -6,9 +6,6 @@
  * Author: Jose Abreu <Jose.Abreu@synopsys.com>
  */
 
-#define SYNOPSYS_XPCS_ID               0x7996ced0
-#define SYNOPSYS_XPCS_MASK             0xffffffff
-
 /* Vendor regs access */
 #define DW_VENDOR                      BIT(15)
 
index da3a6c30f6d245daf948347bbcf706714c3bad85..8dfe90295f125e67c35ef964cd467e0711e5e7c3 100644 (file)
@@ -12,6 +12,8 @@
 
 #define NXP_SJA1105_XPCS_ID            0x00000010
 #define NXP_SJA1110_XPCS_ID            0x00000020
+#define DW_XPCS_ID                     0x7996ced0
+#define DW_XPCS_ID_MASK                        0xffffffff
 
 /* AN mode */
 #define DW_AN_C73                      1