Skip to content

Commit

Permalink
pwm: lpss: Allow duty cycle to be 0
Browse files Browse the repository at this point in the history
A duty cycle is represented by values [0..<period>] which reflects [0%..100%].
0% of the duty cycle means always off (logical "0") on output. Allow this in
the driver.

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
Andy Shevchenko authored and Thierry Reding committed Jan 30, 2017
1 parent 684309e commit b5c050c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/pwm/pwm-lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ static int pwm_lpss_config(struct pwm_chip *chip, struct pwm_device *pwm,

base_unit = DIV_ROUND_CLOSEST_ULL(freq, c);

if (duty_ns <= 0)
duty_ns = 1;
on_time_div = 255ULL * duty_ns;
do_div(on_time_div, period_ns);
on_time_div = 255ULL - on_time_div;
Expand Down

0 comments on commit b5c050c

Please sign in to comment.