twl4030: fix potential power supply handling issues
authorGrazvydas Ignotas <notasas@gmail.com>
Mon, 19 Mar 2012 12:35:02 +0000 (14:35 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 25 Mar 2012 20:15:16 +0000 (23:15 +0300)
commitc42db8a7f0d7fb29c1b8412dd89b312173822241
treee3a2c02d755d754bf2178769c5c6129d61eeb732
parent503d24c79d0db108ca23b57becf70040ee3ce243
twl4030: fix potential power supply handling issues

twl4030_pmrecv_vsel_cfg currently first sets up device group (effectively
enabling the supply), and only then sets vsel (selects voltage). This could
lead to wrong voltage for a short time, or even long time if second i2c
write fails.

Fix this by writing vsel first and device group after that. Also
introduce error checking to not enable the supply if we failed to set
the voltage, and start logging errors as power supply problems are
usually important.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
drivers/power/twl4030.c