Skip to content

Commit

Permalink
phy: sparx5-serdes: add constant for the number of CMU's
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Machon authored and Vinod Koul committed Oct 21, 2024
1 parent 8e65baf commit 5206ba9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/phy/microchip/sparx5_serdes.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

#include "sparx5_serdes.h"

#define SPX5_CMU_MAX 14

#define SPX5_SERDES_10G_START 13
#define SPX5_SERDES_25G_START 25
#define SPX5_SERDES_6G10G_CNT SPX5_SERDES_25G_START
Expand Down Expand Up @@ -1101,7 +1099,7 @@ static void sparx5_serdes_cmu_power_off(struct sparx5_serdes_private *priv)
int i;

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

Expand Down Expand Up @@ -2512,6 +2510,7 @@ static const struct sparx5_serdes_match_data sparx5_desc = {
.iomap_size = ARRAY_SIZE(sparx5_serdes_iomap),
.consts = {
.sd_max = 33,
.cmu_max = 14,
},
};

Expand Down
1 change: 1 addition & 0 deletions drivers/phy/microchip/sparx5_serdes.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum sparx5_serdes_mode {

struct sparx5_serdes_consts {
int sd_max;
int cmu_max;
};

struct sparx5_serdes_match_data {
Expand Down

0 comments on commit 5206ba9

Please sign in to comment.