linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "linux-pwm@vger.kernel.org" <linux-pwm@vger.kernel.org>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Lee Jones <lee@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	William Breathitt Gray <william.gray@linaro.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	"linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: Re: [PATCH v15 6/6] pwm: Add Renesas RZ/G2L MTU3a PWM driver
Date: Fri, 14 Apr 2023 18:55:40 +0200	[thread overview]
Message-ID: <20230414165540.bfquriyo6crnxj5q@pengutronix.de> (raw)
In-Reply-To: <OS0PR01MB5922824F09E1BC9FB9CECC9586999@OS0PR01MB5922.jpnprd01.prod.outlook.com>

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

Hello,

On Fri, Apr 14, 2023 at 09:53:09AM +0000, Biju Das wrote:
> > On Thu, Mar 30, 2023 at 12:16:32PM +0100, Biju Das wrote:
> > > +	val = RZ_MTU3_TCR_CKEG_RISING | prescale;
> > > +	if (priv->map->channel == pwm->hwpwm) {
> > > +		rz_mtu3_8bit_ch_write(priv->mtu, RZ_MTU3_TCR,
> > > +				      RZ_MTU3_TCR_CCLR_TGRA | val);
> > 
> > If the sibling PWM on the same channel is on, you're overwriting its
> > prescale value here, are you not?
> 
> Yes, you are correct. Will cache prescale and add the below code
> in rz_mtu3_pwm_config(). Is it ok?
> 
> +        * Prescalar is shared by multiple channels, so prescale can
> +        * NOT be modified when there are multiple channels in use with
> +        * different settings.
> +        */
> +       if (prescale != rz_mtu3_pwm->prescale[ch] && rz_mtu3_pwm->user_count[ch] > 1)
> +               return -EBUSY;

If the other PWM is off, you can (and should) change the prescale value.
Also if the current prescale value is less than the one you want to set,
you can handle that.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

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

  reply	other threads:[~2023-04-14 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230330111632.169434-1-biju.das.jz@bp.renesas.com>
2023-03-30 11:16 ` [PATCH v15 6/6] pwm: Add Renesas RZ/G2L MTU3a PWM driver Biju Das
2023-04-14  6:26   ` Uwe Kleine-König
2023-04-14  9:53     ` Biju Das
2023-04-14 16:55       ` Uwe Kleine-König [this message]
2023-04-17 11:06         ` Biju Das
2023-04-17 22:41           ` Uwe Kleine-König
2023-04-18  6:16             ` Biju Das

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=20230414165540.bfquriyo6crnxj5q@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=Chris.Paterson2@renesas.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=geert+renesas@glider.be \
    --cc=kernel@pengutronix.de \
    --cc=lee@kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=thierry.reding@gmail.com \
    --cc=william.gray@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).