Skip to content
Commit e2e08970 authored by Nikolaus Voss's avatar Nikolaus Voss Committed by Thierry Reding
Browse files

pwm: atmel: Fix calculation of prescale value



The prescale value used for calculating the period was incremented
afterwards, thus the resulting prescale value is by one too high.
This resulted in a PWM frequency only half as high as requested.

This patch moves the 64 bit division out of the prescale loop to
correct the above issue and make the calculation more efficient.

Signed-off-by: default avatarNikolaus Voss <n.voss@weinmann-emt.de>
Tested-by: default avatarBo Shen <voice.shen@atmel.com>
Acked-by: default avatarBo Shen <voice.shen@atmel.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 70145f87
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment