diff options
author | Ben Dooks <ben@simtec.co.uk> | 2009-11-02 11:52:30 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2009-12-13 13:21:36 -0500 |
commit | b45440c33a0bdd824b98e4a4c56767c50d3275eb (patch) | |
tree | d4e32150e6de2dd614cd688d22d1371bcc653431 /drivers/mfd | |
parent | 848369926693778cd0f31bfca7fb951164715b4f (diff) |
mfd: Allow configuration of VDCDC2 for tps65010
Add function to allow the configuation fo the VDCDC2 register by
external users, to allow changing of the standard and low-power
running modes.
This is needed, for example, for the Simtec IM2440D20 where we need
to use the low-power mode to shutdown the LDO/DCDC that are not needed
during suspend (saving substantial power) and the runtime use of the
low-power mode to change VCore.
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Simtec Linux Team <linux@simtec.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/tps65010.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index 755c4030ea3..e5955306c2f 100644 --- a/drivers/mfd/tps65010.c +++ b/drivers/mfd/tps65010.c | |||
@@ -964,6 +964,34 @@ int tps65010_config_vregs1(unsigned value) | |||
964 | } | 964 | } |
965 | EXPORT_SYMBOL(tps65010_config_vregs1); | 965 | EXPORT_SYMBOL(tps65010_config_vregs1); |
966 | 966 | ||
967 | int tps65010_config_vdcdc2(unsigned value) | ||
968 | { | ||
969 | struct i2c_client *c; | ||
970 | int status; | ||
971 | |||
972 | if (!the_tps) | ||
973 | return -ENODEV; | ||
974 | |||
975 | c = the_tps->client; | ||
976 | mutex_lock(&the_tps->lock); | ||
977 | |||
978 | pr_debug("%s: vdcdc2 0x%02x\n", DRIVER_NAME, | ||
979 | i2c_smbus_read_byte_data(c, TPS_VDCDC2)); | ||
980 | |||
981 | status = i2c_smbus_write_byte_data(c, TPS_VDCDC2, value); | ||
982 | |||
983 | if (status != 0) | ||
984 | printk(KERN_ERR "%s: Failed to write vdcdc2 register\n", | ||
985 | DRIVER_NAME); | ||
986 | else | ||
987 | pr_debug("%s: vregs1 0x%02x\n", DRIVER_NAME, | ||
988 | i2c_smbus_read_byte_data(c, TPS_VDCDC2)); | ||
989 | |||
990 | mutex_unlock(&the_tps->lock); | ||
991 | return status; | ||
992 | } | ||
993 | EXPORT_SYMBOL(tps65010_config_vdcdc2); | ||
994 | |||
967 | /*-------------------------------------------------------------------------*/ | 995 | /*-------------------------------------------------------------------------*/ |
968 | /* tps65013_set_low_pwr parameter: | 996 | /* tps65013_set_low_pwr parameter: |
969 | * mode: ON or OFF | 997 | * mode: ON or OFF |