Skip to content

Commit f37bee9

Browse files
fancerdavem330
authored andcommitted
net: pcs: xpcs: Move native device ID macro to linux/pcs/pcs-xpcs.h
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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 390b14b commit f37bee9

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

drivers/net/pcs/pcs-xpcs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,16 +1343,16 @@ static const struct xpcs_compat nxp_sja1110_xpcs_compat[DW_XPCS_INTERFACE_MAX] =
13431343

13441344
static const struct xpcs_id xpcs_id_list[] = {
13451345
{
1346-
.id = SYNOPSYS_XPCS_ID,
1347-
.mask = SYNOPSYS_XPCS_MASK,
1346+
.id = DW_XPCS_ID,
1347+
.mask = DW_XPCS_ID_MASK,
13481348
.compat = synopsys_xpcs_compat,
13491349
}, {
13501350
.id = NXP_SJA1105_XPCS_ID,
1351-
.mask = SYNOPSYS_XPCS_MASK,
1351+
.mask = DW_XPCS_ID_MASK,
13521352
.compat = nxp_sja1105_xpcs_compat,
13531353
}, {
13541354
.id = NXP_SJA1110_XPCS_ID,
1355-
.mask = SYNOPSYS_XPCS_MASK,
1355+
.mask = DW_XPCS_ID_MASK,
13561356
.compat = nxp_sja1110_xpcs_compat,
13571357
},
13581358
};

drivers/net/pcs/pcs-xpcs.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
* Author: Jose Abreu <[email protected]>
77
*/
88

9-
#define SYNOPSYS_XPCS_ID 0x7996ced0
10-
#define SYNOPSYS_XPCS_MASK 0xffffffff
11-
129
/* Vendor regs access */
1310
#define DW_VENDOR BIT(15)
1411

include/linux/pcs/pcs-xpcs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#define NXP_SJA1105_XPCS_ID 0x00000010
1414
#define NXP_SJA1110_XPCS_ID 0x00000020
15+
#define DW_XPCS_ID 0x7996ced0
16+
#define DW_XPCS_ID_MASK 0xffffffff
1517

1618
/* AN mode */
1719
#define DW_AN_C73 1

0 commit comments

Comments
 (0)