Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: nxp-c45-tja11xx: add HW timestamp configuration reporting

The driver stores HW timestamping configuration and can technically
report it. Add callback to do it.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20251124181151.277256-7-vadim.fedorenko@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Vadim Fedorenko and committed by
Jakub Kicinski
d51de60b ab95392a

+14
+14
drivers/net/phy/nxp-c45-tja11xx.c
··· 1012 1012 return true; 1013 1013 } 1014 1014 1015 + static int nxp_c45_hwtstamp_get(struct mii_timestamper *mii_ts, 1016 + struct kernel_hwtstamp_config *cfg) 1017 + { 1018 + struct nxp_c45_phy *priv = container_of(mii_ts, struct nxp_c45_phy, 1019 + mii_ts); 1020 + 1021 + cfg->tx_type = priv->hwts_tx; 1022 + cfg->rx_filter = priv->hwts_rx ? HWTSTAMP_FILTER_PTP_V2_L2_EVENT 1023 + : HWTSTAMP_FILTER_NONE; 1024 + 1025 + return 0; 1026 + } 1027 + 1015 1028 static int nxp_c45_hwtstamp_set(struct mii_timestamper *mii_ts, 1016 1029 struct kernel_hwtstamp_config *cfg, 1017 1030 struct netlink_ext_ack *extack) ··· 1763 1750 priv->mii_ts.rxtstamp = nxp_c45_rxtstamp; 1764 1751 priv->mii_ts.txtstamp = nxp_c45_txtstamp; 1765 1752 priv->mii_ts.hwtstamp_set = nxp_c45_hwtstamp_set; 1753 + priv->mii_ts.hwtstamp_get = nxp_c45_hwtstamp_get; 1766 1754 priv->mii_ts.ts_info = nxp_c45_ts_info; 1767 1755 phydev->mii_ts = &priv->mii_ts; 1768 1756 ret = nxp_c45_init_ptp_clock(priv);