From: Alex Courbot <acourbot@nvidia.com>
To: Andrew Chew <AChew@nvidia.com>
Cc: "thierry.reding@avionic-design.de"
<thierry.reding@avionic-design.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1 v3] pwm_bl: Add support for backlight enable regulator
Date: Wed, 6 Mar 2013 13:53:27 +0900 [thread overview]
Message-ID: <5136CBC7.3030803@nvidia.com> (raw)
In-Reply-To: <643E69AA4436674C8F39DCC2C05F7638629BFE1DB7@HQMAIL03.nvidia.com>
On 03/06/2013 11:41 AM, Andrew Chew wrote:
>>> struct pwm_bl_data {
>>> struct pwm_device *pwm;
>>> struct device *dev;
>>> + struct regulator *en_supply;
>>> + bool en_supply_enabled;
>>
>> Couldn't you use regulator_is_enabled() and get rid of en_supply_enabled?
>> It would also ensure the driver performs correctly no matter what the initial
>> state of the regulator is.
>
> Are you sure this works? I'm concerned about the (bizarre and unlikely) case
> where this supply is shared with another driver, so I use en_supply_enabled
> to track the state of the supply such that I can ignore that case.
You're right, consumers can share regulators and the calls to
enable/disable need to be balanced. Also there is no way to check the
intensity of the backlight prior to the change to detect a transition,
so I guess your approach is indeed the most appropriate here.
Alex.
next prev parent reply other threads:[~2013-03-06 4:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 23:51 [PATCH 1/1 v3] pwm_bl: Add support for backlight enable regulator Andrew Chew
2013-03-06 2:18 ` Alex Courbot
2013-03-06 2:41 ` Andrew Chew
2013-03-06 4:53 ` Alex Courbot [this message]
2013-03-06 7:00 ` Thierry Reding
2013-03-06 8:37 ` Alex Courbot
2013-03-06 10:11 ` Thierry Reding
2013-03-06 4:20 ` Stephen Warren
2013-03-06 4:56 ` Alex Courbot
2013-03-06 7:10 ` Thierry Reding
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=5136CBC7.3030803@nvidia.com \
--to=acourbot@nvidia.com \
--cc=AChew@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thierry.reding@avionic-design.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