Received: by 2002:a05:7208:31d3:b0:81:e143:7c29 with SMTP id v19csp416517rbd; Fri, 5 Apr 2024 08:14:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWN2eDS8YU0kRvd+i6SQECu7A2tmLH6q01BrTez0u/3qLHxryr7eP/d9or0PG27ftmmNTdeBtC/WKWcnx28/flcur2i5Ud2JeTo16KlJQ== X-Google-Smtp-Source: AGHT+IE6H3vZZDulxcQBtIJpI2NqpYSV672OweNjLWWqpMD0pgDYXVW8PuD/jvA0tWcDdssUiUwr X-Received: by 2002:a50:ab50:0:b0:56e:316f:f455 with SMTP id t16-20020a50ab50000000b0056e316ff455mr951636edc.22.1712330094305; Fri, 05 Apr 2024 08:14:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712330094; cv=pass; d=google.com; s=arc-20160816; b=vLvUq5B0dB01zUhemjbouJW3EI0mAv0xf9uFWNug5NKfeHik4zqaxn5L3K290oUQJW E6TMo+zVpwyfUAKkgwf8Qe0vqk9NycDuEGpu7bfTNUHSE7Cb4kfPqbPQNeQ3qLLmgpxt t0vpf/ZVgs3bqAeIxFEiSLSwDw37S7An03XQBsMMJpCyl3Wavs4ihMHnwNoND5vJA2J7 U6wtlKH6gJbgVtjFkrOddnKV5Coy9CO9cRK1U8R1BT6YYdbJ4Ub/eRU1OkLiGRdLq/KW YX+ef0bVgjkbNK6xOGNLv3dcNFitpzRkSCZ65aSSg+9CU36uqtEScOOtgSyULT8nRVKN axEQ== 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=2LWnADyhMhg5WmSoukYNwi7kYuBotdnarFMaZNc2SeQ=; fh=3Rygi5D6OSB946riR9FiOq52DdXxMFfcY6G/tJAgO+Y=; b=fiikOfsNPwdzDQnHRbDY/ypRByJrdXnLQHKxH+YUeVDD8/3r7EltUXloUI603BbJnw wMonMVYjb9OuW72Wx5Z9SjFks1LKogMzJKLce4iRo//Z1TkDy1dfcqNQeDEczMtN/74n j7/AfupgDhi03teef2Auu7sd5Co161+QjL3fsoV1ZMHEBySLJ3XM0hSI4/y4aapKdJev I7WQ7Ph5nGDySluC0CzL8Q+RAM4+Yl0MDB4/NL5OH3G0h+Oiu4O7m4d2R8cSNhualJuv QaqBm3/wmImIvMIyyPZcR60MKIgGqM0GTSoufgA6+miOlWdW0WxS2EyAVGrHYSKCM3XX aBVA==; 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-133224-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133224-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m18-20020a056402511200b0056c1b26f29csi838004edd.560.2024.04.05.08.14.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 08:14:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133224-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-133224-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133224-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 172B41F23E4B for ; Fri, 5 Apr 2024 15:14:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38BC016F850; Fri, 5 Apr 2024 15:14: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 19B3916F84A for ; Fri, 5 Apr 2024 15:14: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=1712330087; cv=none; b=PJWnOnk8ssYFSGZDVmIHVAgS4UJyTuYOvHz2bURB/VJsYAv+7m+c4MAIiEEKOHmS24ulwTNJXxDvvo6rexyaWBOA+Si+OH+51Qa5LYQSS//cJbvtf9xn3fBvZcUgY37RzFTp4BD7wGFD0lkRS0IpuisPcipGcKuS8hhcojtG3ig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712330087; c=relaxed/simple; bh=snf41gCimFFTVbLiUagJ2pBfBfC8jnvj5uqnhSaspAM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uV53W5O2AOst6IJJLuXFhbeQLMlN15ENLqaHhqBlH3OcQ3C1RVn9uiabr634YFFUnd0Bey7PLHoekQDv7vTVccvMnfzqNpU/CoOD9Mq4tAExs9G7Gf/rbICdFNM77z1ucqmJkNJw0eAxV9AL0Qq1WExHbzXOEbwA7VK7gpG2Evk= 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 1rslH9-0003tV-1z; Fri, 05 Apr 2024 17:14:43 +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 1rslH7-00AaFd-Tr; Fri, 05 Apr 2024 17:14:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rslH7-00FWAw-2i; Fri, 05 Apr 2024 17:14:41 +0200 Date: Fri, 5 Apr 2024 17:14:41 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Trevor Gamblin Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, michael.hennerich@analog.com, nuno.sa@analog.com, dlechner@baylibre.com Subject: Re: [RFC PATCH 0/3] pwm: add support for duty_offset Message-ID: References: <20240405003025.739603-1-tgamblin@baylibre.com> <9b2bab7a-24a7-49da-8cb8-f58e28baf065@baylibre.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="ihutw3or4wakatkd" Content-Disposition: inline In-Reply-To: <9b2bab7a-24a7-49da-8cb8-f58e28baf065@baylibre.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 --ihutw3or4wakatkd Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Trevor, On Fri, Apr 05, 2024 at 10:19:20AM -0400, Trevor Gamblin wrote: > On 2024-04-05 08:23, Uwe Kleine-K=F6nig wrote: > > Having said that I don't like the addition of .supports_offset to > > struct pwm_chip, which only signals a new incomplete evolution of the > > pwm framework. Better adapt all drivers and then assume all of them > > support it. > Can you clarify what you mean here - is the intent to put basic handling = of > duty_offset (even if that means simply setting it to 0) in each driver? Well, it's a bit more complicated than setting it to 0. It involves translating a setting with inverted polarity to one using .duty_offset and make all drivers implement that accordingly. For drivers that support both polarities the logic in .apply should be: if (.duty_offset >=3D .period - .duty_cycle) ... set inverted polarity else ... set normal polarity I'm usure how to do the transformation in reviewable chunks. Maybe the easiest option is a new .apply callback that honors .duty_offset? Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --ihutw3or4wakatkd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmYQFWAACgkQj4D7WH0S /k6HTwgAlpLr1QB5F/boxHcwG6Vj9ErqXPT9OYI53ScblBJLwDhQkVrysQrVcAum NmEzuWD670w4+H/v/uuxM/BXYNboNBcLH28i8aZRMXsqQ2OKytZkKDUUjtxZojVq h2s8l4S/hs5EFp/L0eeWYpPd2oBD+hIWH0Ltv4VLLfrscXLfDfOa5c56ptUBdL8N gUa8GGbJ+vCNO6gZaIaqOc2sJttunmY8TVxP6qIakvyLCVfad8zq++D768Eyd8H1 8vGL1SWYOnw338OkkwQWxZ8zTCPGxAJcPT826i11IntYTr/bPQBkvtUCKvndWqOT t8dHlqoPfVe9ZuBIraPCQsbVerTbBA== =pUxM -----END PGP SIGNATURE----- --ihutw3or4wakatkd--