Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp844801pxb; Tue, 14 Sep 2021 09:55:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLsEJkxPfmSpIRnfxFXzZe5vKn1IFY4JE7YwPUg9C44O99k86PbMZgjjll9FMxNGzMzaaw X-Received: by 2002:a92:cda9:: with SMTP id g9mr12698327ild.18.1631638505718; Tue, 14 Sep 2021 09:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631638505; cv=none; d=google.com; s=arc-20160816; b=fsrUe94oky3X6E4y48LDKiqOWrMI7aWJ4yCL2auhrmTYQyVGtVBqPQi1VwVDaBVJ56 XMkU+D1JPIdACiY8V7HaSJGY3vfPJetQj7f5n/4wHL7vHVHOAYfP8bDn49BPpFGuxHGS dkH7/+GvN2tBTUK6vlr6kaRE9zPSzN8qaI6axgYdUjMc9qAWhs1nM2jRzOAYwNxuBENz j7/WCgrd3lmqBQ2ortaRO9XDURbfawKMPMnYr7rayCk5KyYyThelRy6DI9sr1eGFMTJe d+53ImFE1pdFhw0PMmIJNn6YXezOBh9dRkMTlQ9ZU0WwmaQ/sZTe+tEN8yb9vEJ564Sk +QOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=YkZHQj9k0tUUUprq2cdPeMN2UHIX44J1qBnShOtUP7U=; b=OAJxSL/zUD7zj6JJGaDVUtihyLqb9cUdYXLAEcJJoZbSgniJytSUf1zooeBdj1q7OP fNWBn6NU8aPlVjZiQI43iO6dQ8xqcLyrHbnX+eL855HAYeUfBks9pEWd03fMiH3XLkPd ICjZ/KVgR3hT+gkXjgjCVW+yH6QKItONg5yM66PpSLV7m+tdpWsrOmcq5xw8tZrX60Ii dPqBDIAYlRQiRGLDeIdl+Xgy03+1t9sNBoWSFBzLng4l/ILq375fSolIPCw+weKAEsfA 3war7Oq2RmJHlEyFUxtOvW9gVHMNpzkNhS4cXy8o16C5LMKjL47EjEO1L9iQH45uWnu0 ux3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=PpnMEdel; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w67si9536409jaa.124.2021.09.14.09.54.53; Tue, 14 Sep 2021 09:55:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=PpnMEdel; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230250AbhINQyN (ORCPT + 99 others); Tue, 14 Sep 2021 12:54:13 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:55718 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230391AbhINQyH (ORCPT ); Tue, 14 Sep 2021 12:54:07 -0400 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18E503l9016778; Tue, 14 Sep 2021 11:52:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=YkZHQj9k0tUUUprq2cdPeMN2UHIX44J1qBnShOtUP7U=; b=PpnMEdelvK7sUDdYt5wile+mmYipFsaYoHRLB0C95BMFNfgLmT3AlVPRnEv2kXsb5TTp Xl2VOqCzM1QYeYfbmiRFnhv8C2N2lOFqfuDKVK7SB70PnKgYlZ14FDVow9wHj8heMz5L 9bOghnxirizbkOYsdtZEpsMIKuSdbAtQC+EBmmGb2z0EatB1pRlExbRsfsxUKTwbh28Z POzEdnWdM5YKirKUt+tGmKGx36VVzf/DwSB0V+5CKLORkBBMAPsVUktrUYDQCorU21VD P99qKHEEiu4vntmWiblgtCn5R1uPD0CDzw26LJ5iKXc7SoTLLlgLrHr1CZzuumvwQJ1y Gg== Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 3b2gkx8xd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 14 Sep 2021 11:52:35 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 14 Sep 2021 17:52:33 +0100 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.2242.12 via Frontend Transport; Tue, 14 Sep 2021 17:52:33 +0100 Received: from vitaly-Inspiron-5415.ad.cirrus.com (unknown [198.90.238.230]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id D29BEB10; Tue, 14 Sep 2021 16:52:32 +0000 (UTC) From: Vitaly Rodionov To: James Schulman , David Rhodes , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai CC: , , Subject: [PATCH 0/2] ASoC: cs42l42: Implement Manual Type detection as fallback Date: Tue, 14 Sep 2021 17:52:18 +0100 Message-ID: <20210914165220.752498-1-vitalyr@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 6YQcSsU3m-I6qvH5D-DuccFwtgawvVPB X-Proofpoint-GUID: 6YQcSsU3m-I6qvH5D-DuccFwtgawvVPB X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For some headsets CS42L42 autodetect mode is not working correctly. They will be detected as unknown types or as headphones. According to the CS42L42 datasheet, if the headset autodetect failed, then the driver should switch to manual mode and perform a manual steps sequence. These steps were missing in the current driver code. This patch will add manual mode fallback steps in case autodetect failed. The default behavior is not affected, manual mode runs only when autodetect failed. Tested for regression with autodetect with all known headsets - no regression. Tested with all headsets customers reported as false detected: Gumdrop DropTech B1 - detected as headset OK HUAWEI AM115 - detected as headset OK UGREEN EP103 - detected as headset OK HONOR AM116 - detected as headset OK Also, fixes some errors reported by checkpatch.pl script. Stefan Binding (1): ASoC: cs42l42: Implement Manual Type detection as fallback Vitaly Rodionov (1): ASoC: cs42l42: Minor fix all errors reported by checkpatch.pl script sound/soc/codecs/cs42l42.c | 114 +++++++++++++++++++++++++++++++------ sound/soc/codecs/cs42l42.h | 54 ++++++++++++++++++ 2 files changed, 151 insertions(+), 17 deletions(-) -- 2.25.1