aboutsummaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-stmpe.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2022-04-20 14:12:39 +0200
committerThierry Reding <thierry.reding@gmail.com>2022-05-20 16:18:05 +0200
commit3c173376efc461dc670b02ba2846c2a533491104 (patch)
treecd48b75dfc3f01046d8b3096088dfdb96aab2526 /drivers/pwm/pwm-stmpe.c
parent208ab8676b9c787b4285364fcb52a159f94b861d (diff)
downloadlinux-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