]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: phy: microchip_rds_ptp: add HW timestamp configuration reporting
authorVadim Fedorenko <vadim.fedorenko@linux.dev>
Tue, 6 Jan 2026 16:07:23 +0000 (16:07 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Jan 2026 02:13:12 +0000 (18:13 -0800)
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>
drivers/net/phy/microchip_rds_ptp.c

index 5f6e7cd11622dcdd71c3e54e139cb7992d4eea6e..f5f2928e705f67b1199428f587fcde3ce7e1c902 100644 (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;