Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp306474lqb; Thu, 23 May 2024 20:56:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUrptjpTxv2xXF1zmX5Visxq3FgBMhV/zRzUBxMpH4DDhFJ1Rn2coVW5NKymNCMimFlJTQK+KWwHa0jOAtOHC+n5iPh7S7F+DQR+dwwbQ== X-Google-Smtp-Source: AGHT+IGiF+1q1vRn75DOAiIPjHaZp5rMLYtXzXizGBBOqJCb/vr84kMIJiaqdItAa8+rhyHG62sE X-Received: by 2002:a05:620a:1a2a:b0:790:9823:190b with SMTP id af79cd13be357-794ab05aed6mr130589685a.16.1716523007681; Thu, 23 May 2024 20:56:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716523007; cv=pass; d=google.com; s=arc-20160816; b=0JADNI3vDqghF6ub7KwZiX/wKxlI2zj2xav+GGOJ6bdZYHqWWIVqTdwzenFvojE0Kk AIEgO27HfVDNQapbPVmHFfHxITRalcAepvaue3Ta+TPkJOKY4PDz0BQ77AmHDuAKNABo HvmHa43YFveq5NRJhDSJHpKLYCkK00LOpVavJXkbL+chfNU9zrZhX1lmvAZlmMkcvnFo qrAdfBJRFFxeg6rowHv9DV3aeQQLCvJXJLTcnxzT4/SwrVslBnHCN5jjxJakAF31EIIn qVBabKN8LVS5gr26MzHB1XW1MsB/huq02eHT0Gpahy2WFMWngUIkOMHZsXvX4AfGXSiC IEFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ZAR/+EBIHXZGJe+mq0lrwcQHAnY1nldA39qM/Y3XeFY=; fh=RZGL9QkT1KDtHi2BtdmE8j4WTQ8TVfVDoEV2YPPBAw0=; b=lXg4guk1YgNEjMoFg3GHv7JN5eUGzzuN+DynfBL3U1nts8UiDGfqfNz6BTGY5fZmgF iF2BGycr8xSH4/v7qwg9OEvCNdWSibsQ+k4y74EAbFwRHndB/NwkcUjVGxAB/8hEQixB zGpuxGPFELQh9PTB2uN5M5eaaYmqHg3Ey+nncS5RRGnjgfCAHgy5jJB6LJX+CSIdZ8dj v/NA4TS74fpaNyJm5hYeLWdrYeM2zua7sjmlCtyuYz7QFJ8kYA8XrXiEpPCTD+v3Q+t3 b6JuKUIas/ykzy6sTCqv1QbZWn9R8W/oPG7HHXwd0esiljlfG0GCV6f5FQArsyj6Fy/U JRkQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AQkuYC5j; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-188282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abd51c1asi71018685a.653.2024.05.23.20.56.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 20:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AQkuYC5j; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-188282-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5DA841C21FF8 for ; Fri, 24 May 2024 03:56:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CDE9538DD1; Fri, 24 May 2024 03:56:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="AQkuYC5j" 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id 31B7D2F50A; Fri, 24 May 2024 03:56:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716522996; cv=none; b=fv+L6ek2lC+TA7d/CIobm3PdI2ZD4UoS7ZU5Xx1gtPghZx0LgGTuhHVylaMvsCf6ewekS9YmqKOZ+i6XUWbhvUKeWjgjD+2fmwyTRiwL7iFZu1JEkoRwbmUHs5nGvGIQsWLjVDTsjYSM+dEa4dD1tqpYtqOxChMLvd65iRs0w5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716522996; c=relaxed/simple; bh=tCImr3eNuGCx3++HG06+FF6HfNx8UBkQ8vONEBmnqFw=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=CiwjE7CEvUaDZZuJxNVAFAb5vDhkytMdUJ+Gn6HyWZaRC9VWNzMVOd1WhCv8CaNRtMde150jJ9xIa+KmnlRFYQCeQRxl8heKojDFr5Vr0wdPAzvIbkAksVkQWyCX3hB2MsmAiu/I5ZxmDomVU+aQP0nbDjjh5tw0TaJhU0xxiIQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=AQkuYC5j; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44NNPjke013266; Fri, 24 May 2024 03:56:17 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=ZAR/+EBIHXZGJe+mq0lrwc QHAnY1nldA39qM/Y3XeFY=; b=AQkuYC5ja9rNX6gpHm0fkb4Ipm+aXACAatm/6h caAiB/WQQrpoH0xZ5zo84wK4Rv6ye6/T+JNN5K4xHVCTl++IKj+hr2AJ7d5B2FIk 0B0SeqsAMxGM8Df7ofePjHwBfxP1A579Mj8XfqDtAXNJEKniFc8t/zo+wWO/DPTi CnHlaqWm1J0J0sAW9rQmq0/SKxiv6604+oCo6RchdyRYrnJ1490ZaZg+44+ujqGf NpfAGaRX7br/lbh3nhZ393Qsylgp3DrflEGdEFfCLZQ8O0T4SUypkioV/ZDVvoq6 4b5SRNXHG6mXNvJItGqOrPHHYCQlug30uCwQQMmCTNfhmmjw== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yaa8hs470-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 May 2024 03:56:16 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44O3uF7B018545 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 May 2024 03:56:15 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; Thu, 23 May 2024 20:56:10 -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 v5 0/7] ASoC: codecs: wcd937x: add wcd937x audio codec support Date: Fri, 24 May 2024 09:25:28 +0530 Message-ID: <20240524035535.3119208-1-quic_mohs@quicinc.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-ORIG-GUID: L3st0f3sd4uXIkAkilpiBdlveYl6tFL7 X-Proofpoint-GUID: L3st0f3sd4uXIkAkilpiBdlveYl6tFL7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-23_15,2024-05-23_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 adultscore=0 priorityscore=1501 bulkscore=1 malwarescore=0 clxscore=1015 impostorscore=0 suspectscore=0 mlxlogscore=624 lowpriorityscore=1 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2405240025 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 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 | 1139 +++++++ sound/soc/codecs/wcd937x.c | 3029 +++++++++++++++++ sound/soc/codecs/wcd937x.h | 653 ++++ 7 files changed, 5021 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: 124cfbcd6d185d4f50be02d5f5afe61578916773 -- 2.25.1