lkml.org 
[lkml]   [2013]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1 v3] pwm_bl: Add support for backlight enable regulator
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.



\
 
 \ /
  Last update: 2013-03-06 06:42    [W:0.053 / U:1.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site