pwm: mediatek: Improve precision in rate calculation
authorSean Wang <sean.wang@mediatek.com>
Fri, 2 Mar 2018 08:49:14 +0000 (16:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:43:05 +0000 (09:43 +0200)
commitc1d2f1eac9a935c21c38d1680ec4c22200cfcb78
tree841c66c0db549236effa23fecb806331e774c2b1
parent95d476598b0828c44ced99d9c95c135092b9d612
pwm: mediatek: Improve precision in rate calculation

commit 04c0a4e00dc11fedc0b0a8593adcf0f4310505d4 upstream.

Add a way that turning resolution from in nanosecond into in picosecond
to improve noticeably almost 4.5% precision.

It's necessary to hold the new resolution with type u64 and thus related
operations on u64 are applied instead in those rate calculations.

And the patch has a dependency on [1].

[1] http://lists.infradead.org/pipermail/linux-mediatek/2018-March/012225.html

Cc: stable@vger.kernel.org
Fixes: caf065f8fd58 ("pwm: Add MediaTek PWM support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pwm/pwm-mediatek.c