Commit f529893f authored by Vadim Fedorenko's avatar Vadim Fedorenko Committed by Jakub Kicinski
Browse files

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: default avatarKory Maincent <kory.maincent@bootlin.com>
Signed-off-by: default avatarVadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20260106160723.3925872-5-vadim.fedorenko@linux.dev


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ffde97f8
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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;