diff options
author | 2017-06-08 14:24:16 +0200 | |
---|---|---|
committer | 2017-07-06 17:15:43 +0200 | |
commit | fd7b2be8cbcf6cd6d9c9e843ffff36fb91388e51 (patch) | |
tree | 38cb89e55f2c019beae1b503392f788eddf164ff /tools/perf/scripts/python/call-graph-from-postgresql.py | |
parent | pwm: meson: Add compatible for the gxbb ao PWMs (diff) | |
download | linux-dev-fd7b2be8cbcf6cd6d9c9e843ffff36fb91388e51.tar.xz linux-dev-fd7b2be8cbcf6cd6d9c9e843ffff36fb91388e51.zip |
pwm: meson: Improve PWM calculation precision
When using input clocks with high rates, such as clk81 (166MHz), the
fin_ns = NSEC_PER_SEC / fin_freq can introduce a significant error.
Ex: fin_freq = 166666667, NSEC_PER_SEC = 1000000000
fin_ns = 5,9999999
which is, of course, rounded down to 5. This introduces an error of ~20%
on the period requested from the PWM.
This patch uses ps instead of ns (and 64 bit integers) to perform the
calculation. This should give a good enough precision.
Fixes: 211ed630753d ("pwm: Add support for Meson PWM Controller")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
squash! pwm: meson: Improve pwm calculation precision
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-postgresql.py')
0 files changed, 0 insertions, 0 deletions