summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorhongmin.son <hongmin.son@samsung.com>2012-08-15 15:18:02 -0700
committerVarun Wadekar <vwadekar@nvidia.com>2012-09-18 13:52:03 +0530
commit9728f9afac95a0a820311338a1425dec0f108dec (patch)
tree4476cc170dc904a7f2399aec04096c4857eb49d9 /drivers/power
parentc0e1590cad1fa9ffcbeab7655a969452155f5504 (diff)
power: smb347: mask old value when setting float voltage
Fixed set float voltage function to mask off previous value in register before OR'ing in new value. Change-Id: I7b413a8c0190c1b011e8f142b95ca79e9188cebc Signed-off-by: hongmin.son <hongmin.son@samsung.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/smb347-charger.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/power/smb347-charger.c b/drivers/power/smb347-charger.c
index cb7b183d15fc..5b464c4e2ed7 100644
--- a/drivers/power/smb347-charger.c
+++ b/drivers/power/smb347-charger.c
@@ -43,6 +43,7 @@
#define CFG_INPUT_SOURCE_PRIORITY BIT(2)
#define CFG_FLOAT_VOLTAGE 0x03
#define CFG_FLOAT_VOLTAGE_THRESHOLD_MASK 0xc0
+#define CFG_FLOAT_VOLTAGE_MASK 0x3F
#define CFG_FLOAT_VOLTAGE_THRESHOLD_SHIFT 6
#define CFG_STAT 0x05
#define CFG_STAT_DISABLED BIT(5)
@@ -490,6 +491,7 @@ static int smb347_set_voltage_limits(struct smb347_charger *smb)
val = clamp_val(val, 3500000, 4500000) - 3500000;
val /= 20000;
+ ret &= ~CFG_FLOAT_VOLTAGE_MASK;
ret |= val;
}