RE: [PATCH v2] regulator: ad5398: Fix min/max current limitboundary checking

From: Zhang, Sonic
Date: Tue Jul 03 2012 - 05:51:34 EST




>-----Original Message-----
>From: Axel Lin [mailto:axel.lin@xxxxxxxxx]
>Sent: Tuesday, July 03, 2012 5:44 PM
>To: Zhang, Sonic
>Cc: Lars-Peter Clausen; Mark Brown; linux-kernel@xxxxxxxxxxxxxxx; Liam
>Girdwood
>Subject: Re: [PATCH v2] regulator: ad5398: Fix min/max current limit boundary
>checking
>
>>>As long as it is smaller than the maximum requested current, yes. You
>>>request a current range with the regulator API and any value within this
>>>range is fine as the actual output current.
>>>
>>
>> If so, please also set the max_uA as well.
>
>The equation to calculate the selector does not depend on max_uA.
>So I think we don't need to set the requested max_uA.
>

But, ad5398_set_current_limit() behaves different for min_uA and max_uA with you patch. Is this expected?

Sonic

>Current does check the selected current by:
>if (ad5398_calc_current(chip, selector) > max_uA)
> return -EINVAL;
>
>This ensures the selected current falls within specified range.
>
>Regards,
>Axel


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/