From patchwork Mon Oct 24 14:43:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 685905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3t2fDg2n9mz9sxS for ; Tue, 25 Oct 2016 01:44:03 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754975AbcJXOoC (ORCPT ); Mon, 24 Oct 2016 10:44:02 -0400 Received: from mga01.intel.com ([192.55.52.88]:1944 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352AbcJXOoC (ORCPT ); Mon, 24 Oct 2016 10:44:02 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 24 Oct 2016 07:43:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,542,1473145200"; d="scan'208";a="893341877" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 24 Oct 2016 07:43:57 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 34E89D1; Mon, 24 Oct 2016 17:43:26 +0300 (EEST) From: Andy Shevchenko To: Thierry Reding , linux-pwm@vger.kernel.org, Mika Westerberg Cc: Andy Shevchenko Subject: [PATCH v1 2/4] pwm: lpss: Allow duty cycle to be 0 Date: Mon, 24 Oct 2016 17:43:23 +0300 Message-Id: <20161024144325.130353-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161024144325.130353-1-andriy.shevchenko@linux.intel.com> References: <20161024144325.130353-1-andriy.shevchenko@linux.intel.com> Sender: linux-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org A duty cycle is represented by values [0..] which reflects [0%..100%]. 0% of the duty cycle means always off (logical "0") on output. Allow this in the driver. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- 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 8642fee..ffa01ab 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;