2014-07-04 12:52:40

by Dmitry Kasatkin

[permalink] [raw]
Subject: [PATCH 0/3] 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(-)

--
1.9.1


2014-07-04 12:52:43

by Dmitry Kasatkin

[permalink] [raw]
Subject: [PATCH 2/3] extcon: max77693: Differentiate info message for easier debugging

Signed-off-by: Dmitry Kasatkin <[email protected]>
Signed-off-by: Jonghwa Lee <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
---
drivers/extcon/extcon-max77693.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 0e9f734..1b194b3 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -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);

--
1.9.1

2014-07-04 12:52:59

by Dmitry Kasatkin

[permalink] [raw]
Subject: [PATCH 3/3] extcon: max77693: Force using UART path for jig

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.

Signed-off-by: Dmitry Kasatkin <[email protected]>
Signed-off-by: Jonghwa Lee <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
---
drivers/extcon/extcon-max77693.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 1b194b3..862d68f 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -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);
--
1.9.1

2014-07-04 12:53:50

by Dmitry Kasatkin

[permalink] [raw]
Subject: [PATCH 1/3] extcon: max77693: Fix bug related to MAX77693 irq when set ADC debounce time

From: Jonghwa Lee <[email protected]>

Signed-off-by: Jonghwa Lee <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
---
drivers/extcon/extcon-max77693.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 2c7c3e1..0e9f734 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -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,
--
1.9.1