mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	lgirdwood@gmail.com, linux-pwm@vger.kernel.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Dmitry Rokosov <ddrokosov@sberdevices.ru>
Subject: Re: [RFC PATCH v1] regulator: pwm-regulator: Fix continuous get_voltage for disabled PWM
Date: Fri, 22 Dec 2023 11:53:44 +0000	[thread overview]
Message-ID: <54905287-855d-47b4-880f-bfb1b8b1f49d@sirena.org.uk> (raw)
In-Reply-To: <jx2vspy4cfuidf3mwmje675igspxdpgrenw5jz35ud5bm65klc@s4ovjad4fusg>


[-- Attachment #1.1: Type: text/plain, Size: 1339 bytes --]

On Thu, Dec 21, 2023 at 11:07:41PM +0100, Uwe Kleine-König wrote:
> On Thu, Dec 21, 2023 at 09:45:49PM +0000, Mark Brown wrote:

> > > -       voltage = pwm_get_relative_duty_cycle(&pstate, duty_unit);
> > > +       if (pstate.enabled)
> > > +               voltage = pwm_get_relative_duty_cycle(&pstate, duty_unit);
> > > +       else if (max_uV_duty < min_uV_duty)
> > > +               voltage = max_uV_duty;
> > > +       else
> > > +               voltage = min_uV_duty;

> > AFAICT this means that enabling the PWM changes the voltage read back
> > which isn't what we expect (other than a change from 0 to target) and is
> > likely to cause issues.  get_voltage() should not change after an
> > enable(), and indeed I'm unclear how this change works?  I'd expect a
> > change in the init_state() function, possibly one that programs the PWM
> > to reflect the actual hardware state but I'm not 100% confident on that
> > without digging into the PWM API more.

> What is your question here? Looking at pwm_regulator_set_voltage() I
> think this lacks a

> 	pstate.enabled = true;

> which might also fix Martin's problem?

That's not really a question, it's a statement - I don't see how the
change works at all and as it stands it introduces a problem with the
behaviour when the regulator is enabled.

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

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2023-12-22 11:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 21:12 Martin Blumenstingl
2023-12-21 21:45 ` Mark Brown
2023-12-21 22:07   ` Uwe Kleine-König
2023-12-22 11:53     ` Mark Brown [this message]
2023-12-21 22:42   ` Martin Blumenstingl
2023-12-22 11:54     ` Mark Brown
2023-12-22 12:24     ` Mark Brown
2023-12-21 22:03 ` Uwe Kleine-König
2023-12-22  0:17   ` Martin Blumenstingl
2023-12-22  7:10     ` Uwe Kleine-König
2023-12-22 10:12       ` Martin Blumenstingl
2023-12-22 10:27         ` Uwe Kleine-König

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=54905287-855d-47b4-880f-bfb1b8b1f49d@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=ddrokosov@sberdevices.ru \
    --cc=hkallweit1@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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

all inboxes | Powered by JetHome®