lkml.org 
[lkml]   [2012]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRE: [PATCH v2] regulator: ad5398: Fix min/max current limit boundary checking


>-----Original Message-----
>From: Axel Lin [mailto:axel.lin@gmail.com]
>Sent: Wednesday, July 04, 2012 11:19 AM
>To: Zhang, Sonic
>Cc: Lars-Peter Clausen; Mark Brown; linux-kernel@vger.kernel.org; Liam
>Girdwood
>Subject: RE: [PATCH v2] regulator: ad5398: Fix min/max current limit boundary
>checking
>
>
>> >That is why we need to add:
>> >if (min_uA < chip->min_uA)
>> > min_uA = chip->min_uA;
>> >
>>
>> Yes, but if you apply this logic to min_uA, you should apply the same logic to
>max_uA, even though it is not used in your application.
>
>Actually, the logic is the same:
>to find a supported (minmal) current in specified range.
>
>The question is the equation used in current code does not allow
>min_uA < chip->min_uA.
>Setting min_uA = chip->min_uA if min_uA < chip->min_uA does make sense
>because botch request actually returns the same current value.
>( I mean no user visible change )
>
>Adding below logic is not necessary.
>( Note: Adding this or not does not have any user visible change, it's
>just not necessary)
>
>if (max_uA > chip->min_uA)
> max_uA = chip->max_uA;
>
>It is not necessary because the equation to choose selector does not
>depends on max_uA. No matter if we set max_uA = chip->max_uA or not in
>this case, it does not impact the equation to choose the selector.
>
>But, well, if you really prefer adding it. I'll send a v3 for it.
>Just let me know how do you think.

Yes, v3 please.

Sonic

>
>Regards,
>Axel
>
>

\
 
 \ /
  Last update: 2012-07-04 06:01    [from the cache]
©2003-2011 Jasper Spaans