Re: [PATCH v2] clk: qcom: rcg2: compute 2d using duty fraction directly
From: Bjorn Andersson
Date: Mon Jan 05 2026 - 14:17:38 EST
On Mon, 05 Jan 2026 16:09:50 +0530, Taniya Das wrote:
> The duty-cycle calculation in clk_rcg2_set_duty_cycle() currently
> derives an intermediate percentage `duty_per = (num * 100) / den` and
> then computes:
>
> d = DIV_ROUND_CLOSEST(n * duty_per * 2, 100);
>
> This introduces integer truncation at the percentage step (division by
> `den`) and a redundant scaling by 100, which can reduce precision for
> large `den` and skew the final rounding.
>
> [...]
Applied, thanks!
[1/1] clk: qcom: rcg2: compute 2d using duty fraction directly
commit: d6205a1878dd4cc9664c4b4829b68a29c0426efc
Best regards,
--
Bjorn Andersson <andersson@xxxxxxxxxx>