From: Axel Lin Date: Sat, 14 Jul 2012 05:37:13 +0000 (+0800) Subject: regulator: twl: Fix checking voltage range in twl6030smps_set_voltage() X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~106^2^5~48 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78292f4ed2aa9f92eb7bef1e0e1cea14b705e378;p=pandora-kernel.git regulator: twl: Fix checking voltage range in twl6030smps_set_voltage() The voltage selection logic is supposed to find the samllest voltage falls within specified range. When using equation to calculate vsel, we need to ensure the requested min_uV meet the range of using the equation. Otherwise we may select a voltage that is out of specified range. For example, in the case vsel = 62 means select voltage of 2100000uV. What we want is to ensure the requested min_uV <= 2100000 rather than checking max_uV >= 2100000. And this also means in the case min_uV > 2100000, vsel = 62 does not meet the request. Also calling twl6030smps_list_voltage() for all cases to ensure the selected voltage still in bounds. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- Reading git-diff-tree failed