public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@kernel.org>
To: Mikko Perttunen <mperttunen@nvidia.com>
Cc: "Thierry Reding" <thierry.reding@gmail.com>,
	"Uwe Kleine-König" <ukleinek@kernel.org>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-pwm@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	"Yi-Wei Wang" <yiweiw@nvidia.com>
Subject: Re: [PATCH v2 4/7] pwm: tegra: Parametrize enable register offset
Date: Thu, 26 Mar 2026 10:47:36 +0100	[thread overview]
Message-ID: <acT_nz0TRM4yXwkb@orome> (raw)
In-Reply-To: <20260325-t264-pwm-v2-4-998d885984b3@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 1462 bytes --]

On Wed, Mar 25, 2026 at 07:17:02PM +0900, Mikko Perttunen wrote:
> On Tegra264, the PWM enablement bit is not located at the base address
> of the PWM controller. Hence, introduce an enablement offset field in
> the tegra_pwm_soc structure to describe the offset of the register.
> 
> Co-developed-by: Yi-Wei Wang <yiweiw@nvidia.com>
> Signed-off-by: Yi-Wei Wang <yiweiw@nvidia.com>
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
> ---
>  drivers/pwm/pwm-tegra.c | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
> index cf54f75d92a5..22d709986e8c 100644
> --- a/drivers/pwm/pwm-tegra.c
> +++ b/drivers/pwm/pwm-tegra.c
> @@ -61,6 +61,7 @@
>  
>  struct tegra_pwm_soc {
>  	unsigned int num_channels;
> +	unsigned int enable_reg;
>  };
>  
>  struct tegra_pwm_chip {
> @@ -197,8 +198,9 @@ static int tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
>  		err = pm_runtime_resume_and_get(pwmchip_parent(chip));
>  		if (err)
>  			return err;
> -	} else
> +	} else if (pc->soc->enable_reg == PWM_CSR_0) {
>  		val |= PWM_ENABLE;
> +	}

This looks incomplete for the Tegra264 case where

	pc->soc->enable_reg == PWM_CSR_1

>  
>  	pwm_writel(pwm, PWM_CSR_0, val);

I think we need another write for PWM_CSR_1 here to properly toggle the
PWM_ENABLE bit on Tegra264.

Or am I missing something?

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-03-26  9:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 10:16 [PATCH v2 0/7] Tegra264 PWM support Mikko Perttunen
2026-03-25 10:16 ` [PATCH v2 1/7] dt-bindings: pwm: Document Tegra194 and Tegra264 controllers Mikko Perttunen
2026-03-25 14:22   ` Thierry Reding
2026-03-26  0:47     ` Mikko Perttunen
2026-03-26  9:41       ` Thierry Reding
2026-03-26  8:41     ` Krzysztof Kozlowski
2026-03-26  8:36   ` Krzysztof Kozlowski
2026-03-25 10:17 ` [PATCH v2 2/7] pwm: tegra: Avoid hard-coded max clock frequency Mikko Perttunen
2026-03-26  9:35   ` Thierry Reding
2026-03-25 10:17 ` [PATCH v2 3/7] pwm: tegra: Modify read/write accessors for multi-register channel Mikko Perttunen
2026-03-26  9:37   ` Thierry Reding
2026-03-25 10:17 ` [PATCH v2 4/7] pwm: tegra: Parametrize enable register offset Mikko Perttunen
2026-03-26  9:47   ` Thierry Reding [this message]
2026-03-25 10:17 ` [PATCH v2 5/7] pwm: tegra: Parametrize duty and scale field widths Mikko Perttunen
2026-03-26  9:42   ` Thierry Reding
2026-03-25 10:17 ` [PATCH v2 6/7] pwm: tegra: Add support for Tegra264 Mikko Perttunen
2026-03-25 10:17 ` [PATCH v2 7/7] arm64: tegra: Add PWM controllers on Tegra264 Mikko Perttunen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acT_nz0TRM4yXwkb@orome \
    --to=thierry.reding@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=robh@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ukleinek@kernel.org \
    --cc=yiweiw@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox