diff options
| -rw-r--r-- | drivers/net/dsa/microchip/ksz_common.c | 2 | ||||
| -rw-r--r-- | drivers/net/dsa/microchip/ksz_common.h | 1 | ||||
| -rw-r--r-- | drivers/net/dsa/microchip/ksz_ptp.c | 6 | ||||
| -rw-r--r-- | drivers/net/dsa/microchip/ksz_ptp_reg.h | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index d400a4ad57b5..595438031d31 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -571,6 +571,7 @@ static const u16 ksz8463_regs[] = { [S_MULTICAST_CTRL] = 0x04, [PTP_CLK_CTRL] = 0x0600, [PTP_RTC_NANOSEC] = 0x0604, + [PTP_RTC_SEC] = 0x0608, }; static const u32 ksz8463_masks[] = { @@ -807,6 +808,7 @@ static const u16 ksz9477_regs[] = { [REG_PORT_PME_CTRL] = 0x0017, [PTP_CLK_CTRL] = 0x0500, [PTP_RTC_NANOSEC] = 0x0504, + [PTP_RTC_SEC] = 0x0508, }; static const u32 ksz9477_masks[] = { diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index 6d100f1f5e6e..b4305bd47fbe 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -273,6 +273,7 @@ enum ksz_regs { REG_PORT_PME_CTRL, PTP_CLK_CTRL, PTP_RTC_NANOSEC, + PTP_RTC_SEC, }; enum ksz_masks { diff --git a/drivers/net/dsa/microchip/ksz_ptp.c b/drivers/net/dsa/microchip/ksz_ptp.c index 226b10d0f89a..5a94beb410df 100644 --- a/drivers/net/dsa/microchip/ksz_ptp.c +++ b/drivers/net/dsa/microchip/ksz_ptp.c @@ -604,7 +604,7 @@ static int _ksz_ptp_gettime(struct ksz_device *dev, struct timespec64 *ts) if (ret) return ret; - ret = ksz_read32(dev, REG_PTP_RTC_SEC, &seconds); + ret = ksz_read32(dev, regs[PTP_RTC_SEC], &seconds); if (ret) return ret; @@ -691,7 +691,7 @@ static int ksz_ptp_settime(struct ptp_clock_info *ptp, if (ret) goto unlock; - ret = ksz_write32(dev, REG_PTP_RTC_SEC, ts->tv_sec); + ret = ksz_write32(dev, regs[PTP_RTC_SEC], ts->tv_sec); if (ret) goto unlock; @@ -782,7 +782,7 @@ static int ksz_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) if (ret) goto unlock; - ret = ksz_write32(dev, REG_PTP_RTC_SEC, abs(sec)); + ret = ksz_write32(dev, regs[PTP_RTC_SEC], abs(sec)); if (ret) goto unlock; diff --git a/drivers/net/dsa/microchip/ksz_ptp_reg.h b/drivers/net/dsa/microchip/ksz_ptp_reg.h index 9ab918c7af4b..d1d315144886 100644 --- a/drivers/net/dsa/microchip/ksz_ptp_reg.h +++ b/drivers/net/dsa/microchip/ksz_ptp_reg.h @@ -29,8 +29,6 @@ #define PTP_RTC_SUB_NANOSEC_M 0x0007 #define PTP_RTC_0NS 0x00 -#define REG_PTP_RTC_SEC 0x0508 - #define REG_PTP_SUBNANOSEC_RATE 0x050C #define PTP_SUBNANOSEC_M 0x3FFFFFFF |
