From: Axel Lin Date: Wed, 18 Jul 2012 04:30:11 +0000 (+0800) Subject: regulator: palmas: Fix calculating selector in palmas_map_voltage_ldo X-Git-Tag: v3.6-rc3~24^2~10 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5f8ae2154eeb7ed18c6e3dbf6ac095ea4c3d5cf;p=pandora-kernel.git regulator: palmas: Fix calculating selector in palmas_map_voltage_ldo This patch fixes below issues when choosing selector: 1. Current code returns negative selector if min_uV < 900000 which is wrong. For example, it is possible to satisfy the request with selector = 1 if the requested min_uV is 850000. 2. Current code may select a voltage lower than requested min_uV. For example, if the requested min_uV is 945000, current code chooses selector = 1 which is lower than requested min_uV. DIV_ROUND_UP to avoid this case. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- Reading git-diff-tree failed