Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1518388pxf; Fri, 2 Apr 2021 12:51:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeFS8JZmCLKh4F7zrjI+Yy3Vbh6mJ031eslYoA/OZnmD6vXYVzOt6TVwkdIZoSUEUQorWK X-Received: by 2002:aa7:c6da:: with SMTP id b26mr17404359eds.254.1617393105547; Fri, 02 Apr 2021 12:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617393105; cv=none; d=google.com; s=arc-20160816; b=olOT4QdPt7b2cS1TpgKAqnC7gtOW5GwDi5GQrRpqqtQP5ZtyzCr4XGPKI6vQ8cf2i+ bC58oF7rGw6tnWtzoeQMDfraSVb+qSqJ/LFbzr3hUlPBHEk2O4lLWKasmcQxGaOaKFh3 ks91PRYtHldqundrGtyhaLHiZ+TWQca8/xV24G1CleGg+99laYBtiYGnGfGFqUPnabZW wzhUvLisjuEw55V86lYtGqGkJpXx/jenkCpaWdOHJTPGtZ4U0pLF/JLGk7CuSw/JykVt Wm+snMX3GT4TpdbVI7/5N+7gerixj8pLA9aJgElDeuIMAN9Vlx1lMH8+0dVrKcWJIAsZ RblQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=nINO07t7akPQ2d4EPtK54InrU2TWYhNSrByBZSjYk1c=; b=EnV59Re6oXz2wCAA3TE7Jo5qqdYGnkW/rgLn0fX7ygozODtQpeFqlhYUmZISsT6Me5 Bl/zfuhFAlM+FHut+L4jggU02XcSrqalzERiq8Jgm9+3vcw/xf6gStsw/FvTjiIANxop 4TpwjZISjqbYlT782lVg4zDhDJJ9qIrNuBI/5smCB2BXmwUDC7C5ipDIXLmsCOp8b0jf Vf5sGE93abglHi9iY/hwr+kOwnAnu6+RO1wm3VXqRw325QmUa7hQpUpYj9d3+15a/d2U yGNrqQKllL6lleaZfGqJB9PtUPLImAqTNeECMbJ6qnd9Bd6F7DDTQThZWt6AnClNiM5H pw6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si7590168edd.315.2021.04.02.12.51.22; Fri, 02 Apr 2021 12:51:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236496AbhDBTsS (ORCPT + 99 others); Fri, 2 Apr 2021 15:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhDBTsR (ORCPT ); Fri, 2 Apr 2021 15:48:17 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CEECC0613E6 for ; Fri, 2 Apr 2021 12:48:16 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lSPm6-0001fg-6A; Fri, 02 Apr 2021 21:48:10 +0200 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lSPm5-0008ML-NF; Fri, 02 Apr 2021 21:48:09 +0200 Date: Fri, 2 Apr 2021 21:48:05 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Thierry Reding , Clemens Gruber Cc: linux-pwm@vger.kernel.org, Sven Van Asbroeck , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 4/7] pwm: pca9685: Support staggered output ON times Message-ID: <20210402194805.rj65qcdmzfgcbgri@pengutronix.de> References: <20210329125707.182732-1-clemens.gruber@pqgruber.com> <20210329125707.182732-4-clemens.gruber@pqgruber.com> <20210329170357.par7c3izvtmtovlj@pengutronix.de> <20210329180206.rejl32uajslpvbgi@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="h3wxik5jkm2uo47v" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --h3wxik5jkm2uo47v Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, On Wed, Mar 31, 2021 at 06:21:32PM +0200, Thierry Reding wrote: > However, I'm a bit hesitant about this staggering output mode. From what > I understand what's going to happen for these is basically that overall > each PWM will be running at the requested duty cycle, but the on/off > times will be evenly spread out over the whole period. In other words, > the output *power* of the PWM signal will be the same as if the signal > was a single on/off cycle. That's not technically a PWM signal as the > PWM framework defines it. See the kerneldoc for enum pwm_polarity for > what signals are expected to look like. After reading this thread I had the impression that there is no (externally visible) difference between using ON =3D 0 plus programming a new setting when the counter is say 70 and using ON =3D 30 plus programming a new setting when the counter is 100. But that's not the case and I agree that defaulting to staggering is a bad idea. Having said that I doubt that adding a property to the device tree is a good solution, because it changes behaviour without the consumer being aware and additionally it's not really a hardware description. The solution I'd prefer is to change struct pwm_state to include the delay in it. (This would then make the polarity obsolete, because .duty_cycle =3D 30 .period =3D 100 .polarity =3D POLARITY_INVERTED .offset =3D 0 is equivalent to .duty_cycle =3D 30 .period =3D 100 .polarity =3D POLARITY_NORMAL .offset =3D 70 =2E Other inverted states can be modified similarily.) Then consumers can be coordinated to use different offsets. I'm aware changing this isn't trivial, and it's not thought out completely, but I think the end result is rechnically superior to the approach suggested in the patch under discussion. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --h3wxik5jkm2uo47v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmBndPIACgkQwfwUeK3K 7Al2OQf/fo7xgkHJKYOh3gQC77XzTMMGFDbuSKGdRx/ojyJ2jy5wrs7Zp/ChKVIQ ZCi5nwUg06JYkWWPy+5vUtaIn9bIUXzClrHKz6kKNvLFmevoN4sT/g7jHwekTOqw SXlMM/gRiHn+m1Xcifn58xLs6W4XMaYWR3CZ/hGWIOqTvgpeVSDuU8eoIvdzb9HQ UQNr4ZT/BlfT7GSNILntVUitrx8/klmqE/sk3W+kVVVA47qL3UCgVXWiy9jzAiS+ 3N2GqdFciEackRGRR6oCiksrVtAeIQSeIf7uca9aEjme7lUZGRPGTnWkOKeT5yxF pWHNV/cOF85WHFL180aNw6CPROxomA== =FwRs -----END PGP SIGNATURE----- --h3wxik5jkm2uo47v--