diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-01-28 17:10:40 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2017-01-30 08:13:39 +0100 |
commit | b5c050c719922901891bdd8580d224e2a0035db5 (patch) | |
tree | 5cb36aac5ece4729626dd424c6e13a781991f33d /drivers | |
parent | 684309e5043efaaa94d9b4e65f53f7fdde1f6675 (diff) | |
download | linux-stable-b5c050c719922901891bdd8580d224e2a0035db5.tar.gz linux-stable-b5c050c719922901891bdd8580d224e2a0035db5.tar.bz2 linux-stable-b5c050c719922901891bdd8580d224e2a0035db5.zip |
pwm: lpss: Allow duty cycle to be 0
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pwm/pwm-lpss.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c index 8642feeb8abd..ffa01ab907a6 100644 --- a/drivers/pwm/pwm-lpss.c +++ b/drivers/pwm/pwm-lpss.c @@ -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; |