From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Thierry Reding <thierry.reding@gmail.com>,
linux-pwm@vger.kernel.org,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ilkka Koskinen <ilkka.koskinen@intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v2 2/4] pwm: lpss: Allow duty cycle to be 0
Date: Mon, 2 Jan 2017 11:16:45 +0200 [thread overview]
Message-ID: <20170102091647.86910-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20170102091647.86910-1-andriy.shevchenko@linux.intel.com>
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>
---
drivers/pwm/pwm-lpss.c | 2 --
1 file changed, 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;
--
2.11.0
next prev parent reply other threads:[~2017-01-02 9:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-02 9:16 [PATCH v2 0/4] pwm: lpss: clean up series Andy Shevchenko
2017-01-02 9:16 ` [PATCH v2 1/4] pwm: lpss: Avoid potential overflow of base_unit Andy Shevchenko
2017-01-02 9:16 ` Andy Shevchenko [this message]
2017-01-02 9:16 ` [PATCH v2 3/4] pwm: lpss: Do not export board infos for different PWM types Andy Shevchenko
2017-01-18 11:11 ` Thierry Reding
2017-01-18 13:01 ` Mika Westerberg
2017-01-20 11:00 ` Thierry Reding
2017-01-20 11:15 ` Mika Westerberg
2017-01-20 11:18 ` Thierry Reding
2017-01-02 9:16 ` [PATCH v2 4/4] pwm: lpss: Switch to new atomic API Andy Shevchenko
2017-01-18 11:15 ` Thierry Reding
2017-01-19 14:32 ` Andy Shevchenko
2017-01-20 10:48 ` Thierry Reding
2017-01-05 8:09 ` [PATCH v2 0/4] pwm: lpss: clean up series Ilkka Koskinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170102091647.86910-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=ilkka.koskinen@intel.com \
--cc=linux-pwm@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=thierry.reding@gmail.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.