From: Axel Lin Date: Thu, 19 Jul 2012 07:10:31 +0000 (+0800) Subject: regulator: mc13892: Simplify implementation of mc13892_sw_regulator_set_voltage_sel() X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~106^2^5~43 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8db98440facad7e3a194f21ce6069e04bff336c6;p=pandora-kernel.git regulator: mc13892: Simplify implementation of mc13892_sw_regulator_set_voltage_sel() Use mc13xxx_reg_rmw rather than a mc13xxx_reg_read and a mc13xxx_reg_write calls. This logic to set MC13892_SWITCHERS0_SWxHI bit is pretty simple: if (volt > 1375000) set MC13892_SWITCHERS0_SWxHI bit else if (volt < 1100000) clear MC13892_SWITCHERS0_SWxHI bit else leave MC13892_SWITCHERS0_SWxHI bit untouched We already know the selector, so we don't need to calculate the selector again. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- Reading git-diff-tree failed