Re: [PATCH v5 14/20] iio: adc: ad7768: Add per-channel conversion delay

From: Andy Shevchenko

Date: Mon Aug 31 2026 - 04:49:44 EST


On Fri, Aug 28, 2026 at 05:30:37PM +0200, Janani Sunil wrote:
> Expose the per-channel synchronization phase offset through the IIO
> conversion-delay attribute.
>
> Derive the delay resolution from MCLK, power mode and decimation rate.
> Validate the requested delay and program the corresponding phase
> register when applying the active channel configuration.

...

> + mclk = clk_get_rate(st->mclk);
> + if (!mclk)
> + return -EINVAL;
> +
> + mclk_div = ad7768_power_modes[st->power_mode_idx].mclk_div;
> + params->step_ps = DIV_ROUND_CLOSEST_ULL((u64)mult * PSEC_PER_SEC *
> + mclk_div, mclk);

params->step_ps =
DIV_ROUND_CLOSEST_ULL((u64)mult * PSEC_PER_SEC * mclk_div, mclk);

// Can mult be declared as u64/s64?

--
With Best Regards,
Andy Shevchenko