lkml.org 
[lkml]   [2014]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] extcon: max77693: Fix a bug occured at changing ADC debounce time.
Date
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>
---
drivers/extcon/extcon-max77693.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 77460f2..661a3bb 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -255,10 +255,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 = regmap_update_bits(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 = regmap_write_bits(info->max77693->regmap_muic,
MAX77693_MUIC_REG_CTRL3,
- CONTROL3_ADCDBSET_MASK,
- time << CONTROL3_ADCDBSET_SHIFT);
+ (CONTROL3_ADCDBSET_MASK &
+ time << CONTROL3_ADCDBSET_SHIFT));
if (ret) {
dev_err(info->dev, "failed to set ADC debounce time\n");
return ret;
--
1.7.9.5


\
 
 \ /
  Last update: 2014-09-03 08:21    [W:0.037 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site