summaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-cros-ec.c
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2017-06-08 14:24:16 +0200
committerThierry Reding <thierry.reding@gmail.com>2017-07-06 17:15:43 +0200
commitfd7b2be8cbcf6cd6d9c9e843ffff36fb91388e51 (patch)
tree38cb89e55f2c019beae1b503392f788eddf164ff /drivers/pwm/pwm-cros-ec.c
parentd396b20a1e88ca2cabf7ec99c6c2138902aff1f3 (diff)
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 'drivers/pwm/pwm-cros-ec.c')
0 files changed, 0 insertions, 0 deletions