Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1255345pxb; Thu, 16 Sep 2021 03:29:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3Y76UBQdddQLOiPmqOgiPjAmNimh0JduBdMzXiFGGe0o2XrQETQomw1dEYePQXApJ7661 X-Received: by 2002:a6b:e70f:: with SMTP id b15mr3750927ioh.140.1631788189528; Thu, 16 Sep 2021 03:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631788189; cv=none; d=google.com; s=arc-20160816; b=ipsG6sHgNyWYis9x641wsF/NBkkB2RFXGN9FdrAiGl/VjMcsTxjckWM7LzC6NveKl/ tU8FFthax+yzlNgyab0iXhUUegv2SfYTDSpzTisRQ+l40n3i98HUIhTRFKf05U+l+/Xw AXfHFoblqPjMW2pIBFFlCxPRVDbmDWqD62ZyFFhZIUGz+R8sKbWaRC7LLKhZPajmiu+d uCx4VDDifMX5Dnft73s66tI9KktbMhtePfj0f3iEezrGPsmZf1+vYDgYFpkM3XwDFWCU 0nP29kMDHDMJysPs0Qu0ySddtot6DnD6/Lm1wX6bl1D/TtSese5qRVaxLZPBXJP5BT7j IbMw== 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=C9A0iT3x1O9FcRBYE0k54iM+JulnJCyWxdI2m6U4loQ=; b=brXLnLbt3BZ6f2uzbyLbjM56vROyBJ/Dv9XpNPqVjmFjGDcA7XFoDPPJYWZXRCGp6Z j4xjl6Z/XrlS5pt+5Mth57Y7rXX+brjxxaiDtUUHK8IZM5u4BXNldDQ/DQwvy1mD8Ub/ zQ7Vf1jYXMU4BDUPi0iiu1IsIVrQZTAMSfIotpPMPRD7j3vQ/7Fl3mBUciimPNtlG/3g +4C8Zk9gCHotQf1Ud1USGOm6Oummx/8z+bjO0+9j1nr65cwwBdXZstFXf6A9oDzdk9MW sTVJFtGfneuR/POVB16VOqaYEUNTcOuRj8p0dzbe1xNPaGOhh1zrIoaoYrIIrKKF2qNJ L1vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=lcA7VzGV; 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 u20si2329822jao.113.2021.09.16.03.29.38; Thu, 16 Sep 2021 03:29:49 -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=lcA7VzGV; 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 S236237AbhIPKaP (ORCPT + 99 others); Thu, 16 Sep 2021 06:30:15 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:45526 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233913AbhIPKaO (ORCPT ); Thu, 16 Sep 2021 06:30:14 -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 18G8MpJn022854; Thu, 16 Sep 2021 05:28:07 -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=C9A0iT3x1O9FcRBYE0k54iM+JulnJCyWxdI2m6U4loQ=; b=lcA7VzGV5JMrDRn4qYA6PHVCJDJpcC1E7uF1aBAy0ti1zbH0O28Wg9xnUXkTect+Kujy aNq9ZNKgXqi6d9jN6AV44rnjvdsg8lSZLEXn52k1svqUOuh3xIqYnkPoHAo6d7dFslPV Nxo9Ffn/MEBOd/xfXKVJemRdafLwL7dMe9U/vTLps8aR5m5AA3vUYG1nzVlgi/KIeKIp 7dw/i3Mvm7rFkFyoDPvxYtcVsQLJJI3/b8rUAJy7KZQY1iykes5Tgqw0Gvhxm0M049FQ D/I2GpKmBT9jlh3qQOSiGuFL2eW02g8wwmk8Zzj6JU5vGqQdrRSiSEU7NipS6nbabeGM 1g== Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 3b42c3g3vy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 16 Sep 2021 05:28:06 -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; Thu, 16 Sep 2021 11:28:04 +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; Thu, 16 Sep 2021 11:28:04 +0100 Received: from vitaly-Inspiron-5415.ad.cirrus.com (unknown [198.90.238.230]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 4BB3EB15; Thu, 16 Sep 2021 10:28:04 +0000 (UTC) From: Vitaly Rodionov To: James Schulman , David Rhodes , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai CC: , , Subject: [PATCH v1 0/1] ASoC: cs42l42: Implement Manual Type detection as fallback Date: Thu, 16 Sep 2021 11:27:49 +0100 Message-ID: <20210916102750.9212-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-GUID: 9dcbysC11U7uOwQSL2L90KysPekjKq3m X-Proofpoint-ORIG-GUID: 9dcbysC11U7uOwQSL2L90KysPekjKq3m 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 Stefan Binding (1): ASoC: cs42l42: Implement Manual Type detection as fallback sound/soc/codecs/cs42l42.c | 104 ++++++++++++++++++++++++++++++++----- sound/soc/codecs/cs42l42.h | 54 +++++++++++++++++++ 2 files changed, 146 insertions(+), 12 deletions(-) -- 2.25.1