Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3966678ybl; Mon, 9 Dec 2019 03:11:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzU837BeZ+u3nhjsjqRztemv1ebN+Et1n2TAoFxRZR8jr1eWJcWpVvSsBCxVu2haA34d1Tp X-Received: by 2002:a9d:588d:: with SMTP id x13mr20019820otg.6.1575889901064; Mon, 09 Dec 2019 03:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575889901; cv=none; d=google.com; s=arc-20160816; b=h/7DC6YksTDwdXzKhmgbAMyP8t7lN1M53FW0xAcO3uO4cCUy4v89S7rDta6Ubx87Qp zSHm18MnceGXqEeDYbZ6ShUoMbg1tJTSqjGh7Hji7q2mpI3J7oWgl97zK5YnRqKhrIpK NvPB2BxV87ZSK3kg+AFi3yYtnkE2nDVP8fNoK7aHDoS86E+8C7kpNP17Gp2YTSP0q3k3 MNAUGegKe2f8nT8u0WqIYWN5NeinCbT6ZHPGud2TeCtHN7nms6xa0aqTgGcMzsGdhU9w MH7gpaL369OOWFloTAtAUMoDMjzRiA8Ia37KCqHHgG9m712Gdi+owBAB3CJkGhIUS6UY 0JXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=RZEy6NIe0TsukhJOQNQ0CtrUgcxjzAl40QbDntRJD1M=; b=03MUVx0J2b9QwPPa+x+hasu7ZsT2IgR4Lz7P/LAbiFAtF4xPiYLR2YMor5cQVD7F86 AAWWtmSro6ZGuc6cb0y+AHQ0mCulwQj5sBS55ymScrvWMmFE16CmJ1q5xExtIdohYUWI P3ff+aJDx+jrUYqZd0ko1TPQO/vrR7ThT7i0vKZEBe5Qt8KpxIo7BS0vzHsIXjTZAv9K I9hKR5tuDPj9VjfKLiMSxLRpcF8V7U0CUSUNHowqIa40Fd1++ypc76VvV8SrX8u9jMci nayQnK3f7PFy5SCbVTcgnsNFaC6VCr1ytblBMuafMMlXd7fYPJd+fxvZrMfNEcBJnR8x I8Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=oPPnBwHv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=opensource.cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t185si10463997oib.39.2019.12.09.03.11.28; Mon, 09 Dec 2019 03:11:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=oPPnBwHv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=opensource.cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727754AbfLILJc (ORCPT + 99 others); Mon, 9 Dec 2019 06:09:32 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:1272 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727419AbfLILJ3 (ORCPT ); Mon, 9 Dec 2019 06:09:29 -0500 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB9B9QlT029232; Mon, 9 Dec 2019 05:09:26 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=PODMain02222019; bh=RZEy6NIe0TsukhJOQNQ0CtrUgcxjzAl40QbDntRJD1M=; b=oPPnBwHvV/tP/KyVkSmB1NYY9UpcnMkpvZWoEYVBtKn8ckuSkQ3sCKrC4BCn1hf52Uu5 PXQmx6FdZTszNnE59Bfog2hKHhrH3Y78fQwnt+WdjgwUe/Z0knYHipmhqo6Wx7UqqGYV cBPatdvCmhqnJczkVmxL59eeJyxkLxqa9+zNCufxJ5f68HmGpPjBy2QEIgoBOG3Pz1yG HgJNcFl9QLyUGf2ta1ZRrgFaeLtnxhgA49s/dVOYZNL+m83qcFOxaic1Wa/gtYPynGTv CJOADgGxsCR8vmvc5cwBxzVufBNRZ0FeKE9oLxICS9fYxz2b0nwSeBFYEgCy3YztNpJj sg== Authentication-Results: ppops.net; spf=fail smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from ediex02.ad.cirrus.com ([5.172.152.52]) by mx0a-001ae601.pphosted.com with ESMTP id 2wrac6j0mt-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 09 Dec 2019 05:09:26 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Mon, 9 Dec 2019 11:09:16 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1591.10 via Frontend Transport; Mon, 9 Dec 2019 11:09:16 +0000 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 540102D1; Mon, 9 Dec 2019 11:09:16 +0000 (UTC) From: Charles Keepax To: CC: , , Subject: [PATCH 04/10] extcon: arizona: Clear jack status regardless of detection type Date: Mon, 9 Dec 2019 11:09:10 +0000 Message-ID: <20191209110916.29524-4-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191209110916.29524-1-ckeepax@opensource.cirrus.com> References: <20191209110916.29524-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-SPF-Result: fail X-Proofpoint-SPF-Record: v=spf1 include:spf-001ae601.pphosted.com include:spf.protection.outlook.com -all X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxlogscore=907 spamscore=0 mlxscore=0 clxscore=1015 adultscore=0 impostorscore=0 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912090095 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It makes sense to clear the internal state of the jack detection regardless of if the headphone detect based accessory detection or the normal microphone detect based flow is used. No issues are currently known because of this but the change makes more logical sense and eases future refactoring of the code. Signed-off-by: Charles Keepax --- drivers/extcon/extcon-arizona.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 121c417069478..11f1d753aa102 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -1154,11 +1154,11 @@ static irqreturn_t arizona_jackdet(int irq, void *data) dev_err(arizona->dev, "Mechanical report failed: %d\n", ret); - if (!arizona->pdata.hpdet_acc_id) { - info->detecting = true; - info->mic = false; - info->jack_flips = 0; + info->detecting = true; + info->mic = false; + info->jack_flips = 0; + if (!arizona->pdata.hpdet_acc_id) { arizona_start_mic(info); } else { queue_delayed_work(system_power_efficient_wq, -- 2.11.0