LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Bjorn Andersson <bjorn@kryo.se>
Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>, Bryan Wu <cooloney@gmail.com>,
	Richard Purdie <rpurdie@rpsys.net>,
	Grant Likely <grant.likely@linaro.org>,
	Courtney Cavin <courtney.cavin@sonymobile.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux LED Subsystem <linux-leds@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] leds: add Qualcomm PM8941 WLED driver
Date: Tue, 17 Feb 2015 18:45:39 -0800	[thread overview]
Message-ID: <54E3FCD3.4000304@codeaurora.org> (raw)
In-Reply-To: <CAJAp7OgD3+mGZ02o6xAWkJvKoD4BcQWVD1GS87Niw_fcReBMMA@mail.gmail.com>

On 02/17/15 15:02, Bjorn Andersson wrote:
> On Thu, Feb 12, 2015 at 8:26 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>> On 01/23/15 16:54, Bjorn Andersson wrote:
>>> +
>>> +static int pm8941_wled_set(struct led_classdev *cdev,
>>> +                        enum led_brightness value)
>>> +{
>>> +     struct pm8941_wled *wled;
>>> +     u8 ctrl = 0;
>>> +     u16 val;
>>> +     int rc;
>>> +     int i;
>>> +
>>> +     wled = container_of(cdev, struct pm8941_wled, cdev);
>>> +
>>> +     if (value != 0)
>>> +             ctrl = PM8941_WLED_REG_MOD_EN_BIT;
>>> +
>>> +     val = value * PM8941_WLED_REG_VAL_MAX / LED_FULL;
>>> +
>>> +     rc = regmap_update_bits(wled->regmap,
>>> +                     wled->addr + PM8941_WLED_REG_MOD_EN,
>>> +                     PM8941_WLED_REG_MOD_EN_MASK, ctrl);
>>> +     if (rc)
>>> +             return rc;
>>> +
>>> +     for (i = 0; i < wled->cfg.num_strings; ++i) {
>>> +             u8 v[2] = { val & 0xff, (val >> 8) & 0xf };
>>> +
>>> +             rc = regmap_bulk_write(wled->regmap,
>>> +                             wled->addr + PM8941_WLED_REG_VAL_BASE + 2 * i,
>>> +                             v, 2);
>>> +             if (rc)
>>> +                     return rc;
>>> +     }
>>> +
>>> +     rc = regmap_update_bits(wled->regmap,
>>> +                     wled->addr + PM8941_WLED_REG_SYNC,
>>> +                     PM8941_WLED_REG_SYNC_MASK, PM8941_WLED_REG_SYNC_ALL);
>>> +     if (rc)
>>> +             return rc;
>>> +
>>> +     rc = regmap_update_bits(wled->regmap,
>>> +                     wled->addr + PM8941_WLED_REG_SYNC,
>>> +                     PM8941_WLED_REG_SYNC_MASK, PM8941_WLED_REG_SYNC_CLEAR);
>>> +     return rc;
>>> +}
>> This doesn't seem to do anything for the OVP spike mentioned in this
>> patch[1]. Do you see that problem on your device? I imagine the PMIC is
>> the same.
>>
>> [1]
>> https://www.codeaurora.org/cgit/quic/la/kernel/msm/commit/?id=fef9e15072562f0f28dc7066dcdd69388df81ed3
>>
> That's odd, I can't find that fix in any officially supported releases
> for 8974 - which Courtney used as reference for this driver.
>
> Just to make sure I understand the solution; when disabling the sinks
> the over-voltage-protection sometimes triggers, so we should detect
> that and reset the ovp configuration?
>
> I presume the side effect would be that the sinks would not give any
> output until this is done?
>

It seems that commit is not very good at describing the problem. From
what I can tell, the inductor current may spike when the WLED is turned
off and the switch is stuck on (the circuit is a boost convertor). To
make sure this doesn't happen, we force an OVP so that the switch is
known to be open (i.e. off) and thus can't cause the current spike when
we disable.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


  reply	other threads:[~2015-02-18  2:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-24  0:54 [PATCH v2 1/2] leds: add DT binding for Qualcomm PM8941 WLED block Bjorn Andersson
2015-01-24  0:54 ` [PATCH v2 2/2] leds: add Qualcomm PM8941 WLED driver Bjorn Andersson
2015-01-24  1:22   ` Bjorn Andersson
2015-01-29 12:48   ` Ivan T. Ivanov
2015-01-29 19:07     ` Bjorn Andersson
2015-02-12 19:20       ` Bryan Wu
2015-02-13  4:07     ` Stephen Boyd
2015-02-13  4:28       ` Ivan T. Ivanov
2015-02-13  4:34         ` Stephen Boyd
2015-02-17 23:05       ` Bjorn Andersson
2015-02-13  4:04   ` Stephen Boyd
2015-02-17 22:14     ` Bryan Wu
2015-02-17 22:30       ` Bjorn Andersson
2015-02-17 22:32         ` Bryan Wu
2015-02-17 23:13     ` Bjorn Andersson
2015-02-13  4:26   ` Stephen Boyd
2015-02-17 23:02     ` Bjorn Andersson
2015-02-18  2:45       ` Stephen Boyd [this message]
2015-02-18 14:54         ` Bjorn Andersson
2015-02-12 19:11 ` [PATCH v2 1/2] leds: add DT binding for Qualcomm PM8941 WLED block Bryan Wu

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=54E3FCD3.4000304@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=bjorn.andersson@sonymobile.com \
    --cc=bjorn@kryo.se \
    --cc=cooloney@gmail.com \
    --cc=courtney.cavin@sonymobile.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    --subject='Re: [PATCH v2 2/2] leds: add Qualcomm PM8941 WLED driver' \
    /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

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).