linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kgunda@codeaurora.org
To: Daniel Thompson <daniel.thompson@linaro.org>
Cc: bjorn.andersson@linaro.org, jingoohan1@gmail.com,
	lee.jones@linaro.org, b.zolnierkie@samsung.com,
	dri-devel@lists.freedesktop.org, jacek.anaszewski@gmail.com,
	pavel@ucw.cz, robh+dt@kernel.org, mark.rutland@arm.com,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Andy Gross <agross@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH V8 6/6] backlight: qcom-wled: Add auto string detection logic
Date: Tue, 22 Oct 2019 12:50:16 +0530	[thread overview]
Message-ID: <0d41f3eb83bbae9eaab0723a84bfcb1b@codeaurora.org> (raw)
In-Reply-To: <20191021103150.ta7qalltldofouh4@holly.lan>

On 2019-10-21 16:01, Daniel Thompson wrote:
> On Fri, Oct 18, 2019 at 06:03:29PM +0530, Kiran Gunda wrote:
>> The auto string detection algorithm checks if the current WLED
>> sink configuration is valid. It tries enabling every sink and
>> checks if the OVP fault is observed. Based on this information
>> it detects and enables the valid sink configuration.
>> Auto calibration will be triggered when the OVP fault interrupts
>> are seen frequently thereby it tries to fix the sink configuration.
>> 
>> The auto-detection also kicks in when the connected LED string
>> of the display-backlight malfunctions (because of damage) and
>> requires the damaged string to be turned off to prevent the
>> complete panel and/or board from being damaged.
>> 
>> Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
>> ---
>>  drivers/video/backlight/qcom-wled.c | 398 
>> +++++++++++++++++++++++++++++++++++-
>>  1 file changed, 392 insertions(+), 6 deletions(-)
>> 
>> diff --git a/drivers/video/backlight/qcom-wled.c 
>> b/drivers/video/backlight/qcom-wled.c
>> index 658b1e0..b2e6754 100644
>> --- a/drivers/video/backlight/qcom-wled.c
>> +++ b/drivers/video/backlight/qcom-wled.c
>> @@ -193,7 +216,23 @@ static int wled_module_enable(struct wled *wled, 
>> int val)
>>  				WLED3_CTRL_REG_MOD_EN,
>>  				WLED3_CTRL_REG_MOD_EN_MASK,
>>  				val << WLED3_CTRL_REG_MOD_EN_SHIFT);
>> -	return rc;
>> +	if (rc < 0)
>> +		return rc;
>> +
>> +	if (wled->ovp_irq > 0) {
>> +		if (val) {
>> +			/*
>> +			 * Wait for at least 10ms before enabling OVP interrupt
>> +			 * after module enable so that soft start is completed.
>> +			 */
> 
> Comments should not say what is does (we can read that). It should be
> saying what is weird about the hardware the results in us enabling the
> interrupt in an unusual way.
> 
> More like:
> 
> "The hardware generates a storm of spurious OVP interrupts during soft
> start operations so defer enabling the IRQ for 10ms to ensure that
> the soft start is complete."
> 
> Note that I am only guessing that is an spurious interrupt storm that
> caused you to defer the interrupt enable... I don't want to have to
> guess which is why I am asking for a good quality comment!
> 
> 
> Daniel.
Yes. Your guess is correct. The hardware document explains the same.
The WLED boost voltage can hit OVP limit in normal operating conditions 
such as
during the soft start timing.
Hence, waiting for the soft start to complete before enabling the OVP 
interrupt
to avoid the spurious interrupts.

I will update the comment as you suggested in the next series.

      reply	other threads:[~2019-10-22  7:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 12:33 [PATCH V8 0/6] backlight: qcom-wled: Support for QCOM wled driver Kiran Gunda
2019-10-18 12:33 ` [PATCH V8 1/6] backlight: qcom-wled: Add new properties for PMI8998 Kiran Gunda
2019-10-18 12:33 ` [PATCH V8 2/6] backlight: qcom-wled: Rename PM8941* to WLED3 Kiran Gunda
2019-10-18 12:33 ` [PATCH V8 3/6] backlight: qcom-wled: Restructure the driver for WLED3 Kiran Gunda
2019-10-18 12:33 ` [PATCH V8 4/6] backlight: qcom-wled: Add support for WLED4 peripheral Kiran Gunda
2019-10-21 10:19   ` Daniel Thompson
2019-10-22  7:20     ` kgunda
2019-10-18 12:33 ` [PATCH V8 5/6] backlight: qcom-wled: add support for short circuit handling Kiran Gunda
2019-10-18 12:33 ` [PATCH V8 6/6] backlight: qcom-wled: Add auto string detection logic Kiran Gunda
2019-10-21 10:31   ` Daniel Thompson
2019-10-22  7:20     ` kgunda [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=0d41f3eb83bbae9eaab0723a84bfcb1b@codeaurora.org \
    --to=kgunda@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=daniel.thompson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=jingoohan1@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.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).