diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-04-20 14:12:39 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2022-05-20 16:18:05 +0200 |
commit | 3c173376efc461dc670b02ba2846c2a533491104 (patch) | |
tree | cd48b75dfc3f01046d8b3096088dfdb96aab2526 /drivers/pwm/pwm-stmpe.c | |
parent | 208ab8676b9c787b4285364fcb52a159f94b861d (diff) | |
download | linux-3c173376efc461dc670b02ba2846c2a533491104.tar.gz linux-3c173376efc461dc670b02ba2846c2a533491104.tar.bz2 linux-3c173376efc461dc670b02ba2846c2a533491104.zip |
pwm: renesas-tpu: Improve maths to compute register settings
The newly computed register values are intended to exactly match the
previously computed values. The main improvement is that the prescaler
is computed without a loop that involves two divisions in each step.
This uses the fact, that prescalers[i] = 1 << (2 * i).
Assuming a moderately smart compiler, the needed number of divisions for
the case where the requested period is too big, is reduced from 5 to 2.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-stmpe.c')
0 files changed, 0 insertions, 0 deletions