aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/da9052-hwmon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/da9052-hwmon.c b/drivers/hwmon/da9052-hwmon.c
index 960fac3fb166..afd31042b452 100644
--- a/drivers/hwmon/da9052-hwmon.c
+++ b/drivers/hwmon/da9052-hwmon.c
@@ -45,7 +45,7 @@ static const char * const input_names[] = {
45/* Conversion function for VDDOUT and VBAT */ 45/* Conversion function for VDDOUT and VBAT */
46static inline int volt_reg_to_mv(int value) 46static inline int volt_reg_to_mv(int value)
47{ 47{
48 return DIV_ROUND_CLOSEST(value * 1000, 512) + 2500; 48 return DIV_ROUND_CLOSEST(value * 2000, 1023) + 2500;
49} 49}
50 50
51/* Conversion function for ADC channels 4, 5 and 6 */ 51/* Conversion function for ADC channels 4, 5 and 6 */
@@ -57,7 +57,7 @@ static inline int input_reg_to_mv(int value)
57/* Conversion function for VBBAT */ 57/* Conversion function for VBBAT */
58static inline int vbbat_reg_to_mv(int value) 58static inline int vbbat_reg_to_mv(int value)
59{ 59{
60 return DIV_ROUND_CLOSEST(value * 2500, 512); 60 return DIV_ROUND_CLOSEST(value * 5000, 1023);
61} 61}
62 62
63static inline int da9052_enable_vddout_channel(struct da9052 *da9052) 63static inline int da9052_enable_vddout_channel(struct da9052 *da9052)