Re: [PATCH v2 1/2] spi: sunxi: fix CDR2 calculation

2024-08-06 Thread Andre Przywara
On Thu, 18 Jul 2024 22:42:52 +0200 Michael Walle wrote: Hi, > The CDR2 divider calculation always yield a frequency greater than the > requested one. Use DIV_ROUND_UP() to keep the frequency equal or below > the requested one. This way, we can also drop the "if div > 0" check > because we know f

[PATCH v2 1/2] spi: sunxi: fix CDR2 calculation

2024-07-18 Thread Michael Walle
The CDR2 divider calculation always yield a frequency greater than the requested one. Use DIV_ROUND_UP() to keep the frequency equal or below the requested one. This way, we can also drop the "if div > 0" check because we know for a fact that div cannot be zero. FWIW, this aligns the CDR2 calculat