All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin Jücker" <martin.juecker@gmail.com>
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	"Alim Akhtar" <alim.akhtar@samsung.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Lee Jones" <lee.jones@linaro.org>
Cc: linux-samsung-soc@vger.kernel.org
Subject: Re: [RFC PATCH] pwm: pwm-samsung: trigger manual update on 100% duty
Date: Sat, 9 Apr 2022 17:37:36 +0200	[thread overview]
Message-ID: <20220409153736.GA38137@adroid> (raw)
In-Reply-To: <364b4ce1-5160-0f48-9d4c-ab8f7f6cc1b6@linaro.org>

Hi Krzysztof,

On Sat, Apr 09, 2022 at 05:01:42PM +0200, Krzysztof Kozlowski wrote:
> On 09/04/2022 15:40, Martin Jücker wrote:
> > Hello,
> > 
> > I have some trouble with a pwm backlight in the p4note and I'm not sure
> > what the cause is. The problem is with setting the backlight brightness
> > to its maximum value, which will actually turn off the display. All the
> > other values seem to be working just fine.
> 
> A bit similar issues was fixed by Mårten (5d82e661398e ("pwm:
> pwm-samsung: Trigger manual update when disabling PWM")
> ). I assume you test on a tree having that commit.

I applied this to next, so yes I do have this one :-)

> 
> > 
> > Looking at the documentation for the pwm driver in the exynos4412
> > manual, I found that for pwm, the higher the tcmp value, the lower the
> > pwm value is. Enabling debug logging, this seems to be exactly what's
> > happening for values below 100% duty, but when the duty reaches 100%,
> > the tcmp is zero and then gets decreased which causes it to wrap around.
> > Looking at the rest of the code, this seems to be expected behaviour and
> > I would assume that it should cause the pwm to never switch the value
> > from high to low which would also fit.
> 
> I miss here some details.
> 
> The tcmp=-1 is written to registers for the next duty cycle. When
> current duty cycle finishes, this new tcmp=-1 should be loaded into the PWM.
> 
> It seems that this loading does not happen in your case. Correct?

When I change to maximum brightness, the pwm does trigger an update. It
writes the value to the register, but for some reason this causes the
display to turn off on the next cycle instead of going to full
brightness.

> 
> I tried this on Odroid HC1 and works correctly:
> duty_ns=2000000, period_ns=2000000
> tin_ns=240
> tcmp=4294967295
> tcnt=8332
> 
> What values do you have? How can I reproduce your case?

For me it's the following values:

duty_ns=78770, period_ns=78770
tin_ns=10
tcmp=4294967295
tcnt=7876

For the patch, this morning it's not fixing the issue anymore. I might
have messed up while trying around with the tcmp value yesterday night
by still having the wrap around guard in. I thought I double checked
that, apparently I didn't.

> 
> Best regards,
> Krzysztof

Kind Regards
Martin

      reply	other threads:[~2022-04-09 15:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-09 13:40 [RFC PATCH] pwm: pwm-samsung: trigger manual update on 100% duty Martin Jücker
2022-04-09 15:01 ` Krzysztof Kozlowski
2022-04-09 15:37   ` Martin Jücker [this message]

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=20220409153736.GA38137@adroid \
    --to=martin.juecker@gmail.com \
    --cc=alim.akhtar@samsung.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.