Re: [PATCH net-next v1 08/14] net: phy: nxp-c45-tja11xx: enable LTC sampling on both ext_ts edges

From: Radu Pirea (OSS)
Date: Mon Jun 19 2023 - 04:42:21 EST


On 19.06.2023 11:10, Horatiu Vultur wrote:
The 06/16/2023 16:53, Radu Pirea (NXP OSS) wrote:

+static void nxp_c45_set_rising_or_falling(struct phy_device *phydev,
+ struct ptp_extts_request *extts)
+{
+ /* Some enable request has only the PTP_ENABLE_FEATURE flag set and in
+ * this case external ts should be enabled on rising edge.
+ */
+ if (extts->flags & PTP_RISING_EDGE ||
+ extts->flags == PTP_ENABLE_FEATURE)
+ phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1,
+ VEND1_PTP_CONFIG, EXT_TRG_EDGE);

With this patch, are you not changing the behaviour for TJA1103?

Yes. The behaviour is changed. If extts->flags == PTP_ENABLE_FEATURE, the ext ts will be enabled on falling edge.

In the way, before there was not check for extts->flags ==
PTP_ENABLE_FEATURE and now if that is set you configure to trigger on
raising edge. If that is the case, shouldn't be this in a different
patch?

You are right. I will split this patch in two. One that enables ext ts on rising edge when extts->flags == PTP_ENABLE_FEATURE and another one with TJA1120 changes.


+
+ if (extts->flags & PTP_FALLING_EDGE)
+ phy_set_bits_mmd(phydev, MDIO_MMD_VEND1,
+ VEND1_PTP_CONFIG, EXT_TRG_EDGE);
+}
+


--
/Horatiu

--
Radu P.