Skip to content

Commit

Permalink
net: dsa: sja1105: adapt to struct packed_field_8
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Oltean <[email protected]>
  • Loading branch information
vladimiroltean authored and jacob-keller committed Sep 6, 2024
1 parent 25e2d5f commit dcab922
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
14 changes: 7 additions & 7 deletions drivers/net/dsa/sja1105/sja1105_clocking.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct sja1105_cgu_mii_ctrl {
u8 pd;
};

static const struct packed_field sja1105_cgu_idiv_fields[] = {
static const struct packed_field_8 sja1105_cgu_idiv_fields[] = {
PACKED_FIELD(28, 24, struct sja1105_cgu_idiv, clksrc),
PACKED_FIELD(11, 11, struct sja1105_cgu_idiv, autoblock),
PACKED_FIELD(5, 2, struct sja1105_cgu_idiv, idiv),
Expand Down Expand Up @@ -137,7 +137,7 @@ static int sja1105_cgu_idiv_config(struct sja1105_private *priv, int port,
SJA1105_SIZE_CGU_CMD);
}

static const struct packed_field sja1105_cgu_mii_ctrl_fields[] = {
static const struct packed_field_8 sja1105_cgu_mii_ctrl_fields[] = {
PACKED_FIELD(28, 24, struct sja1105_cgu_mii_ctrl, clksrc),
PACKED_FIELD(11, 11, struct sja1105_cgu_mii_ctrl, autoblock),
PACKED_FIELD(0, 0, struct sja1105_cgu_mii_ctrl, pd),
Expand Down Expand Up @@ -322,7 +322,7 @@ static int sja1105_mii_clocking_setup(struct sja1105_private *priv, int port,
return 0;
}

static const struct packed_field sja1105_cgu_pll_ctrl_fields[] = {
static const struct packed_field_8 sja1105_cgu_pll_ctrl_fields[] = {
PACKED_FIELD(28, 24, struct sja1105_cgu_pll_ctrl, pllclksrc),
PACKED_FIELD(23, 16, struct sja1105_cgu_pll_ctrl, msel),
PACKED_FIELD(11, 11, struct sja1105_cgu_pll_ctrl, autoblock),
Expand Down Expand Up @@ -372,7 +372,7 @@ static int sja1105_cgu_rgmii_tx_clk_config(struct sja1105_private *priv,
}

/* AGU */
static const struct packed_field sja1105_cfg_pad_mii_fields[] = {
static const struct packed_field_8 sja1105_cfg_pad_mii_fields[] = {
PACKED_FIELD(28, 27, struct sja1105_cfg_pad_mii, d32_os),
PACKED_FIELD(26, 26, struct sja1105_cfg_pad_mii, d32_ih),
PACKED_FIELD(25, 24, struct sja1105_cfg_pad_mii, d32_ipud),
Expand Down Expand Up @@ -457,7 +457,7 @@ static int sja1105_cfg_pad_rx_config(struct sja1105_private *priv, int port)
SJA1105_SIZE_CGU_CMD);
}

static const struct packed_field sja1105_cfg_pad_mii_id_fields[] = {
static const struct packed_field_8 sja1105_cfg_pad_mii_id_fields[] = {
PACKED_FIELD(15, 15, struct sja1105_cfg_pad_mii_id, rxc_stable_ovr),
PACKED_FIELD(14, 10, struct sja1105_cfg_pad_mii_id, rxc_delay),
PACKED_FIELD(9, 9, struct sja1105_cfg_pad_mii_id, rxc_bypass),
Expand All @@ -468,7 +468,7 @@ static const struct packed_field sja1105_cfg_pad_mii_id_fields[] = {
PACKED_FIELD(0, 0, struct sja1105_cfg_pad_mii_id, txc_pd),
};

static const struct packed_field sja1110_cfg_pad_mii_id_fields[] = {
static const struct packed_field_8 sja1110_cfg_pad_mii_id_fields[] = {
PACKED_FIELD(26, 26, struct sja1105_cfg_pad_mii_id, rxc_stable_ovr),
PACKED_FIELD(25, 21, struct sja1105_cfg_pad_mii_id, rxc_delay),
PACKED_FIELD(20, 18, struct sja1105_cfg_pad_mii_id, rxc_range),
Expand Down Expand Up @@ -822,7 +822,7 @@ int sja1105_clocking_setup(struct sja1105_private *priv)
return 0;
}

static const struct packed_field sja1110_cgu_outclk_fields[] = {
static const struct packed_field_8 sja1110_cgu_outclk_fields[] = {
PACKED_FIELD(27, 24, struct sja1110_cgu_outclk, clksrc),
PACKED_FIELD(11, 11, struct sja1110_cgu_outclk, autoblock),
PACKED_FIELD(0, 0, struct sja1110_cgu_outclk, pd),
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/dsa/sja1105/sja1105_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ enum sja1105_ptp_clk_mode {
#define ptp_data_to_sja1105(d) \
container_of((d), struct sja1105_private, ptp_data)

static const struct packed_field sja1105et_ptp_cmd_fields[] = {
static const struct packed_field_8 sja1105et_ptp_cmd_fields[] = {
PACKED_FIELD(31, 31, struct sja1105_ptp_cmd, valid),
PACKED_FIELD(30, 30, struct sja1105_ptp_cmd, ptpstrtsch),
PACKED_FIELD(29, 29, struct sja1105_ptp_cmd, ptpstopsch),
Expand All @@ -69,7 +69,7 @@ static const struct packed_field sja1105et_ptp_cmd_fields[] = {
PACKED_FIELD(0, 0, struct sja1105_ptp_cmd, ptpclkadd),
};

static const struct packed_field sja1105pqrs_ptp_cmd_fields[] = {
static const struct packed_field_8 sja1105pqrs_ptp_cmd_fields[] = {
PACKED_FIELD(31, 31, struct sja1105_ptp_cmd, valid),
PACKED_FIELD(30, 30, struct sja1105_ptp_cmd, ptpstrtsch),
PACKED_FIELD(29, 29, struct sja1105_ptp_cmd, ptpstopsch),
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/sja1105/sja1105_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct sja1105_chunk {
u64 reg_addr;
};

static const struct packed_field sja1105_spi_message_fields[] = {
static const struct packed_field_8 sja1105_spi_message_fields[] = {
PACKED_FIELD(31, 31, struct sja1105_spi_message, access),
PACKED_FIELD(30, 25, struct sja1105_spi_message, read_count),
PACKED_FIELD(24, 4, struct sja1105_spi_message, address),
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/dsa/sja1105/sja1105_static_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,9 @@ void sja1105_packing(void *buf, u64 *val, int start, int end,
size_t len, enum packing_op op);

#define sja1105_pack_fields(buf, len, ustruct, fields) \
pack_fields((buf), (len), (ustruct), (fields), ARRAY_SIZE(fields), \
QUIRK_LSW32_IS_FIRST)
pack_fields_m((buf), (len), (ustruct), (fields), QUIRK_LSW32_IS_FIRST)
#define sja1105_unpack_fields(buf, len, ustruct, fields) \
unpack_fields((buf), (len), (ustruct), (fields), ARRAY_SIZE(fields), \
QUIRK_LSW32_IS_FIRST)
unpack_fields_m((buf), (len), (ustruct), (fields), QUIRK_LSW32_IS_FIRST)

/* Common implementations for the static and dynamic configs */
size_t sja1105pqrs_general_params_entry_packing(void *buf, void *entry_ptr,
Expand Down

0 comments on commit dcab922

Please sign in to comment.