From patchwork Tue Jun 11 07:45:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammad Rafi Shaik X-Patchwork-Id: 804218 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6333DC27C5E for ; Tue, 11 Jun 2024 07:47:25 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BA0F7857; Tue, 11 Jun 2024 09:47:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BA0F7857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718092042; bh=KYXwkV7c/bPtlWVVNa3FqDeuCVfhvpj+GgJs/yjEk4M=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=jofKcNx+N6gJT0e3R6s9l/w4moKwzhNXdmfqYhUKEZxNXyFdK/at8N3NBbHWDI9+d z/FPH8zySSceBUz96y4EY8SWhKR7uYY1aRHKa4wfrDbm9xX+tWRf61/u+MZwViKbRm 6p6tECPo5vOX7EQKJD3cCDbCl7pgH9Tdd8m608Bw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B056AF805A0; Tue, 11 Jun 2024 09:46:50 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 7A590F805AC; Tue, 11 Jun 2024 09:46:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 259A0F80580; Tue, 11 Jun 2024 09:46:39 +0200 (CEST) Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2189CF80578 for ; Tue, 11 Jun 2024 09:46:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2189CF80578 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=phl5OF5p Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45B2sEZp004782; Tue, 11 Jun 2024 07:46:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=/oIEzahvZHJr/HDCqTTDLf ktPUFuY2YJdqN+Q9hmrmQ=; b=phl5OF5pWHYtpu5yFa0hh4cdXyaI0sc2DKXS2j U008w7i5ejmYh3vYV5msHX4IKHy/2ONry19c6xQp+BqOvlRu4ATd0tHfo4OVDjOV JzfCu5URe4JGjGrko3vuZbDpFwBqKAMPxVhBFedc0ipnfSPkiEpFCsUOK1Eeb9K3 z3IE17vM4yWeUXL04+Gkrn1LXnIAQ2R0LGzi4yfS0z+UF7YSG+2uJkMbaofk09QA QkRna71ZAIEXjepzkwgtPSF0xMXZiggyPnxKC6qBU95uARIEwmV4a+RKykcbwjR3 snlGEaAI+hP48FfPho3dbk2k76hsXsY8RHpwEd4l+uPzDocw== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ymd0ee941-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 07:46:25 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45B7kOYg017491 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 07:46:24 GMT Received: from hu-mohs-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 11 Jun 2024 00:46:19 -0700 From: Mohammad Rafi Shaik To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai CC: , , , , , , , Mohammad Rafi Shaik Subject: [PATCH v6 0/7] ASoC: codecs: wcd937x: add wcd937x audio codec support Date: Tue, 11 Jun 2024 13:15:50 +0530 Message-ID: <20240611074557.604250-1-quic_mohs@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: _TGTFeKk33Ej8NXuWmF1PDBdaobimq5p X-Proofpoint-ORIG-GUID: _TGTFeKk33Ej8NXuWmF1PDBdaobimq5p X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-11_03,2024-06-11_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=622 lowpriorityscore=15 priorityscore=1501 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 clxscore=1015 bulkscore=15 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406110058 Message-ID-Hash: F6GD6H2G2ZZY4TIEOXSG6U7YASPN5HSR X-Message-ID-Hash: F6GD6H2G2ZZY4TIEOXSG6U7YASPN5HSR X-MailFrom: quic_mohs@quicinc.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This patchset adds support for Qualcomm WCD9370/WCD9375 codec. Qualcomm WCD9370/WCD9375 Codec is a standalone Hi-Fi audio codec IC connected over SoundWire. This device has two SoundWire devices, RX and TX respectively supporting 3 x ADCs, ClassH, Ear, Aux PA, 2xHPH, 6 DMICs and MBHC. For codec driver to be functional it would need both tx and rx Soundwire devices to be up and this is taken care by using device component framework and device-links are used to ensure proper pm dependencies. Ex tx does not enter suspend before rx or codec is suspended. This patchset along with other SoundWire patches on the list have been tested on QCM6490 IDP device. Changes since v5: - Remove the string compare in MIC BIAS widget settings as suggested by Srinivas Kandagatla - Fixed Unbalanced pm_runtime_enable! in wcd937x-sdw soundwire slave. Changes since v4: - Removed volatile/read-only registers from defaults list - Added wcd939x_volatile_register() with only volatile registers - Added a wcd939x_readable_register() with read-only and read-write registers, so cache does it's job - Fixed Spurious events for mixer controls and validated with mixer selftest tool - Used TLV instead of enum for ear_pa_gain mixer control - Used enum constraints instead of OneOf in dt-binding patch - Added vdd-px supply property as non optional in dt-binding patch - Reworked and done driver cleanup Changes since v3: - Fixed dt binding check errors. - Added constraints on values in v4-0001 binding patch as suggested by Krzysztof - Change the patch sequence soundwire driver first then codec driver - Added missing .remove soundwire driver function - Reworked and done driver cleanup Changes since v2: - Used common qcom,wcd93xx-common.yaml. removed duplicate properties. - Merged bindings patches "v2-0001" and "v2-0003" in single patch for easy review. - Fixed dt binding check errors. - Added missing "qcom,wcd9375-codec" in v3-0001 dt binding patch. - Added constraints on values in v3-0001 binding patch as suggested by Krzysztof - Fix the typo mistake in v2 cover letter Changes since v1: - Split the patch per driver for easier review as suggested by Krzysztof - Used devm_gpiod_get api to get reset gpio as suggested by Krzysztof Prasad Kumpatla (7): ASoC: dt-bindings: document wcd937x Audio Codec ASoC: codecs: wcd937x-sdw: add SoundWire driver ASoC: codecs: wcd937x: add wcd937x codec driver ASoC: codecs: wcd937x: add basic controls ASoC: codecs: wcd937x: add playback dapm widgets ASoC: codecs: wcd937x: add capture dapm widgets ASoC: codecs: wcd937x: add audio routing and Kconfig .../bindings/sound/qcom,wcd937x-sdw.yaml | 91 + .../bindings/sound/qcom,wcd937x.yaml | 82 + sound/soc/codecs/Kconfig | 20 + sound/soc/codecs/Makefile | 7 + sound/soc/codecs/wcd937x-sdw.c | 1136 +++++++ sound/soc/codecs/wcd937x.c | 3011 +++++++++++++++++ sound/soc/codecs/wcd937x.h | 653 ++++ 7 files changed, 5000 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/qcom,wcd937x-sdw.yaml create mode 100644 Documentation/devicetree/bindings/sound/qcom,wcd937x.yaml create mode 100644 sound/soc/codecs/wcd937x-sdw.c create mode 100644 sound/soc/codecs/wcd937x.c create mode 100644 sound/soc/codecs/wcd937x.h base-commit: d35b2284e966c0bef3e2182a5c5ea02177dd32e4