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 <[email protected]>
Signed-off-by: Simtec Linux Team <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
Ben Dooks 2009-11-02 16:52:30 +00:00 • committed by Samuel Ortiz
commit b45440c33a
2 changed files with 47 additions and 0 deletions

View file

@ -964,6 +964,34 @@ int tps65010_config_vregs1(unsigned value)
}
EXPORT_SYMBOL(tps65010_config_vregs1);
int tps65010_config_vdcdc2(unsigned value)
{
struct i2c_client *c;
int status;
if (!the_tps)
return -ENODEV;
c = the_tps->client;
mutex_lock(&the_tps->lock);
pr_debug("%s: vdcdc2 0x%02x\n", DRIVER_NAME,
i2c_smbus_read_byte_data(c, TPS_VDCDC2));
status = i2c_smbus_write_byte_data(c, TPS_VDCDC2, value);
if (status != 0)
printk(KERN_ERR "%s: Failed to write vdcdc2 register\n",
DRIVER_NAME);
else
pr_debug("%s: vregs1 0x%02x\n", DRIVER_NAME,
i2c_smbus_read_byte_data(c, TPS_VDCDC2));
mutex_unlock(&the_tps->lock);
return status;
}
EXPORT_SYMBOL(tps65010_config_vdcdc2);
/*-------------------------------------------------------------------------*/
/* tps65013_set_low_pwr parameter:
* mode: ON or OFF