diff options
author | Jonghwa Lee <jonghwa3.lee@samsung.com> | 2014-09-17 12:58:43 +0900 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2014-09-22 16:14:58 +0900 |
commit | dc6048d7231914a608938d330a5006f9929f76c7 (patch) | |
tree | dabe25ad5526930800dd90f949e4b1a211ee8a0f /drivers/extcon | |
parent | b7c7e0865944131820e1a65ff3b08d94ae553d0f (diff) | |
download | linux-dc6048d7231914a608938d330a5006f9929f76c7.tar.bz2 |
extcon: max77693: Fix a bug occured at changing ADC debounce time.
When it writes some value other than 0 to BTLDset and JIGset, muic device
will be reset automatically. And it happens during updating ADC debounce time,
because it shares same register. To update ADC debounce time without reset,
set value only to ADCDbset and 0 to BTLDset and JIGset.
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[Remove un-needed masking operation by Chanwoo Choi]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon-max77693.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c index 0574154a94a9..490e27475bac 100644 --- a/drivers/extcon/extcon-max77693.c +++ b/drivers/extcon/extcon-max77693.c @@ -255,10 +255,14 @@ 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 = regmap_update_bits(info->max77693->regmap_muic, - MAX77693_MUIC_REG_CTRL3, - CONTROL3_ADCDBSET_MASK, - time << CONTROL3_ADCDBSET_SHIFT); + /* + * Don't touch BTLDset, JIGset when you want to change adc + * debounce time. If it writes other than 0 to BTLDset, JIGset + * muic device will be reset and loose current state. + */ + ret = regmap_write(info->max77693->regmap_muic, + MAX77693_MUIC_REG_CTRL3, + time << CONTROL3_ADCDBSET_SHIFT); if (ret) { dev_err(info->dev, "failed to set ADC debounce time\n"); return ret; |