summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJonghwa Lee <jonghwa3.lee@samsung.com>2014-03-19 00:55:10 +0900
committerChanho Park <chanho61.park@samsung.com>2014-03-20 17:44:21 +0900
commit6f7bd4ab2b91212c812ee6535a2a26663aeb65bb (patch)
treecb6a129871ab7ad4ca013a43379da04ffd038000 /drivers
parent83a003ac112d158157c79674e3d9fced1c99824f (diff)
downloadlinux-3.10-6f7bd4ab2b91212c812ee6535a2a26663aeb65bb.tar.gz
linux-3.10-6f7bd4ab2b91212c812ee6535a2a26663aeb65bb.tar.bz2
linux-3.10-6f7bd4ab2b91212c812ee6535a2a26663aeb65bb.zip
extcon: max77693: Fix a bug occured at changing ADC debounce time.
During the initialzation of max77693 muic device, it has been suffered from abnormal interrupt and accidental reset of certain register when it changes ADC debounce time. All these happens occured by mistakenly writing some value to BLTDset and JIGset from CONTROL3 register. BLTDset and JIGset are not configurable and only reflect actual pin status. If you write some value other than 0 to them, muic device will return false information. To set ADC debounce time properly, give 0 to BLTDset and JIGset when writing CONTORL3 register. Previous workaround patches are now purged. Change-Id: If87e01785115d460b1153e24271a50125d1631fb Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/extcon/extcon-max77693.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 077296da7da..f29148bcbbc 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -252,10 +252,15 @@ static int max77693_muic_set_debounce_time(struct max77693_muic_info *info,
case ADC_DEBOUNCE_TIME_10MS:
case ADC_DEBOUNCE_TIME_25MS:
case ADC_DEBOUNCE_TIME_38_62MS:
- ret = max77693_update_reg(info->max77693->regmap_muic,
+ /*
+ * Don't touch BTLDset, JIGset when you want to change adc
+ * debounce time. BTLDset, JIGset reflects actual pin status
+ * and are not configurable.
+ */
+ ret = max77693_write_reg(info->max77693->regmap_muic,
MAX77693_MUIC_REG_CTRL3,
- time << CONTROL3_ADCDBSET_SHIFT,
- CONTROL3_ADCDBSET_MASK);
+ ((time << CONTROL3_ADCDBSET_SHIFT) &
+ CONTROL3_ADCDBSET_MASK));
if (ret) {
dev_err(info->dev, "failed to set ADC debounce time\n");
return ret;