regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs
authorAxel Lin <axel.lin@gmail.com>
Tue, 10 Apr 2012 06:05:44 +0000 (14:05 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 10 Apr 2012 08:53:48 +0000 (09:53 +0100)
commit321d2abaca231dc3ce5d8f71c7f9d0e6ee5c0c24
treea6d104291e8cf3a8eed8d262bf4145e23f5c3526
parentb920eb41a8241c54efbbd4f2ed6d074f497b0d9e
regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs

s5m8767_set_voltage not only implement set_voltage callbacks for LDOs,
but also for BUCKs when s5m8767->buck_gpioindex is not set.
s5m8767_set_voltage_buck actually only for buck[2|3|4] when
s5m8767->buck_gpioindex is set.
Conditionally calling s5m8767_set_voltage in s5m8767_set_voltage_buck makes
the code hard to read.

I think merging s5m8767_set_voltage_buck and s5m8767_set_voltage actually
simplifies things. It's easy to use buck234_vol pointer to differentiate if
we need to control voltage for buck[2|3|4] by DVS GPIOs.

This patch reworks s5m8767_set_voltage to support both LDOx and BUCKx in all
cases.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/s5m8767.c