Re: [PATCH 2/2] regulator: as3711: Fix the logic in as3711_sel_check

2012-11-26 Thread Guennadi Liakhovetski
On Sat, 24 Nov 2012, Axel Lin wrote: > Below equation means the "voltage" is the "smallest" voltage within specific > range. > > ret = DIV_ROUND_UP(min - bottom) / step; > voltage = ret * step + bottom; > > If we do try 1 down when (voltage > max), new voltage is then less than min > voltage. Wh

[PATCH 2/2] regulator: as3711: Fix the logic in as3711_sel_check

2012-11-23 Thread Axel Lin
Below equation means the "voltage" is the "smallest" voltage within specific range. ret = DIV_ROUND_UP(min - bottom) / step; voltage = ret * step + bottom; If we do try 1 down when (voltage > max), new voltage is then less than min voltage. Which means the new voltage is not in the requested volt