]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: rcar: Fix a condition to prevent mismatch value setting to duty
authorRyo Kodama <ryo.kodama.vz@renesas.com>
Fri, 9 Mar 2018 11:24:21 +0000 (20:24 +0900)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 27 Mar 2018 23:20:13 +0000 (01:20 +0200)
commitbe68d118c02c571ff6196d2f72049b9f0b5bf66e
tree3cec7123741d4d4814ce907597b9b34cbff21450
parentbd1ea45bd846c5de198976dd647fdd32c6da91b2
pwm: rcar: Fix a condition to prevent mismatch value setting to duty

This patch fixes an issue that is possible to set mismatch value to duty
for R-Car PWM if we input the following commands:

 # cd /sys/class/pwm/<pwmchip>/
 # echo 0 > export
 # cd pwm0
 # echo 30 > period
 # echo 30 > duty_cycle
 # echo 0 > duty_cycle
 # cat duty_cycle
 0
 # echo 1 > enable
 --> Then, the actual duty_cycle is 30, not 0.

So, this patch adds a condition into rcar_pwm_config() to fix this
issue.

Signed-off-by: Ryo Kodama <ryo.kodama.vz@renesas.com>
[shimoda: revise the commit log and add Fixes and Cc tags]
Fixes: bfaf1c4fc679 ("pwm: Add support for R-Car PWM Timer")
Cc: Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-rcar.c