Skip to contentSkip to conversation

extcon: arizona: Declare 3-pole jack if we detect open circuit on mic

PATCH In review Charles Keepax 2 participants 2 messages Jun 25, 2015 – Jun 26, 2015 External connector subsystem (extcon)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 extcon: arizona: Declare 3-pole jack if we detect open circuit on mic

Detecting an open-circuit on the microphone pin, usually means the headset has a microphone but the cable is faulty. Currently the code will simply stop detecting and declare nothing in this situation. It is better to declare this as headphones such that the user can still use their headset as plain headphones even if the microphone is faulty.

---
 drivers/extcon/extcon-arizona.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/extcon/extcon-arizona.c +3 -0
index 4c47eb2..e216a97 100644
@@ -829,7 +829,10 @@ static void arizona_micd_detect(struct work_struct *work)
 	/* Due to jack detect this should never happen */
 	if (!(val & ARIZONA_MICD_STS)) {
 		dev_warn(arizona->dev, "Detected open circuit\n");
+		info->mic = false;
+		arizona_stop_mic(info);
 		info->detecting = false;
+		arizona_identify_headphone(info);
 		goto handled;
 	}
 
Signature · 1 line
1.7.2.5
maintainer
#1 lore raw
Quoted 17 lines · Charles Keepax

Detecting an open-circuit on the microphone pin, usually means the headset has a microphone but the cable is faulty. Currently the code will simply stop detecting and declare nothing in this situation. It is better to declare this as headphones such that the user can still use their headset as plain headphones even if the microphone is faulty.

---
 drivers/extcon/extcon-arizona.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/extcon/extcon-arizona.c +0 -0
index 4c47eb2..e216a97 100644

drivers/extcon/extcon-arizona.c static void arizona_micd_detect(struct work_struct *work) · line 838

Quoted 10 lines
drivers/extcon/extcon-arizona.c +3 -0
@@ -829,7 +829,10 @@ static void arizona_micd_detect(struct work_struct *work)
 	/* Due to jack detect this should never happen */
 	if (!(val & ARIZONA_MICD_STS)) {
 		dev_warn(arizona->dev, "Detected open circuit\n");
+		info->mic = false;
+		arizona_stop_mic(info);
 		info->detecting = false;
+		arizona_identify_headphone(info);
 		goto handled;
 	}
 

Applied it.

Thanks,
Chanwoo Choi