From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FDC7C433DB for ; Mon, 11 Jan 2021 22:44:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D95CB22CAF for ; Mon, 11 Jan 2021 22:44:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D95CB22CAF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=agac/TN4/vxz+TWXYpld4rzDj/v7SItxrKPCeH+NRIk=; b=gUylZtfQOJohCLLo7KUI6ndHu HFLUEdgSyrUbNdvtfBs8fLIExmY3lKNByph2HixXnrBvvdmrxaoiQUPEHTLYHyeZrLMkE+Zqf8FkR RCzFKLt2VYLv+sEUYWbtDSL5Jx6sqMMI7JFLQ6ek+WP1ndx+YqqkFVC/3gqTi92ggJDt9TOI6UQUu P8osVhsYcXwmPcK3bLjfwWraKJe37INIXfTGBd6SG4cZEJfidh07etT+Lx8HTKjEJbi09EAT+AaEt D8GNSBVIy+1h5MtddL5kqJf+hqbrlFjCcHw8Klq28bI1OSeBIHaGnIV0jypozHnMCsMWV8DmRK8M7 gLua8Nbtg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kz5uJ-0002v4-Rx; Mon, 11 Jan 2021 22:43:27 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kz5uF-0002tv-TV for linux-arm-kernel@lists.infradead.org; Mon, 11 Jan 2021 22:43:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=i7DbEQRd3KODIrytfRH/tzu+gaudCnJu2oc8ZbuI9m8=; b=d9YcJTdu75D1I9oj5doSKlgWz qGzZtdm+YOI+NDU82RBo9WNhleXtN0J5J18cVd6UBDAkmHJKzobNnxIfZ1hPTVgUzBXEG5KSODYpv xxQ/UmENI5GUTHVDwZpWO8jqAZQB/zP3BUAoOiMQhs270wKb8/s5ENdRZbwIMA+dZZyCeCKBnp+VS zdhKO3coRLnCTEiQn/kayIZLZgh7v30kCZnrp3YT+tSLzrnvMdTfUbwclSjL9yUNBVp9nALCiZJ6q EBhKkG7sFBcOVUcX91jJzikVTWztD524oAP6zH6YL04ShlgvUbFzyxFoJYdl8WYepdtDdPh7h6nmJ 9WQwxah+Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:46776) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kz5u6-0007Y7-Ns; Mon, 11 Jan 2021 22:43:14 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1kz5ts-0005dx-HA; Mon, 11 Jan 2021 22:43:00 +0000 Date: Mon, 11 Jan 2021 22:43:00 +0000 From: Russell King - ARM Linux admin To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH 5/5] gpio: mvebu: document zero pwm duty cycle limitation Message-ID: <20210111224300.GA1551@shell.armlinux.org.uk> References: <20210111202413.lk3mxthlqagdhy7t@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210111202413.lk3mxthlqagdhy7t@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210111_174324_060825_27697C8F X-CRM114-Status: GOOD ( 23.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Baruch Siach , Sascha Hauer , linux-pwm@vger.kernel.org, Linus Walleij , Chris Packham , Bartosz Golaszewski , Thierry Reding , Thomas Petazzoni , linux-gpio@vger.kernel.org, Ralph Sennhauser , Lee Jones , Gregory Clement , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 11, 2021 at 09:24:13PM +0100, Uwe Kleine-K=F6nig wrote: > On Mon, Jan 11, 2021 at 01:17:06PM +0200, Baruch Siach wrote: > > Add a comment on why the code never sets the 'on' register to zero. > > = > > Reported-by: Uwe Kleine-K=F6nig > > Signed-off-by: Baruch Siach > > --- > > drivers/gpio/gpio-mvebu.c | 1 + > > 1 file changed, 1 insertion(+) > > = > > diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c > > index eb7456fa6d86..4261e3b22b4e 100644 > > --- a/drivers/gpio/gpio-mvebu.c > > +++ b/drivers/gpio/gpio-mvebu.c > > @@ -706,6 +706,7 @@ static int mvebu_pwm_apply(struct pwm_chip *chip, s= truct pwm_device *pwm, > > val =3D DIV_ROUND_UP_ULL(val, NSEC_PER_SEC); > > if (val > UINT_MAX) > > return -EINVAL; > > + /* zero 'on' value does not work as expected for some reason */ > = > What does the reference manual say about this? If there is no > information about this, please point this out, too. (Something like: The > reference manual is silent about this issue though.) Also I'd prefer to > read about the behaviour, so maybe mention that there is an occational > peek even when on is configured to 0. Does '$off =3D 0' has a symmetrical > issue? It isn't a proper PWM block - it's documented as being a "blink function". It contains two counters, one defines the "on" duration, and the other defines the "off" duration. The block is not well documented in the reference manual, so we have to resort to experimentation - and experimentation reveals that if we program both registers to zero, then we get about 17s on and 17s off. That is 2^32 / 250MHz seconds. So, a value of 0 in either register is interpreted by the hardware as a value of 2^32. So, let's say we want a 25kHz signal. If we program the "on" duration to 10000 and the "off" duration to 0, what we actually get a 40us on duration, and a 17.2s off duration - resulting in a frequency of 0.058Hz! -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel