Re: [PATCH V2 2/4] pwm: tegra: Increase precision in pwm rate calculation

2017-04-06 Thread Thierry Reding
On Thu, Apr 06, 2017 at 07:50:59PM +0530, Laxman Dewangan wrote: > The rate of the PWM calculated as follows: > hz = NSEC_PER_SEC / period_ns; > rate = (rate + (hz / 2)) / hz; > > This has the precision loss in lower PWM rate. > Changing this to have more precision as: > hz =

Re: [PATCH V2 2/4] pwm: tegra: Increase precision in pwm rate calculation

2017-04-06 Thread Thierry Reding
On Thu, Apr 06, 2017 at 07:50:59PM +0530, Laxman Dewangan wrote: > The rate of the PWM calculated as follows: > hz = NSEC_PER_SEC / period_ns; > rate = (rate + (hz / 2)) / hz; > > This has the precision loss in lower PWM rate. > Changing this to have more precision as: > hz =

Re: [PATCH V2 2/4] pwm: tegra: Increase precision in pwm rate calculation

2017-04-06 Thread Thierry Reding
On Thu, Apr 06, 2017 at 07:50:59PM +0530, Laxman Dewangan wrote: > The rate of the PWM calculated as follows: > hz = NSEC_PER_SEC / period_ns; > rate = (rate + (hz / 2)) / hz; > > This has the precision loss in lower PWM rate. > Changing this to have more precision as: > hz =

Re: [PATCH V2 2/4] pwm: tegra: Increase precision in pwm rate calculation

2017-04-06 Thread Thierry Reding
On Thu, Apr 06, 2017 at 07:50:59PM +0530, Laxman Dewangan wrote: > The rate of the PWM calculated as follows: > hz = NSEC_PER_SEC / period_ns; > rate = (rate + (hz / 2)) / hz; > > This has the precision loss in lower PWM rate. > Changing this to have more precision as: > hz =

[PATCH V2 2/4] pwm: tegra: Increase precision in pwm rate calculation

2017-04-06 Thread Laxman Dewangan
The rate of the PWM calculated as follows: hz = NSEC_PER_SEC / period_ns; rate = (rate + (hz / 2)) / hz; This has the precision loss in lower PWM rate. Changing this to have more precision as: hz = DIV_ROUND_CLOSE(NSEC_PER_SEC * 100, period_ns); rate =

[PATCH V2 2/4] pwm: tegra: Increase precision in pwm rate calculation

2017-04-06 Thread Laxman Dewangan
The rate of the PWM calculated as follows: hz = NSEC_PER_SEC / period_ns; rate = (rate + (hz / 2)) / hz; This has the precision loss in lower PWM rate. Changing this to have more precision as: hz = DIV_ROUND_CLOSE(NSEC_PER_SEC * 100, period_ns); rate =