pwm: atmel: Fix calculation of prescale value
authorNikolaus Voss <n.voss@weinmann-emt.de>
Tue, 23 Sep 2014 13:30:21 +0000 (15:30 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 25 Sep 2014 06:52:39 +0000 (08:52 +0200)
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: Nikolaus Voss <n.voss@weinmann-emt.de>
Tested-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

No differences found