net: phy: microchip_rds_ptp: 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/20260106160723.3925872-5-vadim.fedorenko@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Vadim Fedorenko 2026-01-06 16:07:23 +00:00 committed by Jakub Kicinski
parent ffde97f8ff
commit f529893f40

View File

@ -476,6 +476,18 @@ static bool mchp_rds_ptp_rxtstamp(struct mii_timestamper *mii_ts,
return true;
}
static int mchp_rds_ptp_hwtstamp_get(struct mii_timestamper *mii_ts,
struct kernel_hwtstamp_config *config)
{
struct mchp_rds_ptp_clock *clock =
container_of(mii_ts, struct mchp_rds_ptp_clock,
mii_ts);
config->tx_type = clock->hwts_tx_type;
config->rx_filter = clock->rx_filter;
return 0;
}
static int mchp_rds_ptp_hwtstamp_set(struct mii_timestamper *mii_ts,
struct kernel_hwtstamp_config *config,
struct netlink_ext_ack *extack)
@ -1293,6 +1305,7 @@ struct mchp_rds_ptp_clock *mchp_rds_ptp_probe(struct phy_device *phydev, u8 mmd,
clock->mii_ts.rxtstamp = mchp_rds_ptp_rxtstamp;
clock->mii_ts.txtstamp = mchp_rds_ptp_txtstamp;
clock->mii_ts.hwtstamp_set = mchp_rds_ptp_hwtstamp_set;
clock->mii_ts.hwtstamp_get = mchp_rds_ptp_hwtstamp_get;
clock->mii_ts.ts_info = mchp_rds_ptp_ts_info;
phydev->mii_ts = &clock->mii_ts;