Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3777879pxf; Mon, 29 Mar 2021 11:05:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTQON2fMcW8R+fwtM4UeDQ60Tc0hlPG/IG5O0qNKywXRhwKS/xqc1IhNdb9d1XBUqcgXyC X-Received: by 2002:a17:906:1f93:: with SMTP id t19mr30256951ejr.443.1617041158913; Mon, 29 Mar 2021 11:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617041158; cv=none; d=google.com; s=arc-20160816; b=y4+wJ+XqIxXn18ZoTWiYvIckEn04ECqx5kEJsOhJmLJjijke49G0X+jp/sOQdC00p0 CpOO0w1X2pDWPlXMOtrO/dF9rM9u2tFzRUmB+VYfq2wHb29Nad7uoLLbAeGKYas10K8M dwOkgTsTaUWFqJGyhlo2qJU6QceO/+AZ4GkjVOwsDRtAwzgzmdA9wt17xCsf8tBTEVHa A9GZXraRFVWNhJ4K2rrbNrUBs2U9e7biiOZLGtldmwAPRKIT0ai2qmfIw9fkndKA3AY4 syBASqtfEUX0U7hhQFZ4AvDX+qzE2YyRX+OXPodw02PL6jWcnnBlAOipVw+ciWus5eB2 qIaQ== 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=/buXWRw1Fx8yBHvCb9MXhDVVDFwGyiLjb2tUeXfKBpU=; b=YjimDbqonmTSLQfvHiJCoW+TBCdFmjNIYmtDfY7/cjyMkf4CJ0w2vqSv6Q2f65wR0w ly2+AQfLZsIjk0YX6xic/G0ZHfyNJ1Oira7FFkOZVFuIjYVHrPua8IJWa7tjSoSQB7/l ClOe5eRCIqHnap7tl5CRV+ZdkpAE0CujNNoUbSoIAD7/IEG7sPb17EFYyHOSeY7pmgty APzhWao72mwRbpCGEBz30WxgM7JvwLY09c6iTwDGQNICC3WzBJf+IbDfzV8wCNaHG9Iw JaN3YXy47M8iWEc1mJeXPARyMxAJ4L0Ew8FwPycTuusytEMzOY60p7bJS3+kbKO7Qisb a8zQ== 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 r15si10883692eji.282.2021.03.29.11.05.28; Mon, 29 Mar 2021 11:05:58 -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 S231396AbhC2SCU (ORCPT + 99 others); Mon, 29 Mar 2021 14:02:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231395AbhC2SCL (ORCPT ); Mon, 29 Mar 2021 14:02:11 -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 C5BE1C061574 for ; Mon, 29 Mar 2021 11:02:10 -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 1lQwDH-0004Gs-73; Mon, 29 Mar 2021 20:02:07 +0200 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lQwDG-0001XY-IO; Mon, 29 Mar 2021 20:02:06 +0200 Date: Mon, 29 Mar 2021 20:02:06 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Clemens Gruber Cc: linux-pwm@vger.kernel.org, Thierry Reding , Sven Van Asbroeck , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 4/7] pwm: pca9685: Support staggered output ON times Message-ID: <20210329180206.rejl32uajslpvbgi@pengutronix.de> References: <20210329125707.182732-1-clemens.gruber@pqgruber.com> <20210329125707.182732-4-clemens.gruber@pqgruber.com> <20210329170357.par7c3izvtmtovlj@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="noem5j55dbfdgb7z" 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 --noem5j55dbfdgb7z Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 29, 2021 at 07:16:38PM +0200, Clemens Gruber wrote: > On Mon, Mar 29, 2021 at 07:03:57PM +0200, Uwe Kleine-K=F6nig wrote: > > On Mon, Mar 29, 2021 at 02:57:04PM +0200, Clemens Gruber wrote: > > > The PCA9685 supports staggered LED output ON times to minimize current > > > surges and reduce EMI. > > > When this new option is enabled, the ON times of each channel are > > > delayed by channel number x counter range / 16, which avoids asserting > > > all enabled outputs at the same counter value while still maintaining > > > the configured duty cycle of each output. > > >=20 > > > Signed-off-by: Clemens Gruber > >=20 > > Is there a reason to not want this staggered output? If it never hurts I > > suggest to always stagger and drop the dt property. >=20 > There might be applications where you want multiple outputs to assert at > the same time / to be synchronized. > With staggered outputs mode always enabled, this would no longer be > possible as they are spread out according to their channel number. >=20 > Not sure how often that usecase is required, but just enforcing the > staggered mode by default sounds risky to me. There is no such guarantee in the PWM framework, so I don't think we need to fear breaking setups. Thierry? One reason we might not want staggering is if we have a consumer who cares about config transitions. (This however is moot it the hardware doesn't provide sane transitions even without staggering.) Did I already ask about races in this driver? I assume there is a free running counter and the ON and OFF registers just define where in the period the transitions happen, right? Given that changing ON and OFF needs two register writes probably all kind of strange things can happen, right? (Example thought: for simplicity's sake I assume ON is always 0. Then if you want to change from OFF =3D 0xaaa to OFF =3D 0xccc we might see a period with 0xacc. Depending on how the hardware works we might even see 4 edges in a single period then.) Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --noem5j55dbfdgb7z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmBiFhoACgkQwfwUeK3K 7AmvxQf+Kp1rfako1h3M55rltPehAc3AA2Mm7QgxbFli1DO8l1yv/rHyDhoWqVGW OnGEYoCJvn3mvjJVWPHgnjwFQBoHDgsrClihzVNX+2oqM9arkRnDbZ3QE6QnBIBI eGo+kSSfsQIv7uUEyL2m2CuHivqDIGsS8khw6LdoTHzvp13vK/ICGm5zVKiRBkE2 bFSrKsuBn89LN+uYjULYcDs0nWtd61ah6ULENwttDvihVedCK55JxkFxLNUg5XRS 0SYZBvuTwjQeepWttbVCiLtpHL+dbc39ZYNQcSo7G7lS1bgj2WGTVVdb+x5xuAeC jJwGG+TgKT6QA9h41S/8Y9lzUyWT1w== =QR6o -----END PGP SIGNATURE----- --noem5j55dbfdgb7z--