mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
pwm: tegra: Allow 100 % duty cycle
To get 100 % duty cycle (always high), pulse width needs to be set to 256. Signed-off-by: Victor(Weiguo) Pan <[email protected]> Signed-off-by: Laxman Dewangan <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
This commit is contained in:
parent
5dfbd2bd54
commit
e0ee1a75f4
1 changed files with 1 additions and 1 deletions
|
|
@ -77,7 +77,7 @@ static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
|
|||
* per (1 << PWM_DUTY_WIDTH) cycles and make sure to round to the
|
||||
* nearest integer during division.
|
||||
*/
|
||||
c = duty_ns * ((1 << PWM_DUTY_WIDTH) - 1) + period_ns / 2;
|
||||
c = duty_ns * (1 << PWM_DUTY_WIDTH) + period_ns / 2;
|
||||
do_div(c, period_ns);
|
||||
|
||||
val = (u32)c << PWM_DUTY_SHIFT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue