diff options
-rw-r--r-- | drivers/mfd/tps65010.c | 28 | ||||
-rw-r--r-- | include/linux/i2c/tps65010.h | 19 |
2 files changed, 47 insertions, 0 deletions
diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index 755c4030ea31..e5955306c2fa 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 |
diff --git a/include/linux/i2c/tps65010.h b/include/linux/i2c/tps65010.h index 918c5354d9b8..08aa92278d71 100644 --- a/include/linux/i2c/tps65010.h +++ b/include/linux/i2c/tps65010.h | |||
@@ -72,6 +72,21 @@ | |||
72 | #define TPS_VDCDC1 0x0c | 72 | #define TPS_VDCDC1 0x0c |
73 | # define TPS_ENABLE_LP (1 << 3) | 73 | # define TPS_ENABLE_LP (1 << 3) |
74 | #define TPS_VDCDC2 0x0d | 74 | #define TPS_VDCDC2 0x0d |
75 | # define TPS_LP_COREOFF (1 << 7) | ||
76 | # define TPS_VCORE_1_8V (7<<4) | ||
77 | # define TPS_VCORE_1_5V (6 << 4) | ||
78 | # define TPS_VCORE_1_4V (5 << 4) | ||
79 | # define TPS_VCORE_1_3V (4 << 4) | ||
80 | # define TPS_VCORE_1_2V (3 << 4) | ||
81 | # define TPS_VCORE_1_1V (2 << 4) | ||
82 | # define TPS_VCORE_1_0V (1 << 4) | ||
83 | # define TPS_VCORE_0_85V (0 << 4) | ||
84 | # define TPS_VCORE_LP_1_2V (3 << 2) | ||
85 | # define TPS_VCORE_LP_1_1V (2 << 2) | ||
86 | # define TPS_VCORE_LP_1_0V (1 << 2) | ||
87 | # define TPS_VCORE_LP_0_85V (0 << 2) | ||
88 | # define TPS_VIB (1 << 1) | ||
89 | # define TPS_VCORE_DISCH (1 << 0) | ||
75 | #define TPS_VREGS1 0x0e | 90 | #define TPS_VREGS1 0x0e |
76 | # define TPS_LDO2_ENABLE (1 << 7) | 91 | # define TPS_LDO2_ENABLE (1 << 7) |
77 | # define TPS_LDO2_OFF (1 << 6) | 92 | # define TPS_LDO2_OFF (1 << 6) |
@@ -152,6 +167,10 @@ extern int tps65010_config_vregs1(unsigned value); | |||
152 | */ | 167 | */ |
153 | extern int tps65013_set_low_pwr(unsigned mode); | 168 | extern int tps65013_set_low_pwr(unsigned mode); |
154 | 169 | ||
170 | /* tps65010_set_vdcdc2 | ||
171 | * value to be written to VDCDC2 | ||
172 | */ | ||
173 | extern int tps65010_config_vdcdc2(unsigned value); | ||
155 | 174 | ||
156 | struct i2c_client; | 175 | struct i2c_client; |
157 | 176 | ||