Re: [PATCH v16 2/2] pwm: airoha: Add support for EN7581 SoC

From: Uwe Kleine-König
Date: Wed Jun 25 2025 - 03:26:07 EST


Hello Christian,

On Wed, Jun 25, 2025 at 02:00:39AM +0200, Christian Marangi wrote:
> + /*
> + * Period goes at 4ns step, normalize it to check if we can
> + * share a generator.
> + */
> + period_ns = rounddown_u64(period_ns, AIROHA_PWM_PERIOD_TICK_NS);

I don't understand why you need that. If you clamp to
AIROHA_PWM_PERIOD_MAX_NS first, you don't need the (expensive) 64-bit
operation. If you compare using ticks instead of ns you don't even need
to round down, but just do the division that you end up doing anyhow.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature