Skip to content

Commit

Permalink
net: pcs: xpcs: Move native device ID macro to linux/pcs/pcs-xpcs.h
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
fancer authored and davem330 committed Jul 5, 2024
1 parent 390b14b commit f37bee9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions drivers/net/pcs/pcs-xpcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/pcs/pcs-xpcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
* Author: Jose Abreu <[email protected]>
*/

#define SYNOPSYS_XPCS_ID 0x7996ced0
#define SYNOPSYS_XPCS_MASK 0xffffffff

/* Vendor regs access */
#define DW_VENDOR BIT(15)

Expand Down
2 changes: 2 additions & 0 deletions include/linux/pcs/pcs-xpcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f37bee9

Please sign in to comment.