Skip to content

Commit 5206ba9

Browse files
Danielmachonvinodkoul
authored andcommitted
phy: sparx5-serdes: add constant for the number of CMU's
The number of CMU's differ for Sparx5 and lan969x, so add a new field: cmu_max and use it throughout. Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com> Link: https://lore.kernel.org/r/20240909-sparx5-lan969x-serdes-driver-v2-3-d695bcb57b84@microchip.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 8e65baf commit 5206ba9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/phy/microchip/sparx5_serdes.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
#include "sparx5_serdes.h"
2323

24-
#define SPX5_CMU_MAX 14
25-
2624
#define SPX5_SERDES_10G_START 13
2725
#define SPX5_SERDES_25G_START 25
2826
#define SPX5_SERDES_6G10G_CNT SPX5_SERDES_25G_START
@@ -1101,7 +1099,7 @@ static void sparx5_serdes_cmu_power_off(struct sparx5_serdes_private *priv)
11011099
int i;
11021100

11031101
/* Power down each CMU */
1104-
for (i = 0; i < SPX5_CMU_MAX; i++) {
1102+
for (i = 0; i < priv->data->consts.cmu_max; i++) {
11051103
cmu_inst = sdx5_inst_get(priv, TARGET_SD_CMU, i);
11061104
cmu_cfg_inst = sdx5_inst_get(priv, TARGET_SD_CMU_CFG, i);
11071105

@@ -2512,6 +2510,7 @@ static const struct sparx5_serdes_match_data sparx5_desc = {
25122510
.iomap_size = ARRAY_SIZE(sparx5_serdes_iomap),
25132511
.consts = {
25142512
.sd_max = 33,
2513+
.cmu_max = 14,
25152514
},
25162515
};
25172516

drivers/phy/microchip/sparx5_serdes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ enum sparx5_serdes_mode {
2828

2929
struct sparx5_serdes_consts {
3030
int sd_max;
31+
int cmu_max;
3132
};
3233

3334
struct sparx5_serdes_match_data {

0 commit comments

Comments
 (0)