[{"id":3669588,"web_url":"http://patchwork.ozlabs.org/comment/3669588/","msgid":"<acT_nz0TRM4yXwkb@orome>","list_archive_url":null,"date":"2026-03-26T09:47:36","subject":"Re: [PATCH v2 4/7] pwm: tegra: Parametrize enable register offset","submitter":{"id":92481,"url":"http://patchwork.ozlabs.org/api/people/92481/","name":"Thierry Reding","email":"thierry.reding@kernel.org"},"content":"On Wed, Mar 25, 2026 at 07:17:02PM +0900, Mikko Perttunen wrote:\n> On Tegra264, the PWM enablement bit is not located at the base address\n> of the PWM controller. Hence, introduce an enablement offset field in\n> the tegra_pwm_soc structure to describe the offset of the register.\n> \n> Co-developed-by: Yi-Wei Wang <yiweiw@nvidia.com>\n> Signed-off-by: Yi-Wei Wang <yiweiw@nvidia.com>\n> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>\n> ---\n>  drivers/pwm/pwm-tegra.c | 17 ++++++++++++-----\n>  1 file changed, 12 insertions(+), 5 deletions(-)\n> \n> diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c\n> index cf54f75d92a5..22d709986e8c 100644\n> --- a/drivers/pwm/pwm-tegra.c\n> +++ b/drivers/pwm/pwm-tegra.c\n> @@ -61,6 +61,7 @@\n>  \n>  struct tegra_pwm_soc {\n>  \tunsigned int num_channels;\n> +\tunsigned int enable_reg;\n>  };\n>  \n>  struct tegra_pwm_chip {\n> @@ -197,8 +198,9 @@ static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,\n>  \t\terr = pm_runtime_resume_and_get(pwmchip_parent(chip));\n>  \t\tif (err)\n>  \t\t\treturn err;\n> -\t} else\n> +\t} else if (pc->soc->enable_reg == PWM_CSR_0) {\n>  \t\tval |= PWM_ENABLE;\n> +\t}\n\nThis looks incomplete for the Tegra264 case where\n\n\tpc->soc->enable_reg == PWM_CSR_1\n\n>  \n>  \tpwm_writel(pwm, PWM_CSR_0, val);\n\nI think we need another write for PWM_CSR_1 here to properly toggle the\nPWM_ENABLE bit on Tegra264.\n\nOr am I missing something?\n\nThierry","headers":{"Return-Path":"\n <linux-pwm+bounces-8381-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pwm@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=rckrPF4v;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pwm+bounces-8381-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"rckrPF4v\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fhK0s6xhSz1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 20:56:13 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 50F38301875D\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 09:47:42 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 04C3638AC8D;\n\tThu, 26 Mar 2026 09:47:41 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id BEC4238C2AF;\n\tThu, 26 Mar 2026 09:47:39 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 646CFC116C6;\n\tThu, 26 Mar 2026 09:47:38 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774518459; cv=none;\n b=IsDvnVRecTbt10QXd9VKuRFicLV9bIOHaSLsVFgT8Cf8k2HEn/Ke2cmYJurfwtwYqmxabq6hD47UrRDsDhtjeQr9jQ1E5tp6x6k36uOJgWTJTtiICKQtPoHA3TxzutQBi4eSZXz9vXDGj7ZQ0AOqO5xGwiWnkIu6eVPyU0Utsls=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774518459; c=relaxed/simple;\n\tbh=OHirXVSqp9HwGREkLUc3/ocLwoNpOSgHqJF9zkeBTfY=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=I3PRDroQAdznqABPIYYKDkL4N/q2V17b74M1vecVTElz/WI8bB16mDiRjqJe0+zTTU+3tjlhm3X+KMXrOqxNTtBDiik5aV3WyIGsb5wrmSI7Sr58wwc326yWqoJXIwR5R0tn+n+mZRgRgMeLXFCzClX8hbjZwkwnSlypCmePbvQ=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=rckrPF4v; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1774518458;\n\tbh=OHirXVSqp9HwGREkLUc3/ocLwoNpOSgHqJF9zkeBTfY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=rckrPF4v1yQ2JI9bl3zfhrpeVVdKrVKpc2/vtUhDqRnzIxRgUBrLc7zs4hOkTRubK\n\t 00vQrm7oe++6Faufwggm0JvjBuEyrRSCh04OrizeQvZGdq4joiCvdXCwKkuCxRliiF\n\t SfCPRjx9C17NpKsQ8++Ch+kmkmX47A5lAXcfur47d+GRgo5SE/4PGCP+cL38GKse8a\n\t pTfoCKVCgdMB5XRhe/DI8GGHYBuTe2MCgPRyEyK9tDOItHyt/XhN/Fu7hZeH9szybU\n\t RQ2mzx/Sd+IaSbQk3In7/DydPVBFw/8nFtNVK4FLKPLCvBJTIXdxx0CtLyZ6nXpjv+\n\t EPxe3nRPfa3Rg==","Date":"Thu, 26 Mar 2026 10:47:36 +0100","From":"Thierry Reding <thierry.reding@kernel.org>","To":"Mikko Perttunen <mperttunen@nvidia.com>","Cc":"Thierry Reding <thierry.reding@gmail.com>,  Uwe =?utf-8?q?Kleine-K=C3=B6?=\n\t=?utf-8?q?nig?= <ukleinek@kernel.org>,\n Jonathan Hunter <jonathanh@nvidia.com>,  Rob Herring <robh@kernel.org>,\n Krzysztof Kozlowski <krzk+dt@kernel.org>,\n  Conor Dooley <conor+dt@kernel.org>, linux-pwm@vger.kernel.org,\n linux-tegra@vger.kernel.org,  linux-kernel@vger.kernel.org,\n devicetree@vger.kernel.org, Yi-Wei Wang <yiweiw@nvidia.com>","Subject":"Re: [PATCH v2 4/7] pwm: tegra: Parametrize enable register offset","Message-ID":"<acT_nz0TRM4yXwkb@orome>","References":"<20260325-t264-pwm-v2-0-998d885984b3@nvidia.com>\n <20260325-t264-pwm-v2-4-998d885984b3@nvidia.com>","Precedence":"bulk","X-Mailing-List":"linux-pwm@vger.kernel.org","List-Id":"<linux-pwm.vger.kernel.org>","List-Subscribe":"<mailto:linux-pwm+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pwm+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n\tprotocol=\"application/pgp-signature\"; boundary=\"eikxdheegqdrxdfr\"","Content-Disposition":"inline","In-Reply-To":"<20260325-t264-pwm-v2-4-998d885984b3@nvidia.com>"}},{"id":3670833,"web_url":"http://patchwork.ozlabs.org/comment/3670833/","msgid":"<177483744958.916245.860145469758840098.b4-reply@b4>","list_archive_url":null,"date":"2026-03-30T02:24:09","subject":"Re: [PATCH v2 4/7] pwm: tegra: Parametrize enable register offset","submitter":{"id":26499,"url":"http://patchwork.ozlabs.org/api/people/26499/","name":"Mikko Perttunen","email":"mperttunen@nvidia.com"},"content":"On 2026-03-26 10:47 +0100, Thierry Reding wrote:\n> On Wed, Mar 25, 2026 at 07:17:02PM +0900, Mikko Perttunen wrote:\n> > On Tegra264, the PWM enablement bit is not located at the base address\n> > of the PWM controller. Hence, introduce an enablement offset field in\n> > the tegra_pwm_soc structure to describe the offset of the register.\n> > \n> > Co-developed-by: Yi-Wei Wang <yiweiw@nvidia.com>\n> > Signed-off-by: Yi-Wei Wang <yiweiw@nvidia.com>\n> > Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>\n> > ---\n> >  drivers/pwm/pwm-tegra.c | 17 ++++++++++++-----\n> >  1 file changed, 12 insertions(+), 5 deletions(-)\n> > \n> > diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c\n> > index cf54f75d92a5..22d709986e8c 100644\n> > --- a/drivers/pwm/pwm-tegra.c\n> > +++ b/drivers/pwm/pwm-tegra.c\n> > @@ -61,6 +61,7 @@\n> >  \n> >  struct tegra_pwm_soc {\n> >  \tunsigned int num_channels;\n> > +\tunsigned int enable_reg;\n> >  };\n> >  \n> >  struct tegra_pwm_chip {\n> > @@ -197,8 +198,9 @@ static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,\n> >  \t\terr = pm_runtime_resume_and_get(pwmchip_parent(chip));\n> >  \t\tif (err)\n> >  \t\t\treturn err;\n> > -\t} else\n> > +\t} else if (pc->soc->enable_reg == PWM_CSR_0) {\n> >  \t\tval |= PWM_ENABLE;\n> > +\t}\n> \n> This looks incomplete for the Tegra264 case where\n> \n> \tpc->soc->enable_reg == PWM_CSR_1\n> \n> >  \n> >  \tpwm_writel(pwm, PWM_CSR_0, val);\n> \n> I think we need another write for PWM_CSR_1 here to properly toggle the\n> PWM_ENABLE bit on Tegra264.\n> \n> Or am I missing something?\n\nThis check is here just so we don't change the value of PWM_ENABLE when\nwriting the CSR_0 register. The function doesn't write to CSR_1 so\nnothing needs to be done on Tegra264.\n\nI agree it's not the clearest, but it'll get cleaned up when adding\nsupport for configurable depth, as at that point we will need to write\nboth registers on Tegra264.\n\n> \n> Thierry","headers":{"Return-Path":"\n <linux-pwm+bounces-8404-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pwm@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256\n header.s=selector2 header.b=Dsl0oNc7;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-pwm+bounces-8404-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com\n header.b=\"Dsl0oNc7\"","smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=40.93.201.14","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=nvidia.com","smtp.subspace.kernel.org;\n spf=fail smtp.mailfrom=nvidia.com","dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=nvidia.com;"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fkZsd39w0z1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 13:27:49 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id B6E4D300E251\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 02:24:18 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 2AAB1391848;\n\tMon, 30 Mar 2026 02:24:18 +0000 (UTC)","from CY3PR05CU001.outbound.protection.outlook.com\n (mail-westcentralusazon11013014.outbound.protection.outlook.com\n [40.93.201.14])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id DEE80207A32;\n\tMon, 30 Mar 2026 02:24:16 +0000 (UTC)","from SJ2PR12MB9161.namprd12.prod.outlook.com (2603:10b6:a03:566::20)\n by DM4PR12MB5867.namprd12.prod.outlook.com (2603:10b6:8:66::18) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.11; Mon, 30 Mar\n 2026 02:24:13 +0000","from SJ2PR12MB9161.namprd12.prod.outlook.com\n ([fe80::d9d1:8c49:a703:b017]) by SJ2PR12MB9161.namprd12.prod.outlook.com\n ([fe80::d9d1:8c49:a703:b017%4]) with mapi id 15.20.9769.006; Mon, 30 Mar 2026\n 02:24:13 +0000"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774837458; cv=fail;\n b=GcYTUPB6juvZxflVnQXrRpbIHsXvHMPMg5lzM3BzYBW593tz/U+Q4l9k97QyvpjdHj6bu1DJDAX9rClgKCGTH4JbEl6/yjW8CvjmA90f2cCA4VJlQn4d+r5EuP7l3qgg7wfTOOfY7zoz26Gxqnhilc2LLl4bYNAqFZxFWYGvQ7o=","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=Sl01iZ4md0Sh/owaKhr43oM4UOgymtETL0AfjXLFIs6kGqKLXVruRWwQiVlF6LWYyyH1pSiaQKnDLVTBAqBKqFEBzon66md4OzNqMmKaQqbk110lHH8pTnBp7ljbK6BM6nOBVeE16CUuRgc0hhnia/9mo8yS6rXOq1+hMIDjiUZfr++yYlD8ahYFAAGfPueMq3tjSlUoz5VASggE64GeoJVoVlYykAF6paz7/Wxm1ZVwI56yf1cBKHbtXd9fyYfDP3Ls6rfGYDaofYhM09vd+h+m91Trm1pEP89ybnAeX2jrweUHegeJCsbhHOh7DNE0RiAlYrOXPEpDzuFZWbihXg=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774837458; c=relaxed/simple;\n\tbh=4Hyo6wkYRM8HGSDNdtmZjG50hivxW2NYZOlJBFExsF4=;\n\th=Content-Type:Subject:From:To:Cc:In-Reply-To:References:Date:\n\t Message-Id:MIME-Version;\n b=A1OgAVNu609rvbu6SITKPhO91c1t+ynznwSRz/nKaLRBfWTbFm1eAbMgHjFrEGIqGPwZi9Q1DU5J3mNu9u0uGhwc1ogSnMIyiITGp/MefzgyC6fG/tjjrHKz1mFKogHbY6VO2GZG2n0N5spHCnMjaUFCKbOaG6f42uHtUc8a/M0=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=iOOa0Z92dEhFw6UvZgRQk//EcFQFJpg8mZp/mknRAIY=;\n b=AZCjmrJYrNeNck9tDuy9+lyaMIpiLNnq+gn34vbijcg1bu4U2j9QkDCgpXg8yH84tUYvajtOnmOEY5l5sau6JDV23rUGZV5rl6Gw6FWINOxLj8QlFrWotdJQAfN551QjFMou8+WxzqzVVDQE25jaHNB2KGERnf8nO5N+V4kBm3j+n8QTby4DKu3uF74TWcrue2Y2/4G/Du1iffEYo6a0IXFedv1Z9yQIiFbHWdE+fxwHHkOfWSwbwZw+j0NOc4rLDOTrZ6DpuFtuPw4hKnUeQQU5EfYHsZ9PWhLylGPh08H+MS8TwnMRszdRGsXiLGrHo42HMoH+ayZRXUB8HZm/lw=="],"ARC-Authentication-Results":["i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=nvidia.com;\n spf=fail smtp.mailfrom=nvidia.com;\n dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com\n header.b=Dsl0oNc7; arc=fail smtp.client-ip=40.93.201.14","i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;\n dkim=pass header.d=nvidia.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=iOOa0Z92dEhFw6UvZgRQk//EcFQFJpg8mZp/mknRAIY=;\n b=Dsl0oNc7yQ90ZB/jOhFKwLEPIMvk140THuV680QUX8j7Mqb7JIm5GnwYErqRTpaq9BkffqqqXqG4jPP0NWioCxG4VZc7lthbF4ozSqusIRssC4OGZkUG3g5Ofn87KTuIeR330J/VFBVzNikY1U/BrYoxG6XaUbSnFkxIT1eaJNw2n32MsjoXDvHlvKmyxHI1lZ+Wc36OipVQTiUyL4xJOBRZil9fhGN+FHE4hlCVtAmuZKT+zLwShtOABJ8jLFM5GeByfhFVGPlokspVHbmM/R2jJVWD8g4anWy8MB+bnt3whqI/bnausH1dV6FexaV3boRpY5fj1+4+rfqNswJC0Q==","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Subject":"Re: [PATCH v2 4/7] pwm: tegra: Parametrize enable register offset","From":"Mikko Perttunen <mperttunen@nvidia.com>","To":"Thierry Reding <thierry.reding@kernel.org>","Cc":"Mikko Perttunen <mperttunen@nvidia.com>,\n  Thierry Reding <thierry.reding@gmail.com>,\n =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <ukleinek@kernel.org>,\n  Jonathan Hunter <jonathanh@nvidia.com>, Rob Herring <robh@kernel.org>,\n  Krzysztof Kozlowski <krzk+dt@kernel.org>,\n  Conor Dooley <conor+dt@kernel.org>, linux-pwm@vger.kernel.org,\n  linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,\n  devicetree@vger.kernel.org, Yi-Wei Wang <yiweiw@nvidia.com>","In-Reply-To":"<acT_nz0TRM4yXwkb@orome>","References":"<20260325-t264-pwm-v2-0-998d885984b3@nvidia.com>\n <20260325-t264-pwm-v2-4-998d885984b3@nvidia.com> <acT_nz0TRM4yXwkb@orome>","Date":"Mon, 30 Mar 2026 11:24:09 +0900","Message-Id":"<177483744958.916245.860145469758840098.b4-reply@b4>","X-Mailer":"b4 0.16-dev-ad80c","X-ClientProxiedBy":"TYCP286CA0239.JPNP286.PROD.OUTLOOK.COM\n (2603:1096:400:3c7::17) To SJ2PR12MB9161.namprd12.prod.outlook.com\n (2603:10b6:a03:566::20)","Precedence":"bulk","X-Mailing-List":"linux-pwm@vger.kernel.org","List-Id":"<linux-pwm.vger.kernel.org>","List-Subscribe":"<mailto:linux-pwm+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pwm+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"SJ2PR12MB9161:EE_|DM4PR12MB5867:EE_","X-MS-Office365-Filtering-Correlation-Id":"a89064ac-80d6-4003-d4d7-08de8e036ec7","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"\n\tBCL:0;ARA:13230040|366016|1800799024|10070799003|376014|7416014|22082099003|18002099003|56012099003;","X-Microsoft-Antispam-Message-Info":"\n\tnTZJy5tzR6uU6XGRjDmv+8NbiMgMRAgpizn8jZeSULnUBEsIVhOxlTjHclSByoMryj9c9sU1dG1B8IFgy0CifS3YTAmZ0Ewy5tEXuKbCGeeqiB3yiyuDNvFQQigxqXA1WzrrV/g1b7v0ySJtVQEBi6DrLyfjKiNyidjXT5H6BbuYf8Hn1vSWm1zL9DEw5h4ft44JYLJNAh+3LhXm4bC/iZfEyQDnaO4rUGYG7A60FARrKtQwtvR08IAbdpy1sqtrgxmyoi2GPV0rlkMW26LAMPMADsGv66AjGenxSSq8dnZrohIleLT4TuSqChUEWi/RK6bCIucPd0/UZOAZGhtunO4Yfdvqe3w6czD5/emUi9Qf1tzcklGv/XgF7rgyIcXMH2prlm1K68PRDclK5N2vQtGZYkBvNm1wwrZkN/makk66YqXexGvyl6/LEN2RfAG7ANLUiFw2HZ3NsWn4syVYQtc0mPfuaNfJMQ/YYZ3y9yRdRKLLVx9tx6AWKkhoP6QoKfiHwR7SUKBxYdgkoLkyE7PuP0/fJpviOkE6xCWEni4ifSg4gB7pthgwiC0x3Xo8VbeQPdmyf+uqyUxxSSVT+rgJ8XtHUsY3dx9vY49GDfsNU003ocJbGH6eAmjqRuPH2ev7QgKgAlAXV1cX7U6i1AWr0FkmqZxuzNUQnn/bNOAGOixodvZyk9PjcTMlNM23GLuof/O1W3Fn2Z7HsYUBT68R/at/f5V81kiEHXO1JsQ=","X-Forefront-Antispam-Report":"\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR12MB9161.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(10070799003)(376014)(7416014)(22082099003)(18002099003)(56012099003);DIR:OUT;SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"2","X-MS-Exchange-AntiSpam-MessageData-0":"=?utf-8?q?7w5zS+Sp08JxM4TOOHdH3hRIWOA9?=\n\t=?utf-8?q?tc/eXKuTrL+runXHYe7/PqLoD5DPGVUW/4YTHHSdICphVJ8D+aXo99lT6g0qWhmam?=\n\t=?utf-8?q?q2nP5B3FQUJiYS8O290ozNZAOfwSIv+NUPqB2YjZEQqbYd6fOdpRbg0BeUFPA2ZHq?=\n\t=?utf-8?q?cG/FUI7zLEetkyt2cmfrBdgbaLK63oVNx3PAWguKpDjiOLi8q1R0P1p/K3TgeLDVj?=\n\t=?utf-8?q?Kb8yQ/LocY5hHbAnfLcItACO6mnqeImCBEdtkxngfDVSBT849dK7IfI21xoagO3qJ?=\n\t=?utf-8?q?HFdS6ENkCRxyo6SsvJ3HcDEPMxQCeTtXtdp4nA7+LfYO86mINyh4IoLZsfG2AG5lE?=\n\t=?utf-8?q?yTRHaOtOEfjn9hBFOw4de6JwRc2z2yNwa4f9j7rXdvQ5RuyEVZcVnX6QkSjJj2imk?=\n\t=?utf-8?q?YYhJ3mUEIcgX4Oni6depPVDB6eluwUlm1r2Xwz4Tv+43+Fwq3tEYg5K1l2v5SY8M1?=\n\t=?utf-8?q?QWA4wWedDeiI2Gp/hHuuEEc/JSL9trA+Hl8pgmNllT1W2mQoHA94VLzg6dGla+hor?=\n\t=?utf-8?q?oM7MRCNp7P6XXR/aYqr5z8WbhlxiTlEEbHRL7IjuTgsHs4xzBE2lo+YL0LQ2TKx11?=\n\t=?utf-8?q?7iLxvgZaTP6mah5Bidw/PaFtxWjeNDsILBTW87s1IKXATDifCSp7JYd57C/YZsYEP?=\n\t=?utf-8?q?yGsiOWDzwKBUzlfMTgCklOWRdp4IXtXwsW0WtpStvyevV993ZdGRAh/C6nVdsOqT9?=\n\t=?utf-8?q?jZq0zNBrjAfyzBVVhPo2A7RIZFnnWy8cOoPBQawIlrK5KAeNSB6SuQdW9PY6VqePb?=\n\t=?utf-8?q?IifS7/QlxfLP/zKXzLAjWqLxw6nw94iJrvkLoy85VcUd9OqppS5fG6OTlA2HEF8q7?=\n\t=?utf-8?q?Ql9CcC93oeqAGemffCg+xx6XS5TrWbNFAiVefiLNJ1jqnr41g3LQCnAZ0XBJDSY5F?=\n\t=?utf-8?q?ZFDEDnkNiLP2DEHdiEN6L5Ni3pUNb5mDDilcb2Ehi6MhqCX59kHxDG2NW/RzV1TJV?=\n\t=?utf-8?q?IoK+EbI7KkZECPQN7ngEaMe7eK1lqXn984coKZ5XitlBoq0J1ywKVHcMX5rcZQhO7?=\n\t=?utf-8?q?wI1skUgKCm+5xahIWULDbaEHYMhtvaxS8xaUbdkaLCLr5Glz4Loeu2IFpA+1Q110m?=\n\t=?utf-8?q?hLtAZQIkYSfgcXrdJK7JEwgDabAVQKJNnRJI/rr9af6waSF0RVIahfXcupie6R1wW?=\n\t=?utf-8?q?VPsUhx7plbWxgnBLrs8ci17ktxcyb4fk/RZ4vRUtDhjywjpH0DYDmdQAFPwbtqvNZ?=\n\t=?utf-8?q?gGQjYxOLJirX1DeK+l2eF8IG7NUcJYATHo3HUEL2+vy8YSdX9QMyKTKwjbA1a1GwK?=\n\t=?utf-8?q?CC0GmrwLO1kKT2bnp/VdI1iAegZCE0NrTPl9bZSv5sQHHy0N9iauDXSWE2FIxu+8M?=\n\t=?utf-8?q?kYjIwwQ3mMf3D6RVQtqRjzJMYqeCiNHdpSLrvhlV/3n3QfnEz7hQ2Yqi3JpmC4C2k?=\n\t=?utf-8?q?sF64VeVWbBwSCiZrHP9XJcOZgIyPCBlOpzHAyrw4DTlaQAURxgKpOe1AHaKNl+ux5?=\n\t=?utf-8?q?mLMo0ECo+zWo1dXBAepfPclStQ+TleStJs6tR4KK5++bsVk7uJFTBivNtfPb9r4nG?=\n\t=?utf-8?q?e/aoP8nlQm+mpe/02/FXFZK8W/BktlxO54X8xOQlAMnNjd9s8s1x6v8GO+2Apv/C4?=\n\t=?utf-8?q?DGZXehpt8pOhVWBWCogtWteATgVteq8p7Vomq0LJbcAS7Qs1KUA0rRs3ODJxSW2lZ?=\n\t=?utf-8?q?3x5Dim/d7tKzmQdZEMxzO1kXDmqz0TV9CqiEbrW2+FQnqcC3uUZ4MtmkQTeygrHzi?=\n\t=?utf-8?q?1ZfwH7wLFIFnvFCHU?=","X-MS-Exchange-AntiSpam-MessageData-1":"QZkmO6H+xFYL7w==","X-OriginatorOrg":"Nvidia.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n a89064ac-80d6-4003-d4d7-08de8e036ec7","X-MS-Exchange-CrossTenant-AuthSource":"SJ2PR12MB9161.namprd12.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"30 Mar 2026 02:24:12.9270\n (UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"43083d15-7273-40c1-b7db-39efd9ccc17a","X-MS-Exchange-CrossTenant-MailboxType":"HOSTED","X-MS-Exchange-CrossTenant-UserPrincipalName":"\n aZwOxXqdoosJRpsMvzD1bHUbI7OJkEUAbzoFTkEVojYX2Dp5xcpM8vAghJi28h+8wg4ed1yazanS37U9Xppzlw==","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DM4PR12MB5867"}},{"id":3671487,"web_url":"http://patchwork.ozlabs.org/comment/3671487/","msgid":"<act27bArVQd_oGdA@orome>","list_archive_url":null,"date":"2026-03-31T07:27:15","subject":"Re: [PATCH v2 4/7] pwm: tegra: Parametrize enable register offset","submitter":{"id":92481,"url":"http://patchwork.ozlabs.org/api/people/92481/","name":"Thierry Reding","email":"thierry.reding@kernel.org"},"content":"On Mon, Mar 30, 2026 at 11:24:09AM +0900, Mikko Perttunen wrote:\n> On 2026-03-26 10:47 +0100, Thierry Reding wrote:\n> > On Wed, Mar 25, 2026 at 07:17:02PM +0900, Mikko Perttunen wrote:\n> > > On Tegra264, the PWM enablement bit is not located at the base address\n> > > of the PWM controller. Hence, introduce an enablement offset field in\n> > > the tegra_pwm_soc structure to describe the offset of the register.\n> > > \n> > > Co-developed-by: Yi-Wei Wang <yiweiw@nvidia.com>\n> > > Signed-off-by: Yi-Wei Wang <yiweiw@nvidia.com>\n> > > Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>\n> > > ---\n> > >  drivers/pwm/pwm-tegra.c | 17 ++++++++++++-----\n> > >  1 file changed, 12 insertions(+), 5 deletions(-)\n> > > \n> > > diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c\n> > > index cf54f75d92a5..22d709986e8c 100644\n> > > --- a/drivers/pwm/pwm-tegra.c\n> > > +++ b/drivers/pwm/pwm-tegra.c\n> > > @@ -61,6 +61,7 @@\n> > >  \n> > >  struct tegra_pwm_soc {\n> > >  \tunsigned int num_channels;\n> > > +\tunsigned int enable_reg;\n> > >  };\n> > >  \n> > >  struct tegra_pwm_chip {\n> > > @@ -197,8 +198,9 @@ static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,\n> > >  \t\terr = pm_runtime_resume_and_get(pwmchip_parent(chip));\n> > >  \t\tif (err)\n> > >  \t\t\treturn err;\n> > > -\t} else\n> > > +\t} else if (pc->soc->enable_reg == PWM_CSR_0) {\n> > >  \t\tval |= PWM_ENABLE;\n> > > +\t}\n> > \n> > This looks incomplete for the Tegra264 case where\n> > \n> > \tpc->soc->enable_reg == PWM_CSR_1\n> > \n> > >  \n> > >  \tpwm_writel(pwm, PWM_CSR_0, val);\n> > \n> > I think we need another write for PWM_CSR_1 here to properly toggle the\n> > PWM_ENABLE bit on Tegra264.\n> > \n> > Or am I missing something?\n> \n> This check is here just so we don't change the value of PWM_ENABLE when\n> writing the CSR_0 register. The function doesn't write to CSR_1 so\n> nothing needs to be done on Tegra264.\n> \n> I agree it's not the clearest, but it'll get cleaned up when adding\n> support for configurable depth, as at that point we will need to write\n> both registers on Tegra264.\n\nAh... nevermind. I realize now that we're not touching PWM_CSR_1 at all\nin tegra_pwm_config(), so there's no need to explicitly set PWM_ENABLE.\n\nIf moving to the new APIs, that would need to change, but for the legacy\nPWM callbacks this is probably fine.\n\nThierry","headers":{"Return-Path":"\n <linux-pwm+bounces-8441-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pwm@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=pLpjq19P;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-pwm+bounces-8441-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"pLpjq19P\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4flKbs1L0Sz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 18:33:29 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 41646304AC0F\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 07:29:04 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6A8473C13EF;\n\tTue, 31 Mar 2026 07:27:18 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 4428A3BE632;\n\tTue, 31 Mar 2026 07:27:18 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 859FFC19423;\n\tTue, 31 Mar 2026 07:27:17 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774942038; cv=none;\n b=SjY2wRn/DMv0MM0X8d1KG4giC1ro0Qiun4AzzrOYQTr5Y3TFIgsUk1di0b2VLSx9j1liCl1Voyzgzf8SAteGcuk/EiMpxHn7GmOTUy8sLyRkB9ChhvSPvT+4E7NvSHE3XRl79oK/NP0qsfirAZrD0lLBLa7bT7BTeqXSr1SBhPI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774942038; c=relaxed/simple;\n\tbh=X3yeokNyZn70wlzcDKDkqaW2bU/NrHBKm0YhEEm8C3s=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\t Content-Type:Content-Disposition:In-Reply-To;\n b=pM9m3ODD+VTMoC8kz95CShpDFlgpdKhcnLtwup+yR4jWZj55xmZhnn7EEZbwWiamjOFpXOPwzMejoMTlN4NI5cE14TeYpjA36dyeRo4iMN4nALMV3hPeaiaw/xn4y2sWMGIUyDwX38BgX+rXPO9kAbF5RfnYehXE5owL2bdJAz4=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=pLpjq19P; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1774942037;\n\tbh=X3yeokNyZn70wlzcDKDkqaW2bU/NrHBKm0YhEEm8C3s=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=pLpjq19PE1SvYAIgikedhFgItbR1nnEWD5PfIOYkpgq1UhPPvheKQ6vZtsFZCaCBq\n\t u6T8jCDGkZi8NHC8rIRG4A8h9p9/x7bFjYWOixLN02gtHe6EwClLJ83jKSIOWAJtUN\n\t Dl0WvfrJ6kZL7V6xrGCaIXk2yw1OF1mwZAlNa6HcJ1egtOfv1JfKCoNOuFB8qxrl2j\n\t cG81rVGfxEbq1beD6Znz8Ja2INBnqa5RbQolxmANaiteZaTPfP9s5fKHZkv+a7uwNi\n\t rXNLXkxumleCcNn5vZC1Z7h6TSN7AUCmsrkEO3iC3oc9Jj26CEtXQ1wmn5upb2IKey\n\t YtJgUUgCLmmLQ==","Date":"Tue, 31 Mar 2026 09:27:15 +0200","From":"Thierry Reding <thierry.reding@kernel.org>","To":"Mikko Perttunen <mperttunen@nvidia.com>","Cc":"Thierry Reding <thierry.reding@gmail.com>,  Uwe =?utf-8?q?Kleine-K=C3=B6?=\n\t=?utf-8?q?nig?= <ukleinek@kernel.org>,\n Jonathan Hunter <jonathanh@nvidia.com>,  Rob Herring <robh@kernel.org>,\n Krzysztof Kozlowski <krzk+dt@kernel.org>,\n  Conor Dooley <conor+dt@kernel.org>, linux-pwm@vger.kernel.org,\n linux-tegra@vger.kernel.org,  linux-kernel@vger.kernel.org,\n devicetree@vger.kernel.org, Yi-Wei Wang <yiweiw@nvidia.com>","Subject":"Re: [PATCH v2 4/7] pwm: tegra: Parametrize enable register offset","Message-ID":"<act27bArVQd_oGdA@orome>","References":"<20260325-t264-pwm-v2-0-998d885984b3@nvidia.com>\n <20260325-t264-pwm-v2-4-998d885984b3@nvidia.com>\n <acT_nz0TRM4yXwkb@orome>\n <177483744958.916245.860145469758840098.b4-reply@b4>","Precedence":"bulk","X-Mailing-List":"linux-pwm@vger.kernel.org","List-Id":"<linux-pwm.vger.kernel.org>","List-Subscribe":"<mailto:linux-pwm+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pwm+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n\tprotocol=\"application/pgp-signature\"; boundary=\"czd7pk4dwbs6pmxq\"","Content-Disposition":"inline","In-Reply-To":"<177483744958.916245.860145469758840098.b4-reply@b4>"}}]