Skip to content

Commit

Permalink
net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared register la…
Browse files Browse the repository at this point in the history
…yout

All known R-Car Gen4 SoC share the same register layout, rename the
R-Car S4 specific identifiers so they can be shared with the upcoming
R-Car V4H support.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Niklas Söderlund authored and Paolo Abeni committed Nov 23, 2023
1 parent 9f39957 commit 46c361a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/renesas/rcar_gen4_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "rcar_gen4_ptp.h"
#define ptp_to_priv(ptp) container_of(ptp, struct rcar_gen4_ptp_private, info)

static const struct rcar_gen4_ptp_reg_offset s4_offs = {
static const struct rcar_gen4_ptp_reg_offset gen4_offs = {
.enable = PTPTMEC,
.disable = PTPTMDC,
.increment = PTPTIVC0,
Expand Down Expand Up @@ -133,10 +133,10 @@ static struct ptp_clock_info rcar_gen4_ptp_info = {
static int rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv,
enum rcar_gen4_ptp_reg_layout layout)
{
if (layout != RCAR_GEN4_PTP_REG_LAYOUT_S4)
if (layout != RCAR_GEN4_PTP_REG_LAYOUT)
return -EINVAL;

ptp_priv->offs = &s4_offs;
ptp_priv->offs = &gen4_offs;

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/renesas/rcar_gen4_ptp.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define RCAR_GEN4_GPTP_OFFSET_S4 0x00018000

enum rcar_gen4_ptp_reg_layout {
RCAR_GEN4_PTP_REG_LAYOUT_S4
RCAR_GEN4_PTP_REG_LAYOUT
};

/* driver's definitions */
Expand All @@ -27,7 +27,7 @@ enum rcar_gen4_ptp_reg_layout {

#define PTPRO 0

enum rcar_gen4_ptp_reg_s4 {
enum rcar_gen4_ptp_reg {
PTPTMEC = PTPRO + 0x0010,
PTPTMDC = PTPRO + 0x0014,
PTPTIVC0 = PTPRO + 0x0020,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/renesas/rswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ static int rswitch_init(struct rswitch_private *priv)

rswitch_fwd_init(priv);

err = rcar_gen4_ptp_register(priv->ptp_priv, RCAR_GEN4_PTP_REG_LAYOUT_S4,
err = rcar_gen4_ptp_register(priv->ptp_priv, RCAR_GEN4_PTP_REG_LAYOUT,
RCAR_GEN4_PTP_CLOCK_S4);
if (err < 0)
goto err_ptp_register;
Expand Down

0 comments on commit 46c361a

Please sign in to comment.