diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-04-20 15:12:39 +0300 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2022-05-20 17:18:05 +0300 |
commit | 3c173376efc461dc670b02ba2846c2a533491104 (patch) | |
tree | cd48b75dfc3f01046d8b3096088dfdb96aab2526 /scripts/gdb/linux/proc.py | |
parent | 208ab8676b9c787b4285364fcb52a159f94b861d (diff) | |
download | linux-3c173376efc461dc670b02ba2846c2a533491104.tar.xz |
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 'scripts/gdb/linux/proc.py')
0 files changed, 0 insertions, 0 deletions