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: NNikolaus Voss <n.voss@weinmann-emt.de> Tested-by: NBo Shen <voice.shen@atmel.com> Acked-by: NBo Shen <voice.shen@atmel.com> Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
Showing
想要评论请 注册 或 登录