From: Charles Keepax Date: Thu, 25 Jun 2015 15:47:02 +0000 (+0100) Subject: extcon: arizona: Declare 3-pole jack if we detect open circuit on mic X-Git-Tag: v4.3-rc1~160^2^2~5 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=57f70ef9bd19378b51a282be6b46b45b70d4980d;p=karo-tx-linux.git 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. Signed-off-by: Charles Keepax Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 2336de66f442..eaf0644b5506 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -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; }