Skip to contentSkip to conversation

extcon: max77693: fixes

PATCH New Dmitry Kasatkin 1 participant 4 messages Jul 4, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover extcon: max77693: fixes

Hi,

I found out that this commits are missing from upstream kernel. Please take care to apply.

Thanks,
Dmitry

Dmitry Kasatkin (2):
extcon: max77693: Differentiate info message for easier debugging
extcon: max77693: Force using UART path for jig

Jonghwa Lee (1):
extcon: max77693: Fix bug related to MAX77693 irq when set ADC
debounce time

 drivers/extcon/extcon-max77693.c | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 extcon: max77693: Fix bug related to MAX77693 irq when set ADC debounce time

From: Jonghwa Lee <[email protected]>

---
 drivers/extcon/extcon-max77693.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/extcon/extcon-max77693.c +9 -1
index 2c7c3e1..0e9f734 100644
@@ -288,6 +288,14 @@ static int max77693_muic_set_path(struct max77693_muic_info *info,
 	int ret = 0;
 	u8 ctrl1, ctrl2 = 0;
 
+	/* Set open state to path before changing hw path */
+	ret = max77693_update_reg(info->max77693->regmap_muic,
+		MAX77693_MUIC_REG_CTRL1, CONTROL1_SW_OPEN, COMP_SW_MASK);
+	if (ret < 0) {
+		dev_err(info->dev, "failed to update MUIC register\n");
+		return ret;
+	}
+
 	if (attached)
 		ctrl1 = val;
 	else
@@ -1259,7 +1267,7 @@ static int max77693_muic_probe(struct platform_device *pdev)
 	}
 
 	/* Set initial path for UART */
-	 max77693_muic_set_path(info, info->path_uart, true);
+	max77693_muic_set_path(info, info->path_uart, true);
 
 	/* Check revision number of MUIC device*/
 	ret = max77693_read_reg(info->max77693->regmap_muic,
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 extcon: max77693: Differentiate info message for easier debugging

In reply to Dmitry Kasatkin
---
 drivers/extcon/extcon-max77693.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/extcon/extcon-max77693.c +4 -4
index 0e9f734..1b194b3 100644
@@ -491,7 +491,7 @@ static int max77693_muic_dock_handler(struct max77693_muic_info *info,
 	char dock_name[CABLE_NAME_MAX];
 
 	dev_info(info->dev,
-		"external connector is %s (adc:0x%02x)\n",
+		"external connector (doc) is %s (adc:0x%02x)\n",
 		attached ? "attached" : "detached", cable_type);
 
 	switch (cable_type) {
@@ -654,7 +654,7 @@ static int max77693_muic_jig_handler(struct max77693_muic_info *info,
 	u8 path = CONTROL1_SW_OPEN;
 
 	dev_info(info->dev,
-		"external connector is %s (adc:0x%02x)\n",
+		"external connector (jig) is %s (adc:0x%02x)\n",
 		attached ? "attached" : "detached", cable_type);
 
 	switch (cable_type) {
@@ -700,7 +700,7 @@ static int max77693_muic_adc_handler(struct max77693_muic_info *info)
 				MAX77693_CABLE_GROUP_ADC, &attached);
 
 	dev_info(info->dev,
-		"external connector is %s (adc:0x%02x, prev_adc:0x%x)\n",
+		"external connector (adc) is %s (adc:0x%02x, prev_adc:0x%x)\n",
 		attached ? "attached" : "detached", cable_type,
 		info->prev_cable_type);
 
@@ -809,7 +809,7 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
 				MAX77693_CABLE_GROUP_CHG, &attached);
 
 	dev_info(info->dev,
-		"external connector is %s(chg_type:0x%x, prev_chg_type:0x%x)\n",
+		"external connector (chg) is %s(chg_type:0x%x, prev_chg_type:0x%x)\n",
 			attached ? "attached" : "detached",
 			chg_type, info->prev_chg_type);
 
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/3 extcon: max77693: Force using UART path for jig

In reply to Dmitry Kasatkin

When USB cable is connected to jig, device disables console. This patch forces using UART when jig cable is connected. It allows to charge the device, which also prevents it from sleeping.

---
 drivers/extcon/extcon-max77693.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/extcon/extcon-max77693.c +11 -3
index 1b194b3..862d68f 100644
@@ -296,10 +296,18 @@ static int max77693_muic_set_path(struct max77693_muic_info *info,
 		return ret;
 	}
 
-	if (attached)
-		ctrl1 = val;
-	else
+	if (attached) {
+		if (info->prev_cable_type ==
+		    MAX77693_MUIC_ADC_FACTORY_MODE_UART_OFF) {
+			/* if cable_type is jig, then force UART */
+			dev_info(info->dev, "For jig force using UART path\n");
+			ctrl1 = CONTROL1_SW_UART;
+		} else {
+			ctrl1 = val;
+		}
+	} else {
 		ctrl1 = CONTROL1_SW_OPEN;
+	}
 
 	ret = max77693_update_reg(info->max77693->regmap_muic,
 			MAX77693_MUIC_REG_CTRL1, ctrl1, COMP_SW_MASK);
Signature · 1 line
1.9.1