Commit dc6048d7 authored by Jonghwa Lee's avatar Jonghwa Lee Committed by Chanwoo Choi

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: default avatarJonghwa Lee <jonghwa3.lee@samsung.com>
[Remove un-needed masking operation by Chanwoo Choi]
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent b7c7e086
...@@ -255,10 +255,14 @@ static int max77693_muic_set_debounce_time(struct max77693_muic_info *info, ...@@ -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_10MS:
case ADC_DEBOUNCE_TIME_25MS: case ADC_DEBOUNCE_TIME_25MS:
case ADC_DEBOUNCE_TIME_38_62MS: case ADC_DEBOUNCE_TIME_38_62MS:
ret = regmap_update_bits(info->max77693->regmap_muic, /*
MAX77693_MUIC_REG_CTRL3, * Don't touch BTLDset, JIGset when you want to change adc
CONTROL3_ADCDBSET_MASK, * debounce time. If it writes other than 0 to BTLDset, JIGset
time << CONTROL3_ADCDBSET_SHIFT); * 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) { if (ret) {
dev_err(info->dev, "failed to set ADC debounce time\n"); dev_err(info->dev, "failed to set ADC debounce time\n");
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment