Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp244370lqp; Wed, 22 May 2024 03:23:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXj5dCgzJMrD2enLBzlaT8GJNJoEG2/LAms5Xf5XGd2ZaEoSCu2LBHWTmbcxBXZuAY3QEqK84ZnVCQ4l7dw8Nwe1nKDES9U+zG795IDw== X-Google-Smtp-Source: AGHT+IGzeNctTNK6oxNw86upa31SoE6bBgt0d67vE+In8vFnTguHetSc6y8HeDGyhL+k7IvsWYIy X-Received: by 2002:a05:6214:2b9d:b0:6a9:8c94:a6e6 with SMTP id 6a1803df08f44-6ab7f37512amr14635196d6.37.1716373434823; Wed, 22 May 2024 03:23:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716373434; cv=pass; d=google.com; s=arc-20160816; b=bfN0jTeKxUs/k7qRczwjEMu/yLcgcDk12zT1oYCU3T15gsPitfVMLZ4fNjgZ/hNJ3W BStjC594epMMGkqXikJ54WHk39f/V5P3MUXxI9OiA6nQ+/4hAx0kr4sTqzm76wkB7DzK Uvdg4xr2Cl92dGKuxexu3ZL4qEmGez+h4xEA2bMtLrQcoN0BenY9DhtMnyHWm3ZtfJE0 fnOc3Kw9FY0saTKHbdrDBt2Fr/zHxTVVZAOnSZxeidKJU/Fet4x6Ozpc+2LVHEa4nBcH 7mrQ7ifhZfy51RgunA5g72oNwx7vLtJPAtPCzAkCB7fHVEL4gCm2+r+t5TThH+4EzlG9 CXNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=F/EaGnhNtkYxEj4b+VJlBSxCDWsm0hOCPZDhAsWLR1g=; fh=/VjQZ4u115kKyMR+JzkVH54XfvmLGXi309eqADWaGMU=; b=fP9DOdSlndhTqlOxudlgBERZYP+FbcZaX0jMKFVymTo/dDpj/YtFRu9uqWOKKtGqpV G8lYzp48Vb8k9EqLwSudpR3M0vtxR6KMYdmxfqbZpzz0U991S7lujJXvFDinNHc2UsSo zpjDPuh2VD3d+rjn34mgQ7Ji8RLAbErXv3IkBTbgr21OpbXvTg8nDBIK4UeSEKrBas7c ASq5mdCKt8fe6hptU15BsDYspdMtXKcdqMgHx4+7fhDG53XpLz8Tm+xlrgODiZbBorLr y1qkWLjvh1Tt0W6uccldJtsmUYqjN/aUEcKBbLh6emOHKqz6cm02tJKLQQTeB2FOUxvI PY0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-186050-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186050-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a93dcc948bsi89943666d6.45.2024.05.22.03.23.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 03:23:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186050-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-186050-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186050-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0FE1E1C20D29 for ; Wed, 22 May 2024 10:23:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20E89823BF; Wed, 22 May 2024 10:23:48 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C69F37C097 for ; Wed, 22 May 2024 10:23:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716373427; cv=none; b=KG8TL0LmJWVvHqBDk4/ugeqVia9uAwMhmk5fL3Un49B1CfwZu7v9LeqmSUElbkcZpN7Qg/5uBVezyMRnei/3+g5h+0w+Nd1AKoH4wTyFB9NCS9SiJSE9mF00Iy1MsHlpPu7RBWts3/BKL4hfcLTunoiXzD8sKd9o5xjo2h9bOCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716373427; c=relaxed/simple; bh=8Jv2FoH6NJPjGOP0LC/PqVRnbeV7oAwm/+X5xjFYdEk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KZ0aUMojf6ycFIXK204ke/t2I5E381vvWJAbI5/lrJMTHFoRrrIKRt2awwKig4QSvj3rO4nczogSTNCf7cRztVKLErqmE0ibr0jCvdFtvmu4kGiGPTZZj1REYs83Aq0dVqSjGv/Nqo6p4pCRlPphTOeMXdSI9aabOLmwuCTnvyI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s9j8I-0000WW-JS; Wed, 22 May 2024 12:23:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9j8H-002Vkx-RJ; Wed, 22 May 2024 12:23:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1s9j8H-009uTO-2Q; Wed, 22 May 2024 12:23:41 +0200 Date: Wed, 22 May 2024 12:23:41 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Laurent Pinchart Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, Bartosz Golaszewski , Conor Dooley , Krzysztof Kozlowski , Lee Jones , Linus Walleij , Rob Herring , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Clark Wang Subject: Re: [PATCH 5/5] pwm: adp5585: Add Analog Devices ADP5585 support Message-ID: References: <20240520195942.11582-1-laurent.pinchart@ideasonboard.com> <20240520195942.11582-6-laurent.pinchart@ideasonboard.com> <20240521100922.GF16345@pendragon.ideasonboard.com> <20240522101335.GE1935@pendragon.ideasonboard.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="njhuclhgrbcf33b5" Content-Disposition: inline In-Reply-To: <20240522101335.GE1935@pendragon.ideasonboard.com> X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --njhuclhgrbcf33b5 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Laurent, On Wed, May 22, 2024 at 01:13:35PM +0300, Laurent Pinchart wrote: > On Tue, May 21, 2024 at 03:05:53PM +0200, Uwe Kleine-K=F6nig wrote: > > On Tue, May 21, 2024 at 01:09:22PM +0300, Laurent Pinchart wrote: > > > On Tue, May 21, 2024 at 10:51:26AM +0200, Uwe Kleine-K=F6nig wrote: > > > > On Mon, May 20, 2024 at 10:59:41PM +0300, Laurent Pinchart wrote: > > > > > + if (state->polarity =3D=3D PWM_POLARITY_INVERSED) > > > > > + swap(on, off); > > > >=20 > > > > Uhh, no. Either you can do inverted polarity or you cannot. Don't c= laim > > > > you can. > > >=20 > > > OK, but what's the rationale ? This is also an area where I couldn't > > > find documentation. > >=20 > > I don't have a good rationale here. IMHO this inverted polarity stuff is > > only a convenience for consumers because the start of the period isn't > > visible from the output wave form (apart from (maybe) the moment where > > you change the configuration) and so > >=20 > > .period =3D 5000, duty_cycle =3D 1000, polarity =3D PWM_POLARITY_NORMAL > >=20 > > isn't distinguishable from > >=20 > > .period =3D 5000, duty_cycle =3D 4000, polarity =3D PWM_POLARITY_INVER= SED > >=20 > > . But it's a historic assumption of the pwm core that there is a > > relevant difference between the two polarities and I want at least a > > consistent behaviour among the lowlevel drivers. BTW, this convenience > > is the reason I'm not yet clear how I want to implemement a duty_offset. >=20 > Consistency is certainly good. Inverting the duty cycle to implement > inverted polarity would belong in the PWM core if we wanted to implement > it in software I suppose. I'll drop it from the driver. This isn't as easy as it sounds however. From the POV of the PWM core the capabilities of the currently used hardware are unclear. So if a request with (say) normal polarity and a certain duty_cycle + period fails, it's unknown if it would be beneficial to try with inverted polarity and if that is OK for the requesting consumer. So there is information missing in both directions. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --njhuclhgrbcf33b5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmZNx6wACgkQj4D7WH0S /k7gSQf/eP3kBKkVvjsZKN2YXLxC/e3LV/e5b/nZfHIgt3CEctZeTQcGfZLQa5V+ WVkCjKeolCGJXYxsB84okaHK/6GPQ+cWMquFk4qbN28WgIHSj+7HJCkaqDY14Ar/ 9oW8fVNG4s9ZpbeQPJ4iH4b5zrx+JSQRzeW2hw9l+XvCeMG8d9Eno8m9CERF72ud 6dL1fkPvxjtFklYNgqwGavc65n+kqme2GvfHu87ZkPHb4lLH14tMtlZOmlaIKGpS hUJSMQugUreF6MndO9VsMpmKK80YigNY7L4d8D19W1H5nwvTaxuO5kwahMbYas0f 4LqNkFV5ycdF43EAUXChc/1w57dTyQ== =s0N3 -----END PGP SIGNATURE----- --njhuclhgrbcf33b5--