Re: [PATCH v2 net-next 04/14] ptp: netc: add PTP_CLK_REQ_PPS support

From: Frank Li
Date: Thu Jul 17 2025 - 11:16:01 EST


On Thu, Jul 17, 2025 at 11:59:30AM +0000, Wei Fang wrote:
> > > +static u32 netc_timer_calculate_fiper_pw(struct netc_timer *priv,
> > > + u32 fiper)
> > > +{
> > > + u64 divisor, pulse_width;
> > > +
> > > + /* Set the FIPER pulse width to half FIPER interval by default.
> > > + * pulse_width = (fiper / 2) / TMR_GCLK_period,
> > > + * TMR_GCLK_period = NSEC_PER_SEC / TMR_GCLK_freq,
> > > + * TMR_GCLK_freq = (clk_freq / oclk_prsc) Hz,
> > > + * so pulse_width = fiper * clk_freq / (2 * NSEC_PER_SEC * oclk_prsc).
> > > + */
> > > + divisor = mul_u32_u32(2000000000U, priv->oclk_prsc);
> >
> > is it 2*PSEC_PER_SEC ?
> >
>
> No, it is 2 * NSEC_PER_SEC, NSEC_PER_SEC is 1000000000.

Use 2 * NSEC_PER_SEC, instead of hardcode number.

Frank

>