From nobody Sun Feb 8 18:32:39 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D968127FB2E for ; Sun, 21 Dec 2025 09:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309797; cv=none; b=P5iFQRvV9C8U3KjAqwzp6rMBrnGgYoffLXdE4UT99yQQPQzZ4VRDe+A/kvucYvZM9G9kvTudH4Vsy2WMa/rZLwPWSvP670DVaQS2q5bWm8QRza00K5AQl+Etx7P8f1EiVrSW9z53w65f7ITmT9CZcjDIekJQ5osLNOeCYMxzvhU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309797; c=relaxed/simple; bh=wLNKDK1Ksa8IvBF9PuBpNgl2cqbJ5Zaav5WKCmNUHgQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VxDtWADPwTsPny/HhGSFl1qYAex32V1L87V8aXSzqQFcRKbqpjDwuJNkr4ZMPfjNi8yDDvYqW1l+KFzzzKu8i3ibFgVNNZByxDH4G9oRJVBADRmLaNczRl1B6tjFkQWu4EFfBDP544P7hTB10EIjU4b0Q3umR7k7Dh4nzwpo3yQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KPO4igy3; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KPO4igy3" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2a07f8dd9cdso33254745ad.1 for ; Sun, 21 Dec 2025 01:36:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766309795; x=1766914595; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=iFOikY9o36gvsPAMhtc9DtXREspO4Xxm21xH4vlh1IU=; b=KPO4igy3MwzF8i/DFjYB1wELeJRD8s3RWklK1wZqCuZWu/ufdJiH4sKPKlGl3Snzok zPQ2RJ/WJkD//q2XnSQ2iM077axjlNM6ArGQxrQ3Dcpmpy4lRkW/jv1+uEF0HDtna70r bNEqkS86Covw06wvkcE6gnx+3ooAejyVUe4qh5uWHyo4eYPQIPNUX8T48UM5J4NrjZTP HKF0R6S98YllSb8T7Z/RxjGwqmK7J5XlEfBaYr1NrK7vT+gZoFiN8TLbWThUgHfzBFdC BWuUGZsPim3rkF7cMZQDlFSypJljyvCn9NphqRFRK9v9PmKBl7zcpjDeh6k580jNXSQs dhcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766309795; x=1766914595; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=iFOikY9o36gvsPAMhtc9DtXREspO4Xxm21xH4vlh1IU=; b=LIt1+vOdoJYFiYPIhTlpfN6qDxQw7xHTuHHvlNQF89XazunPLdu3RFKMQkbeMgN3GY MNXzy4KKeveV0Gi1qOxrPkHKvbxDLOUqYPT41/I9RYezGmc/uV2+e9EBnn8eeqm0Adqs NH8fyb81rj1XTktToGmokIHOy89cwepq0qCAUSqi2oFMYNSmQ7LtZs6aOWAp/98yPfdP E33obeKPKXrXDdWxKCWGKg0XWCBEx5qXqQjgVzPbwI6MdxaHktjoD4+0B9gFZ6WYaN8f fSTvASL0PedgTOJL5FeFRrR3dzGj8L8aKGkHku+I+Ztk+i6m8O5oPK39kl7eoLsO40sJ jjSw== X-Forwarded-Encrypted: i=1; AJvYcCXJoSdzp188Zax2GRe1tnWNeDKGFzBrarIh8DjVDWxzc2u+9fTExzJxOJvATWQkIGOkrG0cai6dMRDzqkI=@vger.kernel.org X-Gm-Message-State: AOJu0YzIaQPPV2FVKK5ToVI8lW5MWAm8FitmNZodQxi0ww+OiYrG+mit kKMnJNW+XCoW5EmEaxS8imesMcB0CVFfvzqOe0+VS9EipMBNy+nMuptU+QSOIg== X-Gm-Gg: AY/fxX4g/KymHQpaXbZYjQoBjS/drh58jJsK18Qg7BpOFnWRfDP/ufyenr+duqA3QE4 4OL+iwhwuyfgxrIpSepPwsKtCDODzAanjs2ajKEhNABzL5oOJrrzN17P0U9YJxEhJb9zJlArtmF bwW8xdIRSYjSmoO8dNJD6vtHQc9pm8iMeLBexD8FJMutaKl+NuffzA5XuY4Mu/fYqWDfyueF33U B1wyd9/Iar+OACoS31VZlwLjTFntGf6JRsbYmBG8YtW3q8zSLU8Q57ZEpXpswzCHgeuk3keu7oD kSu0QRuJLL4EKdG6QocW+E0+YPc1Gn/Rmhdy+L6Zu5mNidBW5aWB3CxHnjF8XJFQIRaTpPVtE7I pmJMaIAVhMECq3HhPOI7kooHQPTyVZ/sQA92zbz2eUAF7qLeZ/jECWgOoUApWdLpLaQFUW0h4QT RwlqXJ8olIdDSZN727PcVwF5YuotxDci/COYIVFUnK61kWdzcTdwJklVuRxCRz9+gDAFn+ZH0Gz 5VXmLiswwjntpbAAoSzTTk3Rq2lEzu23dfnxJNILfx58pDsHCujyXjgpI409tqu0pZgJE0AW9KH rJO2O64nBnbhSL6GEB08dNlo1FjYUoiNuiCk0u19ghUAJtzcJOE= X-Google-Smtp-Source: AGHT+IFs8ZLMfIE3d3XHgVfBBRp9N/Xz/7Q3Yciu4Zx1KzdlptYhBCkrmMcDSDnGkifXqXR+tynCEQ== X-Received: by 2002:a17:902:d2c4:b0:2a0:d662:7285 with SMTP id d9443c01a7336-2a2f1f789ffmr84830365ad.0.1766309794882; Sun, 21 Dec 2025 01:36:34 -0800 (PST) Received: from [192.168.2.3] (2403-580a-80ed-0-4835-5a07-49e7-f115.ip6.aussiebb.net. [2403:580a:80ed:0:4835:5a07:49e7:f115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d4d363sm67629495ad.62.2025.12.21.01.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Dec 2025 01:36:34 -0800 (PST) From: James Calligeros Date: Sun, 21 Dec 2025 19:35:57 +1000 Subject: [PATCH v2 1/7] ASoC: dt-bindings: convert tdm-slot to YAML Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251221-tdm-idle-slots-v2-1-ed4d96413aec@gmail.com> References: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> In-Reply-To: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kuninori Morimoto , Shengjiu Wang , Jaroslav Kysela , Takashi Iwai , Shenghao Ding , Kevin Lu , Baojun Xu Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, James Calligeros X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3628; i=jcalligeros99@gmail.com; h=from:subject:message-id; bh=wLNKDK1Ksa8IvBF9PuBpNgl2cqbJ5Zaav5WKCmNUHgQ=; b=owGbwMvMwCV2xczoYuD3ygTG02pJDJnu+ycZpng++NQindbr/C9KSs30ZOAJX/aXPs5dTfV8S bnH2e91TGRhEONisBRTZNnQJOQx24jtZr9I5V6YOaxMIEOkRRoYgICFgS83Ma/USMdIz1TbUM/Q UMdYx4iBi1MApjqiieEn4xTv9YWv4p0dmxtFL/Bt7eC45cV1atOedhmG6OuVur9jGBlO7/aRtj8 5tYbbamVp7TlGR8O5y6pl6xu5+yY5LPznK8MHAA== X-Developer-Key: i=jcalligeros99@gmail.com; a=openpgp; fpr=B08212489B3206D98F1479BDD43632D151F77960 This schema was still in plaintext form. Convert to YAML format. Signed-off-by: James Calligeros --- .../bindings/sound/tdm-slot.txt | 29 --------------- .../bindings/sound/tdm-slot.yaml | 49 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 29 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/tdm-slot.txt b/Documen= tation/devicetree/bindings/sound/tdm-slot.txt deleted file mode 100644 index 4bb513ae62fc..000000000000 --- a/Documentation/devicetree/bindings/sound/tdm-slot.txt +++ /dev/null @@ -1,29 +0,0 @@ -TDM slot: - -This specifies audio DAI's TDM slot. - -TDM slot properties: -dai-tdm-slot-num : Number of slots in use. -dai-tdm-slot-width : Width in bits for each slot. -dai-tdm-slot-tx-mask : Transmit direction slot mask, optional -dai-tdm-slot-rx-mask : Receive direction slot mask, optional - -For instance: - dai-tdm-slot-num =3D <2>; - dai-tdm-slot-width =3D <8>; - dai-tdm-slot-tx-mask =3D <0 1>; - dai-tdm-slot-rx-mask =3D <1 0>; - -And for each specified driver, there could be one .of_xlate_tdm_slot_mask() -to specify an explicit mapping of the channels and the slots. If it's abse= nt -the default snd_soc_of_xlate_tdm_slot_mask() will be used to generating the -tx and rx masks. - -For snd_soc_of_xlate_tdm_slot_mask(), the tx and rx masks will use a 1 bit -for an active slot as default, and the default active bits are at the LSB = of -the masks. - -The explicit masks are given as array of integers, where the first -number presents bit-0 (LSB), second presents bit-1, etc. Any non zero -number is considered 1 and 0 is 0. snd_soc_of_xlate_tdm_slot_mask() -does not do anything, if either mask is set non zero value. diff --git a/Documentation/devicetree/bindings/sound/tdm-slot.yaml b/Docume= ntation/devicetree/bindings/sound/tdm-slot.yaml new file mode 100644 index 000000000000..5bc46048d689 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/tdm-slot.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/tdm-slot.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Time Division Multiplexing (TDM) Slot Parameters + +maintainers: + - Liam Girdwood + +select: false + +$defs: + dai-tdm-slot-num: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Number of slots in use + + dai-tdm-slot-width: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Width, in bits, of each slot + + dai-tdm-slot-tx-mask: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: Transmit direction slot mask. Optional. Drivers may speci= fy an + .xlate_tdm_slot_mask() to generate a slot mask dynamically. If neith= er + this property nor a driver-specific function are specified, the defa= ult + snd_soc_xlate_tdm_slot_mask() function will be used to generate a ma= sk. + The first element of the array is slot 0 (LSB). Any nonzero value wi= ll be + treated as 1. + + dai-tdm-slot-rx-mask: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: Receive direction slot mask. Optional. Identical to TX ma= sk. + +properties: + dai-tdm-slot-num: + $ref: "#/$defs/dai-tdm-slot-num" + + dai-tdm-slot-width: + $ref: "#/$defs/dai-tdm-slot-width" + + dai-tdm-slot-tx-mask: + $ref: "#/$defs/dai-tdm-slot-tx-mask" + + dai-tdm-slot-rx-mask: + $ref: "#/$defs/dai-tdm-slot-rx-mask" + +additionalProperties: true --=20 2.52.0 From nobody Sun Feb 8 18:32:39 2026 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DCBE21D599 for ; Sun, 21 Dec 2025 09:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309804; cv=none; b=VjbpqHxkjzV78je2mAmjyZTFeb2rUj5Ur5FH4LlKRq8ckUH475K2EX83q8xiHh/piyFn+LtqI6DD+kTNn3QzjJSho2/0GGZjMIY28br0mkSlPIk+zDIPrjUEXsj6ZbB9IkXob6swdO28rXKYuYDWznLdrIfoNAd9o/h5sO1gvAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309804; c=relaxed/simple; bh=J/JGbSI46p8HTL2RHYE+qUnCr5BQESuhvOilzbTTq48=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=he82RYzHgnOKAYn/zNIkGcCVfgPcxddMNbHlyVkcQYDv4ZzmQR8jzoN+2c0Qn7mWbf0muyCT0GlOdTyL4IIHZ6WHCfqmph1X83n2Pshc0tFsarn2y4oX6mG7u/OdgL5lzr0ULZKYU0rHijWPU+1a/ofNydnDIKvPjeFUsdXzKJA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=L0w3cdoR; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="L0w3cdoR" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2a0bae9aca3so43195355ad.3 for ; Sun, 21 Dec 2025 01:36:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766309802; x=1766914602; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FeZmpsDdG1RUrBzKUX3sBiMLnau+8z4mBhxLnyXrfgM=; b=L0w3cdoRq8SShIxxbw9BZiYw6wRLnHfbkBwZfQ+pOJl0rkbK9tZP+dLXNPr6A46aH7 xz898AU3KuRe9ZrP7hKCWionxZbqKUX3txLZvsWBDP6EzVWCjFJA+IcqShsb/+8y5dhM ntUkYlKHnRcJWivFyJMy5EROLbv0FMJrMLm7uBVsV34XdsVe3mednQg7IaGkRFFam0+E CbTxo3QqWP3q7qy8rZGsDKrbk5Gr0s++jkLfBSoipn+k7E9MlloRKsnmlcx9FsEcmjZD WHWmTYpyGdzTboRleCrDEU/fM+nHgLQOkMnL/5/97wMbIRsrJLoyJX8yygxVMzoyXFPe dvZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766309802; x=1766914602; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=FeZmpsDdG1RUrBzKUX3sBiMLnau+8z4mBhxLnyXrfgM=; b=PMQkrZuMnR9TAgCLZ5iHLZ6XuMW8s3Ji0X+ltk1puONrK1fDnhBlVskUow8eGSzW+P ucw+dkfx2rpIfiBL2ZdlkqDgwTPH4CI4TFeuDFkbCZKQIeR+/Z/tQ1bqxi0Ol3CohCUH +C8TUw1hCR4L3RE5/SXX/Hr2W7klrWxHCsDC+iqjqZhZrcAVhm/+ipOGZlEL7Bc7F7jG QzmMOWBSParZW8ry/Iofrx8CzTyifLmiU4D75AKKItihjcBlhpQKuNz19+gHRK147FiS KHI567wrVOZaKBsZVGWbm3t+OsqSgW9HcWejTYoWV248ezGiRVi/ySTx5nknKs2aRm3X DRpQ== X-Forwarded-Encrypted: i=1; AJvYcCUYfNxdt6jF2pV+2mgR9Iq4hP4cUNFCbFcCYdpj/gLxDyiy3ofsMKKqAgqwSXFPwl2Efu3z7j4mN2phpqk=@vger.kernel.org X-Gm-Message-State: AOJu0YyDc67Pr7J9azJkiN17xh2SJcY7vwDHZbRwmV/GfmfH6nf8gCEj h3tfk3el41ZuWCBfMHsIfcXj5alTPwNm2nuJemGb9ZXZ23HUvGWFxZUv X-Gm-Gg: AY/fxX7T9PlOoFtKjGf3hBTN6UUBldb8cItKlAc3DTzJ8H2RRRN6z3K6V7uKMi4s1D7 4HPqu4lKStj989gSG4vVxEoIrz3COeAQDbk5G7N+EXqUyu0jtkv1yLdka/otHtjM+1clC6xZHHg Q6ZaveHqH5+wlvfjNTlVlB6I/FoWWerkeUbOaPnPxLiEBFoBvrK6Nh+1m2n4lUmvLtxS7naXz5b J2xiTqUhm0wJtTO2ys1MttVv+j7v+ofXvP4sGFbFwmg2Yaf63a0odDlpwcD0lVAUH+MXpkaeW2y fUmlKZ8mxX/4JEJELI6HqlaS5AZIwkN0diOpKcvOic6OZriQv4hs4DUNjmE+aHCaX1aVLMF8/j5 sGHEHa69hwOHQ0mtoY2A+HNN0glil6iD/EXczZ4pI0yYzSeLG1R6Ref3tWw6RKFiX4HVcpy99e5 q/Dm9j04/WFQGS4mgdqZCK0vB9KSiHh344hWxbMq7SQlAgCr4UYyWrwFNj+6jvBp2YgKn0r7TQj AUTw83GVGlq/5xpkWBSdSC9iJxDBCUQaoiY0pM0n8rI7/3qsPPaEcj6WDFPu/eSWDgXJE9firZb gTzhA6/nqN7QjkoAdam65TYv6e63ke5j0MrKIRxo42YKhI+/SXdKl3XgeJH9rw== X-Google-Smtp-Source: AGHT+IGmGZRoabrxlFiBda/1xG97X0TAK54HY5FazNa28CSCbtrIjPg0PALs67RO4ic8ZL4omZOAvQ== X-Received: by 2002:a17:903:4b0c:b0:2a2:dc1f:78d8 with SMTP id d9443c01a7336-2a2f293d04cmr67609985ad.42.1766309802436; Sun, 21 Dec 2025 01:36:42 -0800 (PST) Received: from [192.168.2.3] (2403-580a-80ed-0-4835-5a07-49e7-f115.ip6.aussiebb.net. [2403:580a:80ed:0:4835:5a07:49e7:f115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d4d363sm67629495ad.62.2025.12.21.01.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Dec 2025 01:36:42 -0800 (PST) From: James Calligeros Date: Sun, 21 Dec 2025 19:35:58 +1000 Subject: [PATCH v2 2/7] ASoC: dt-bindings: update tdm-slot.txt references to tdm-slot.yaml Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251221-tdm-idle-slots-v2-2-ed4d96413aec@gmail.com> References: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> In-Reply-To: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kuninori Morimoto , Shengjiu Wang , Jaroslav Kysela , Takashi Iwai , Shenghao Ding , Kevin Lu , Baojun Xu Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, James Calligeros X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2794; i=jcalligeros99@gmail.com; h=from:subject:message-id; bh=J/JGbSI46p8HTL2RHYE+qUnCr5BQESuhvOilzbTTq48=; b=owGbwMvMwCV2xczoYuD3ygTG02pJDJnu+yfNENmnr37sueAd3tzaNTZ3sqsW8Jh0uRewa79W3 JQxpSG0YyILgxgXg6WYIsuGJiGP2UZsN/tFKvfCzGFlAhkiLdLAAAQsDHy5iXmlRjpGeqbahnqG hjrGOkYMXJwCMNWvexj+6XktOBa64faCSAYXoROlpwQKz4VnvXmq/fORfa2E2mnVGoZ/2jEv/Bt 3CZ3bYaGv51FbZajFc+0Y/6Ez7lb3yl9FvvvOAgA= X-Developer-Key: i=jcalligeros99@gmail.com; a=openpgp; fpr=B08212489B3206D98F1479BDD43632D151F77960 Ensure that all references to tdm-slot.txt have been updated to tdm-slot.yaml, and are schema-compliant. Signed-off-by: James Calligeros --- .../bindings/sound/imx-audio-card.yaml | 14 ++++++-------- .../bindings/sound/simple-card.yaml | 14 ++------------ 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/imx-audio-card.yaml b/= Documentation/devicetree/bindings/sound/imx-audio-card.yaml index 3c75c8c78987..eb702f48d694 100644 --- a/Documentation/devicetree/bindings/sound/imx-audio-card.yaml +++ b/Documentation/devicetree/bindings/sound/imx-audio-card.yaml @@ -31,6 +31,12 @@ patternProperties: $ref: /schemas/types.yaml#/definitions/string maxItems: 1 =20 + dai-tdm-slot-num: + $ref: tdm-slot.yaml#/$defs/dai-tdm-slot-num + + dai-tdm-slot-width: + $ref: tdm-slot.yaml#/$defs/dai-tdm-slot-width + format: description: audio format. items: @@ -38,14 +44,6 @@ patternProperties: - i2s - dsp_b =20 - dai-tdm-slot-num: - description: see tdm-slot.txt. - $ref: /schemas/types.yaml#/definitions/uint32 - - dai-tdm-slot-width: - description: see tdm-slot.txt. - $ref: /schemas/types.yaml#/definitions/uint32 - playback-only: description: link is used only for playback $ref: /schemas/types.yaml#/definitions/flag diff --git a/Documentation/devicetree/bindings/sound/simple-card.yaml b/Doc= umentation/devicetree/bindings/sound/simple-card.yaml index 533d0a1da56e..a14716b2732f 100644 --- a/Documentation/devicetree/bindings/sound/simple-card.yaml +++ b/Documentation/devicetree/bindings/sound/simple-card.yaml @@ -27,14 +27,6 @@ definitions: description: dai-link uses bit clock inversion $ref: /schemas/types.yaml#/definitions/flag =20 - dai-tdm-slot-num: - description: see tdm-slot.txt. - $ref: /schemas/types.yaml#/definitions/uint32 - - dai-tdm-slot-width: - description: see tdm-slot.txt. - $ref: /schemas/types.yaml#/definitions/uint32 - system-clock-frequency: description: | If a clock is specified and a multiplication factor is given with @@ -115,6 +107,8 @@ definitions: =20 dai: type: object + $ref: tdm-slot.yaml# + properties: sound-dai: maxItems: 1 @@ -133,10 +127,6 @@ definitions: bitclock-master: $ref: /schemas/types.yaml#/definitions/flag =20 - dai-tdm-slot-num: - $ref: "#/definitions/dai-tdm-slot-num" - dai-tdm-slot-width: - $ref: "#/definitions/dai-tdm-slot-width" clocks: maxItems: 1 system-clock-frequency: --=20 2.52.0 From nobody Sun Feb 8 18:32:39 2026 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A921A27FB0E for ; Sun, 21 Dec 2025 09:36:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309812; cv=none; b=qSDvmtnYFc58QYIlHzyN0VVgrKJfKG3kBRU9wBeKaaFetOG5Yai5urDqRXuoVWsxLZgZxXqYzO1gFM5POk3R2TP6aV7qbyDgX0sgsW1V68OLNEWMQ+J4X/sgM62uDw70Ryf7zWdA2htSRYFZW+VRg0qVTk97UQnVa9eWbF1EtW0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309812; c=relaxed/simple; bh=WG5E/HC2YxDy3oxNYC3bZbjudxqByJP3FjNkgk9QQKc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uuIMFvfTPVI+37cx8eeFXBb8pXOLlBBEMyibDuL0r1bwBfycsL8zB/gJb5gggiBZEZdOVhbzzj/8xDvgCcVYeMCqKfaVklm++Beao0zhOCmJJs5IJA6S4WbBy3IejxYnMMhaC6/cxeOlAmJHvQDJ/JowoQrnPc+phFOnNpcgoCc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Up9WZMzA; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Up9WZMzA" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2a0d6f647e2so50217315ad.1 for ; Sun, 21 Dec 2025 01:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766309810; x=1766914610; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=z8X+CGg6X2TQewpD16dhdCQA0CgAU6ZNu4lyH/rNjLw=; b=Up9WZMzAje2jZMDCPa6venfMhq/OwW97evTE2Eu2REtdcNBllov28nhhEaO/zXiioL dktnWWx5oqAa/ZNiRvxJua7AIz8+v0iPtxNOWr1rqMK+Oqq0dTmRbMyPuUqQJsg4FDFW WpmK4JUME/QDjh1r5bdWJw8Zz0LWTP7HrB4PcI/1wUK+pvbq9sbQzlj1yiO88/qiBDk3 JL7zCy+bxvrNcyp78wGp+Gl9XldFflfSJevz1PHkhy8Z8AnA9Cv9tNlIxT0E+AW9rr0l dMz70CUOx6xS2LQVIOREZVciy1lye061ymgJMlnxO79rT5XwcnOWx0gpjbSiNytHBdrW jj5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766309810; x=1766914610; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=z8X+CGg6X2TQewpD16dhdCQA0CgAU6ZNu4lyH/rNjLw=; b=Ba4Z+/lVazFII5UosWMzrsDBHlXgWpuI8cpK38uTjWZQYHI4x0bH83YarWMiBMuzTb BeD6khcnVUt9f74d9c8vt5Q/cV9af+0Kf/atUozIew7FTNRyN7KzJknUIhuMOBbasvsO tC5mkO+To1pCSVFxt2umf0/Brvowl6DNQ+vfNtpyU9c8fPrIPZbHuqrmdZb/taUsu26R YAsrOe+SmQ/dB3Y2KVwy5K0cO//jjvHdXHqqnSda6g0ERpGXIqNH5TNytFolnBsh2p9i Vj6EckEGS0wniUQywnCowxHsqu0LcMWqzzSB2yHtjnyKfa1RO+VI0kEl+MgQGW2kjUNO A6Uw== X-Forwarded-Encrypted: i=1; AJvYcCVsRWschGiMz4YsWgwdydFaoGglUxgH+08mTS4yI+dVCLqN1JzGcdcenz5xdy2jKf7UYFTAJFh6c5FxHrU=@vger.kernel.org X-Gm-Message-State: AOJu0YziUNrjHbgBWlutT6+EKcMLqsiQSmHC+FmpRZFwp3qGL0OCiFF4 XN1d+v0kHUTiBcRlquoKIJtYBe7jb/IPcL7Vf/MzObDXF0A2XxKFm89D X-Gm-Gg: AY/fxX70ymTko+i6lZSroyLzGjQ+qdiE/zQHHdaBZUGnZZd0qF4tqlXHEhqTp/Gts5M KOQo4AnmXXrMGEzsmujYl2S948vg9uoAQPZ9WVdfrnesowEqs+6goKGgtTHRExAPxUCMViaRlms dLNs3LY1gbZI0pdWa5eKkyME6ooJZ+/G78Y6+G0+E66IgGArTYzjtbWnbxOfBmKizrDrcqnVVm5 77IsIcadGoWDRJq4G076haIDajsYEEN9d0NK7gbskKGifKAtnAtc77Qd61EEfml3nezpXWW4tEj mPlrYyxOlF/ywryNdVrEaidPkVHgHvoJFdAFcR3Nfqk9o/9i58bkZuAIcg8krOHJsm1U+04CHz/ mV7H0FXvYldZGspLR2HPO9hmYQjdi7Hk6x/j8w3nc2SCgsCGS9h+eomyM7Ys3xvOUnLdIGXO50e JXQD2CnUIVLIW8vaUL3HsQ3ys7ltLlWf+2DpvTVmKmstEKKcRLI+O0OuK0s8sQ8hgIjosh3nLbQ nLSAk4L0ico4jV1vLJ7Y5nbjyNjLboxEjHQ6q8nDiXfQHHI446/UXI5+NeFRFVd5UWmN/r3//DY /7y07YuPrsS5fK8Ys/uQS6b6VbPR8EF1520vZVEus6WVFiWuvsw= X-Google-Smtp-Source: AGHT+IE8jH5CF7+AN79OkklOKmx/JMvaSoEQ+RMtmm98sJVMFFzecpBHy1QLye0QOgZLDfrXbuUvuA== X-Received: by 2002:a17:903:ac4:b0:298:2afa:796d with SMTP id d9443c01a7336-2a2f2a56707mr72049865ad.61.1766309810032; Sun, 21 Dec 2025 01:36:50 -0800 (PST) Received: from [192.168.2.3] (2403-580a-80ed-0-4835-5a07-49e7-f115.ip6.aussiebb.net. [2403:580a:80ed:0:4835:5a07:49e7:f115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d4d363sm67629495ad.62.2025.12.21.01.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Dec 2025 01:36:49 -0800 (PST) From: James Calligeros Date: Sun, 21 Dec 2025 19:35:59 +1000 Subject: [PATCH v2 3/7] ASoC: dt-bindings: add TDM slot idle mode properties Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251221-tdm-idle-slots-v2-3-ed4d96413aec@gmail.com> References: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> In-Reply-To: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kuninori Morimoto , Shengjiu Wang , Jaroslav Kysela , Takashi Iwai , Shenghao Ding , Kevin Lu , Baojun Xu Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, James Calligeros X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2393; i=jcalligeros99@gmail.com; h=from:subject:message-id; bh=WG5E/HC2YxDy3oxNYC3bZbjudxqByJP3FjNkgk9QQKc=; b=owGbwMvMwCV2xczoYuD3ygTG02pJDJnu+yfrGR48+UOQteLYKruZFvVKuT2pb3sY230nqCaUG UpI7DvQMZGFQYyLwVJMkWVDk5DHbCO2m/0ilXth5rAygQyRFmlgAAIWBr7cxLxSIx0jPVNtQz1D Qx1jHSMGLk4BmOqzCowMPecqt8ecjPT+cT8yyy9z9/n5x3WvxfH3eX5gLJd9p/PlIyNDu2reTcm pK7IkV3w9ln6vMD8xT/VD8t/FQl+vqLe6M5owAwA= X-Developer-Key: i=jcalligeros99@gmail.com; a=openpgp; fpr=B08212489B3206D98F1479BDD43632D151F77960 Add properties to describe TDM slot idle behaviour. These properties can be used to describe how a DAI is supposed to behave when not active. For example, Apple Silicon laptops split a single I2S bus between two physical lines which are combined at an OR gate in front of the receiving port. One codec on each line is expected to transmit zeroes during the active TDM slots of the opposite line, or we will have corrupted data at the receiver. Signed-off-by: James Calligeros --- .../bindings/sound/tdm-slot.yaml | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/tdm-slot.yaml b/Docume= ntation/devicetree/bindings/sound/tdm-slot.yaml index 5bc46048d689..e8b2d35a7c37 100644 --- a/Documentation/devicetree/bindings/sound/tdm-slot.yaml +++ b/Documentation/devicetree/bindings/sound/tdm-slot.yaml @@ -33,6 +33,17 @@ $defs: $ref: /schemas/types.yaml#/definitions/uint32-array description: Receive direction slot mask. Optional. Identical to TX ma= sk. =20 + dai-tdm-idle-mode: + $ref: /schemas/types.yaml#/definitions/string + enum: + - none + - off + - zero + - pulldown + - hiz + - pullup + - drivehigh + properties: dai-tdm-slot-num: $ref: "#/$defs/dai-tdm-slot-num" @@ -46,4 +57,26 @@ properties: dai-tdm-slot-rx-mask: $ref: "#/$defs/dai-tdm-slot-rx-mask" =20 + dai-tdm-slot-tx-idle-mode: + $ref: "#/$defs/dai-tdm-idle-mode" + description: Transmit direction idle slot mode. Optional. For hardware + that can configure its behaviour during idle TDM slots via + .set_tdm_idle(). "None" represents UB/unspecified behaviour and is t= he + same as not setting this property. + + dai-tdm-slot-rx-idle-mode: + $ref: "#/$defs/dai-tdm-idle-mode" + description: Receive direction idle slot mode. Optional. Identical to = TX + idle slot mode. + + dai-tdm-slot-tx-idle-mask: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Transmit direction idle slot mask. Optional. 1 represents + an idle slot. + + dai-tdm-slot-rx-idle-mask: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Receive direction idle slot mask. Optional. Identical to + TX mask. + additionalProperties: true --=20 2.52.0 From nobody Sun Feb 8 18:32:39 2026 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 494DC21FF4C for ; Sun, 21 Dec 2025 09:36:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309819; cv=none; b=UKPQKKVjeE7J9ThytJnuORIBJGv8FUxXH+pbchPMgy1BffqcMm/oBsh7L7L/qbMJVCOOwQxPmshEHEJaVPm/YWI2MXfMUVNA9kWJ0LSBg8ngTTuIHGY28mF7ovYRHsV4NDQ3r/JNB41DHcid6fIU52/AeYR8Jbh4N6P52nOd0wU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309819; c=relaxed/simple; bh=mjOv/Tov/J+hpGHcb49MekTvZZfF0eTnGqqMKw/v44k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=US0rO6DTXtkEVyNDM4WUccd/UDnoUGU7LIxFLD0qZLB0g/B6VNoH3WEXqCWNOZr3CZtSNYFr8ExIRl8pgW0dAAuRUM1+6isCJxTr9j0mQEtczClDxJZ0Q8O8FDe5pKbGBrLdhQQt26DPLpnhr80BFo0jI6X+vU3bNVZ6rHwKG8w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D4X6UUBt; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D4X6UUBt" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2a1388cdac3so29367995ad.0 for ; Sun, 21 Dec 2025 01:36:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766309818; x=1766914618; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=oXu17unAaFSnbyi+Zk+8K05FQ3JomK2ILh566085Hbg=; b=D4X6UUBtks6CyuyNrtf0kqp9j8kd0G+JCj+BLzSVapIjwuh9eF5G4ewtN3kelf7+bo vHVKV2pRcG9IgdDJSiGbHjNnDhP4bx8w233vtDccpzfurYazkWmlWiW5l9P8sTYEnGmY sbcSSkiinV04ClYgK+yJc++awmuu1ZRNWdI6ii+73l6Fs1frP5qyxpKGyTFNIhrOBv/o M/+Tq3kTYg6wMsUZtnC/RMoohq+wU0qI6i3QjStG6owpiybgAqjGDexN+n6yOjxzELw+ 2kVjt3x5k5y0jWfssmGj3tQXij6X9DKDP08EfdcrX4GSp22hxZUFMgmHjcAliZC6IilR AUvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766309818; x=1766914618; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=oXu17unAaFSnbyi+Zk+8K05FQ3JomK2ILh566085Hbg=; b=Cpr0GOvCMghR1HYeRlFbHbDleD0PcOoQPQF07QS2REFbCZBbkFurqRc7UM1LX3q0nf iVwhepUlH6arFJ1MmzHVVAEJdjNc0y0J5AQxW0vhudPUIMxG+PmgqBlQFy4Dr4Vd3JZN 5lbd4KoOQAywr7UnVwSZAZN7uhfOft0xDEdBl3Ob36ErFd6nX+BnAUJ1NK7DsvJGAXvR JefIfUCzE+siwRcNnH2IS5EESVF8Cgy3gmXJ7JVi9gRy3CHWQaAvNZLsT8LrJMlSrlB3 z30tiZciqlw075JHewxC+ij4F5ACEy+8bYvGMb/u2FEAFAlq3LqTJwHPqZxpfBtqpCCE oVOA== X-Forwarded-Encrypted: i=1; AJvYcCXRx3nNz3zKq5IgLZ/6CQSVUXcPoWgGVM84SW9mSreOrtgsTIfj26xBbl7OONSlF5IwsIQXwdJKtFDoCXM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3DBtr7/kj8TNHbhMsXWehmRNQMQVQXyhPS5oLRpLdn7Eq6pVN 9eOtNaOMzqEHfCRVPA1BzQ7JXByoicxbeWO5PeY1UkPraDdHy0llSZ35 X-Gm-Gg: AY/fxX6kCJkytM0uS0nqbn7zpveKQTakZGBFhYbtReuMFhnkyX3uv8Tu0oXgGDOvJcq 608Q65qMtJrV3JfKZi+o3yy8+mQL9nlZo7mtc17XaCkuHU6CS6HEQFZ4Bsch2p9ccvkiGyJp9sK VQ/p/40qFiw7j2rP5PtNKiNv5jy0n4yYvhz/3qvLGzn0f1RdWhJHtaP1QgF+lfTA4sH6IDTJKQ+ PKUSr241/fFLKGE6ZoREtYL76k67OoqPF0lyqfKVFRQVeANUDZFvV1KaRPxbnwkShytVZUWsikR mVuaZGMhm5ZZv3hYmsM6DVVv15X8DPEkjG7brWy+LA1GvaLVlCd9oVL2Niazu6dbE67WqFwwmWR ezeNzge+Pt9hvJ6MDPaYJELEZSODMzAGUUNIsc3t4f36YxY+Srn07OQH9o667ZbU/9kWlZ5nx0X jafvvss+CN/fCmrxt9WM11hilxca8ydrLlDr5QebMQXIfD4dWqLEuayjESvH8k63PBdgRpDY8uF NI6I51//O9KO+vbUsTcuUrzThUQG6xw7gBmBljiXNzqITCM/XavTJfbuV9HT9dfhayXsTl6PBtk /IgUWfgpI4nlqTyK1Rk+Dmxjsai6ciTk7S/iv2uE4aFwtkx/+9g= X-Google-Smtp-Source: AGHT+IE9k5fjbxVuGHt35PQ2dBtJxutYciuw15r6xi7up9QtKT9LAT9dU495uEoMz6Mf8cwTHCKz/A== X-Received: by 2002:a17:902:ce89:b0:2a0:de4f:ca7 with SMTP id d9443c01a7336-2a2f222add8mr78300875ad.1.1766309817611; Sun, 21 Dec 2025 01:36:57 -0800 (PST) Received: from [192.168.2.3] (2403-580a-80ed-0-4835-5a07-49e7-f115.ip6.aussiebb.net. [2403:580a:80ed:0:4835:5a07:49e7:f115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d4d363sm67629495ad.62.2025.12.21.01.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Dec 2025 01:36:57 -0800 (PST) From: James Calligeros Date: Sun, 21 Dec 2025 19:36:00 +1000 Subject: [PATCH v2 4/7] ASoC: soc-dai: define possible idle TDM slot modes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251221-tdm-idle-slots-v2-4-ed4d96413aec@gmail.com> References: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> In-Reply-To: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kuninori Morimoto , Shengjiu Wang , Jaroslav Kysela , Takashi Iwai , Shenghao Ding , Kevin Lu , Baojun Xu Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, James Calligeros X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2335; i=jcalligeros99@gmail.com; h=from:subject:message-id; bh=mjOv/Tov/J+hpGHcb49MekTvZZfF0eTnGqqMKw/v44k=; b=owGbwMvMwCV2xczoYuD3ygTG02pJDJnu+yc/yutKemkwZXlY9yK/5pRenn0/JK9vi3E23PHj9 rFvd3P6OyayMIhxMViKKbJsaBLymG3EdrNfpHIvzBxWJpAh0iINDEDAwsCXm5hXaqRjpGeqbahn aKhjrGPEwMUpAFPdF8bw3z/6pznLMVbdZTsX729YcvnxuSJLKz6mWU9vrzHWEMiYUMrwP0GFtep N5r9rKW8nhSZYHJ+mwbvD2srqxs45k654uU/+ywIA X-Developer-Key: i=jcalligeros99@gmail.com; a=openpgp; fpr=B08212489B3206D98F1479BDD43632D151F77960 Some audio devices, such as certain Texas Instruments codecs, include configurable bus keepers. We currently don't have a standardised way to configure such hardware, and instead rely on the hardware initialising setting itself up into a sane state. There are situations where this is insufficient, however, and some platforms require more concrete guarantees as to the state of the bus, and being able to explicitly configure bus keepers enables this. For example, some Apple Silicon machines have an odd bus topology where the SDOUT pins of all codecs are split across two data lines, which are summed via an OR gate in front of the receiving port on the SoC's I2S peripheral. Each line must transmit 0 while a codec on the other line is actively transmitting data, or the SoC will receive garbage data. To do this, one codec on each line must be configured to transmit zeroes during the other line's active TDM slots. Thus, we define seven possible bus-keeping modes that a device can be in: NONE (UB/as initialised), OFF (explicitly disabled), ZERO (actively transmit a 0), PULLDOWN, HIZ (floating), PULLUP, and DRIVE_HIGH. These will be consumed by CODEC/CPU drivers via a common DAI op, enabling the explicit configuration of bus keepers where required. Signed-off-by: James Calligeros --- include/sound/soc-dai.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 224396927aef..44dd06add52e 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -52,6 +52,21 @@ struct snd_compr_stream; #define SND_SOC_POSSIBLE_DAIFMT_AC97 (1 << SND_SOC_DAI_FORMAT_AC97) #define SND_SOC_POSSIBLE_DAIFMT_PDM (1 << SND_SOC_DAI_FORMAT_PDM) =20 +/* + * DAI TDM slot idle modes + * + * Describes a CODEC/CPU's behaviour when not actively receiving or + * transmitting on a given TDM slot. NONE is undefined behaviour. + * Add new modes to the end. + */ +#define SND_SOC_DAI_TDM_IDLE_NONE 0 +#define SND_SOC_DAI_TDM_IDLE_OFF 1 +#define SND_SOC_DAI_TDM_IDLE_ZERO 2 +#define SND_SOC_DAI_TDM_IDLE_PULLDOWN 3 +#define SND_SOC_DAI_TDM_IDLE_HIZ 4 +#define SND_SOC_DAI_TDM_IDLE_PULLUP 5 +#define SND_SOC_DAI_TDM_IDLE_DRIVE_HIGH 6 + /* * DAI Clock gating. * --=20 2.52.0 From nobody Sun Feb 8 18:32:39 2026 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4FF722AE65 for ; Sun, 21 Dec 2025 09:37:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309828; cv=none; b=FBHgoVRbMTWtP1mKXtyKaQYMkB8kh3TTRMv3fpyKZnJg3hjVz6vWIwiGzDbyHcbxOPMvcPk8J0hrc8iAe5e2PhVEC4nWubS3c3q5Xo4KvqhvaXoJ5SlEGKNEW3ScPp8yJQu+fCHKqiQIZNpeQbihJMCm1mAJHE8FPuD0JDKmr9c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309828; c=relaxed/simple; bh=dYxrT04YcQdwO6b5nzPFQQREgLbm70Vca80uGYbXBbc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cgbDlzT1PT8vKD2OTCyixv/tV7wZMzEuYaipxa5OrhFqxeMzoTVuTdDytNdGU1vCF8+3/VMY7hD22+L5KlH7Tc+U+BSX3CftQk4AspN1j+ruJJvzDiinZDfy2W98Hqb9qgOtvPMVbXIheWo6FpPtR3MVBBrlL19Hdmf+KabquNw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=K1WRSfNZ; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K1WRSfNZ" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2a0d67f1877so38534685ad.2 for ; Sun, 21 Dec 2025 01:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766309825; x=1766914625; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=loH8pZ21h3HnsJhHTf084VIuLNxonqEp7O6yoOmUAfQ=; b=K1WRSfNZxJ7EN4j1/5NDCg/MvPwdrkid2E61m43mUHkUDrE77bP6JVokltMXC29oSo nhBXmKGf+lKYbafuv9wtimllmXhwhy0n7K5vQG1DIJlmrfKTAZTcnzeC+de/3gSo2UMZ MuYQH5LqwmHVqtE1KDWv5JR0H8/v5m3tRi7BIyFOYEr5QAhxMMUrW/jEwKKa+WqhSz4n Eyqtyk+1ojX9W07r9MGCgOTn/ZsK04bf6hAoUJ/bXlSqsGR91LCblW4AYJ9te4EZSfPj DDIP+5PBpu3/nzSIGeVMhgoh9hf1z6O/MTogS47A2uOk6+bhu/sKr8/mmV8ZKLaJwupU bIjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766309825; x=1766914625; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=loH8pZ21h3HnsJhHTf084VIuLNxonqEp7O6yoOmUAfQ=; b=SZaMBLFy6VrQ/+mScOfKbgXzrIkxrSnBtq2iG/+P2LvEK6xKKEM7c0pkNV++JtH/hd eTZkPQyclbIUW1fj8ApInx56QqTTW8DZxmxRlWIDO+IN8lBR0TmV247Np2jgO76NWE+f xTx3xpjlHrfpKHQK3WoNg4x8D7G7NEQeV6fiLqd6fS0oMBwnOkCZLcyUCII0LJrkXj9a nFGZy0VXO1rTQrg6NtxBAUwVSsbTNmZgy3X3gG3zpCuWkb6sIzvFw99A895fI43o0sew GhyxS2Qz7jxu7uiEqKF6WeBc+se9RXcSjh1O178wL9T0WicRm5kdqTNrnsVCpxoisLj9 6mcA== X-Forwarded-Encrypted: i=1; AJvYcCWuvP7LBwwiBkefT1XzV4I41NDZPhxYPfj+jdtB1W8+0d1rIOp1rB9uPKfmerFlQx2y5m2VqpZrxMpgLno=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/NFf3hz4FonceNonF5MPLKQ0FYRMt7JkZHD+3u2AddwOg+G9y CtLwAGcxhtyCmfGthjwAgsot3s2Z2ttF+Shct4WpfCjWG0QtoAMMofwN X-Gm-Gg: AY/fxX5T4ZGE6BtLQg2wuYERXlntyeft+ojH43eHqpeu4zmGX21SJwdUU5boetEKwsJ HuQKk3yh2b26iL/F5RfHsxsPn44RsY7mzzVgSJaH0uqmEoTrdpPSjS7YRrbgEP4n78mMsqN8Rjx PMe5Ez72cQG53KeFXkr99sZvGPqdCdXAFS4r0k0hnUiXki5PrlhGI1Jio7uhek7905XZAElJy2I YTZIClSpfK8pxGPnzhvhigrg6EXlyABBBpXk0u8l6ImwbNLl7dxcYfGjUfiEpd48DZL+NNfLQ/8 jiHcPKWvSpVsxUnOEG9hSrIVYSO/XAsC1DG05IWhMzQAigonz1Qkf3TgaDQ76g7Om+TffYquEBN VIqHweMk6LlX8+xZnssVst/OcHmXL2VrBuQMO84UqSQHGvdDfAu6V/+A2yffB5LaCH9ulXRY+Nc /SRTJRgVVOfjESw71iwsRVa2yuHYeUgIlKfBjPesM/W9mPli1ytfi+si5cT9fxtLdNL9GDqGka+ 5To+4StaE3T17ulsBLaWSgLJZaqFfOH9xVO5nouIZi1erfrY6Jd9SMiHFX3Rg4D9h2q9s0XNnL0 5mDJB8SdsHpVAgLOMTZFuKnGNlG0ly763OMM0e4GRmbMGLJrL0s= X-Google-Smtp-Source: AGHT+IHTEvxzKwKOsqk6jxiFy1KEjLTBz6tFUpjwHXJ/UFHqcxf2UMgauXjpc/2YVHZ7EdAOXNaDmg== X-Received: by 2002:a17:902:e803:b0:2a0:d5b0:dd82 with SMTP id d9443c01a7336-2a2f2a420e1mr78890355ad.61.1766309825148; Sun, 21 Dec 2025 01:37:05 -0800 (PST) Received: from [192.168.2.3] (2403-580a-80ed-0-4835-5a07-49e7-f115.ip6.aussiebb.net. [2403:580a:80ed:0:4835:5a07:49e7:f115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d4d363sm67629495ad.62.2025.12.21.01.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Dec 2025 01:37:04 -0800 (PST) From: James Calligeros Date: Sun, 21 Dec 2025 19:36:01 +1000 Subject: [PATCH v2 5/7] ASoC: soc-dai: add common operation to set TDM idle mode Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251221-tdm-idle-slots-v2-5-ed4d96413aec@gmail.com> References: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> In-Reply-To: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kuninori Morimoto , Shengjiu Wang , Jaroslav Kysela , Takashi Iwai , Shenghao Ding , Kevin Lu , Baojun Xu Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, James Calligeros X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3972; i=jcalligeros99@gmail.com; h=from:subject:message-id; bh=dYxrT04YcQdwO6b5nzPFQQREgLbm70Vca80uGYbXBbc=; b=owGbwMvMwCV2xczoYuD3ygTG02pJDJnu+yf3en2e913tbLCZc/CEUy8ENxvx9r1wfNd5xNuJt 63AcXVPx0QWBjEuBksxRZYNTUIes43YbvaLVO6FmcPKBDJEWqSBAQhYGPhyE/NKjXSM9Ey1DfUM DXWMdYwYuDgFYKp/qDIyrFjrs0FXc0XYTlemLQmTiiatvJr6yCB+1jZBG8Xaq4+iTRn+h/7JuKk otcZRSbTkvkCAvWCqxiPJa7Jheit+PD3MIjybCwA= X-Developer-Key: i=jcalligeros99@gmail.com; a=openpgp; fpr=B08212489B3206D98F1479BDD43632D151F77960 Some audio devices, like certain Texas Instruments codecs, integrate configurable bus keepers that dictate the codec's behaviour during idle TDM slots. Now that we have definitions for various idle modes, add a snd_soc_dai_set_tdm_idle() operation to control this in a standardised way. This is useful on Apple Silicon laptops, where a single I2S bus is comprised of two physical lines which are ORed just before the receiving port. When a codec on one line is transmitting, we must guarantee that the other line is low. We can achieve this by configuring one codec on each line to use its bus keeper to fill its line with zeroes during the active slots of the other line. Signed-off-by: James Calligeros --- include/sound/soc-dai.h | 7 +++++ sound/soc/soc-dai.c | 40 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 44dd06add52e..6a42812bba8c 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -196,6 +196,10 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsig= ned int fmt); int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); =20 +int snd_soc_dai_set_tdm_idle(struct snd_soc_dai *dai, + unsigned int tx_mask, unsigned int rx_mask, + int tx_mode, int rx_mode); + int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai, unsigned int tx_num, const unsigned int *tx_slot, unsigned int rx_num, const unsigned int *rx_slot); @@ -312,6 +316,9 @@ struct snd_soc_dai_ops { int (*set_tdm_slot)(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); + int (*set_tdm_idle)(struct snd_soc_dai *dai, + unsigned int tx_mask, unsigned int rx_mask, + int tx_mode, int rx_mode); int (*set_channel_map)(struct snd_soc_dai *dai, unsigned int tx_num, const unsigned int *tx_slot, unsigned int rx_num, const unsigned int *rx_slot); diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index a1e05307067d..2f370fda1266 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -282,6 +282,46 @@ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, } EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot); =20 +/** + * snd_soc_dai_set_tdm_idle() - Configure a DAI's TDM idle mode + * @dai: The DAI to configure + * @tx_mask: bitmask representing idle TX slots. + * @rx_mask: bitmask representing idle RX slots. + * @tx_mode: idle mode to set for TX slots. + * @rx_mode: idle mode to set for RX slots. + * + * This function configures the DAI to handle idle TDM slots in the + * specified manner. @tx_mode and @rx_mode can be one of + * SND_SOC_DAI_TDM_IDLE_NONE, SND_SOC_DAI_TDM_IDLE_ZERO, + * SND_SOC_DAI_TDM_IDLE_PULLDOWN, or SND_SOC_DAI_TDM_IDLE_HIZ. + * SND_SOC_TDM_IDLE_NONE represents the DAI's default/unset idle slot + * handling state and could be any of the other modes depending on the + * hardware behind the DAI. It is therefore undefined behaviour when set + * explicitly. + * + * Mode and mask can be set independently for both the TX and RX direction. + * Some hardware may ignore both TX and RX masks depending on its + * capabilities. + */ +int snd_soc_dai_set_tdm_idle(struct snd_soc_dai *dai, + unsigned int tx_mask, unsigned int rx_mask, + int tx_mode, int rx_mode) +{ + int ret =3D -EOPNOTSUPP; + + /* You can't write to the RX line */ + if (rx_mode =3D=3D SND_SOC_DAI_TDM_IDLE_ZERO) + return soc_dai_ret(dai, -EINVAL); + + if (dai->driver->ops && + dai->driver->ops->set_tdm_idle) + ret =3D dai->driver->ops->set_tdm_idle(dai, tx_mask, rx_mask, + tx_mode, rx_mode); + + return soc_dai_ret(dai, ret); +} +EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_idle); + /** * snd_soc_dai_set_channel_map - configure DAI audio channel map * @dai: DAI --=20 2.52.0 From nobody Sun Feb 8 18:32:39 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D91BF280324 for ; Sun, 21 Dec 2025 09:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309836; cv=none; b=OoHlIMq7Mihb+rgnDteIMt2Jbf/aQJ4mK6YrsY0bnZ5sEWOJeXZDxjPsGPwbwl1u5CqvIsfNezgyF9tB82L9/r/+teHkPmOKuS0MegmLsGvy7PjgTD1EUs+CVfvddck5XaMF0xFg0v8mkPLPhLtYqoMKoQkWYf1gkzeuPGlt/gE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309836; c=relaxed/simple; bh=BcCWaQDqk2hqFZcbljTe5TshvfrnYl4MYwks/r0wuug=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mDdvCwftXx3MpqJhcn5i9aLVFl54gk9kDkDgJ9Fs28uipHbcOirK7IRdyOxUX5KuWA17FkcHgdwovIuQMBC2hTx6oCogrfuZcA0wUaqL1qSUw7/o3u0097MidJbgiLV4DYPeP0Gp5UmJ8rfMamAGIEn2KCE04DkWhHlZspnZJqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fRoR1zCb; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fRoR1zCb" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-29f30233d8aso39208275ad.0 for ; Sun, 21 Dec 2025 01:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766309833; x=1766914633; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=V5a5A+6f9bpZxYjLZ9S9FAbY+lPxNj4oyHeruadBhzY=; b=fRoR1zCbrhSm/ioatDa7PKrmUQ7gPp+XJUmKiZR0XjCBLwwwP4tO0Bz7bVUhAA1jtx g2KmbBkGaxNZcbxc5EJB61wa4z4KAD+sHDWA2hYmJ86Lgn3B4YyDkomV0MwZu3bdHUhZ 9C6Tyb3DiceK91CcIBgRIYy1+WpMgP5m8Gg8wpkXmr6FlPsF+nCQ/VZS9fPMPsjMXSEu XPUn7SzaYzVOxk2j5CrCrkApDyKrOZLcnwXDRRlzL5eGZjEtys7hccEKo2845M9xesXl O7gholAnrKJZ1ojcARk1aNqAQScwoA6G3z/UtFVHf2CL03PFXh31bOZZiW2GFi62D9D2 ZLVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766309833; x=1766914633; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=V5a5A+6f9bpZxYjLZ9S9FAbY+lPxNj4oyHeruadBhzY=; b=Y77Cual9xgG5W98kmFgpV2qu5PuZs5coPHRHINIDN6PC8SAz1mCqzOTLRl2M0eA1r4 XGvN5xgz96IMdSjbWx+b+N10/uw3LG8Cnt48qbdxXHXs7Rrdn3wK5QKB6FRb6BDHJCtQ TrB7X7I3XhFyH8VgqD3QH3bdFJAIlrUfImIZTqWowwbFC68iSEv6+c8cxUz2kydfH7Jq 0NLr9PrLkUIqrVFYpP7H+ujTjXacITtWF8/L1bbzxYVaRWzX+SDTyrTEvdvD5OkbGHOt jdO1TJ5+URto5HvSqkz7MGGCAD4PDNSYTr6LHzqcuyCyLS/9a7HLsZnASw8WYgh3llKM GZtQ== X-Forwarded-Encrypted: i=1; AJvYcCWmmYX85vUkYWeAyzJJ1+Rgn6/SblnaiY5ymFzrTGp+ezJSTk4U/ixBRKgDHXGyJPD1ldD3OPCi3SaT6mM=@vger.kernel.org X-Gm-Message-State: AOJu0YxHrujv2j2os3agyQi9j2BMSFVVpkaOZ8LsuWyR7M1GmUHkKw6z vZgCAlkRxJCd7txGTuufBFEte/h4Svcu2WZkXY2LVDHCBCzax6ogTO4J X-Gm-Gg: AY/fxX59Qx6q26CB+0bzCbllsBMP00M4/Kc1vEGYSYY34WP7XD///ewPR3wBW1786Vg DvSxGAxq5rRQgdVOeae7YUyvIGq7zWm2wyMJwW0LHkofpum5x31xqcHhvm1v64YHnv/VRoSzFzx sanEbuDJj9ml/WyACmyoho1M7YgBKXz6xr0k/lj468haGlmGW38ecXvnoIE88DPvuf+oYKsqtzS Re0QnUZ1g8Q4OyyAozks2a8dr0UJFY8ZYyAo+p1BDASl8jh4AscNwNCBorTJjfsCALrrV7Pxu1t HKvphti1Q+Ii+A036rBKj3Ua/NtnyNa6vQiDJUgoYyWzzd8lq2KVMOeAF0HEVblGDfvpcuZCusz jv/27JJR7vgpxBT2fu3DA2uRkiANe4abgXxcks8Rgs9xTIqAKjOD8frGXUX37XsqqdxEcPxh37D SApFYYcehAJvBptztrv6D64QbGhXd9mYAHHoEFWEG2fq3VFozhZVjzFVvF4z4N6x1GpOYsM9ABm ovYuxw6MtjqZDdF4efGjBrJ9MxBdkfPd/FAlSC8y6YnTSw69HoeAMjuUUeGuJukE6k5I7+c3mU9 EMl4seZ2pgIrZ+tO0IivQm0bv6ltOyX7+s//7RGBBI+XrraR3UQ= X-Google-Smtp-Source: AGHT+IGMdyycbEEhzOfaP2Ty3g+HwuUlrykYJWMidFb++M717umnxFkAmzfzB53xMVODmVdckFRerQ== X-Received: by 2002:a17:903:4b47:b0:2a0:e94e:5df6 with SMTP id d9443c01a7336-2a2f28335ffmr80140275ad.50.1766309832723; Sun, 21 Dec 2025 01:37:12 -0800 (PST) Received: from [192.168.2.3] (2403-580a-80ed-0-4835-5a07-49e7-f115.ip6.aussiebb.net. [2403:580a:80ed:0:4835:5a07:49e7:f115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d4d363sm67629495ad.62.2025.12.21.01.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Dec 2025 01:37:12 -0800 (PST) From: James Calligeros Date: Sun, 21 Dec 2025 19:36:02 +1000 Subject: [PATCH v2 6/7] ASoC: tas2764: expose SDOUT bus keeper via set_tdm_idle operation Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251221-tdm-idle-slots-v2-6-ed4d96413aec@gmail.com> References: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> In-Reply-To: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kuninori Morimoto , Shengjiu Wang , Jaroslav Kysela , Takashi Iwai , Shenghao Ding , Kevin Lu , Baojun Xu Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, James Calligeros X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4983; i=jcalligeros99@gmail.com; h=from:subject:message-id; bh=BcCWaQDqk2hqFZcbljTe5TshvfrnYl4MYwks/r0wuug=; b=owGbwMvMwCV2xczoYuD3ygTG02pJDJnu+yeXTb3J8Yz9vVX1g5YygxSGhRIJQhKv88V+6ynkl dry++d1TGRhEONisBRTZNnQJOQx24jtZr9I5V6YOaxMIEOkRRoYgICFgS83Ma/USMdIz1TbUM/Q UMdYx4iBi1MApprhFMNvVq/fM9f3TeT60aaX+KHjVf/r6Qtvvb8j2Dvd+sMcxi2z4hgZ2o7JaDE r9c45+PQi8yW9U247y1WTJbRnm0ebf3E7s+IJGwA= X-Developer-Key: i=jcalligeros99@gmail.com; a=openpgp; fpr=B08212489B3206D98F1479BDD43632D151F77960 TAS2764, and the Apple-exclusive variant SN012776, include bus keepers on the SDOUT pin that can be configured to alter the behaviour of the SDOUT pin during specified TDM slots. The chip can either leave the bus floating (default/uninitialised behaviour) or fill the specified slots with zeroes. Expose the SDOUT bus keeper and allow it to be configured using the set_tdm_idle DAI op. The mask must be cropped to only cover slots valid for the configured BCLK ratio, so introduce a set_bclk_ratio op that properly configures this. Signed-off-by: James Calligeros --- sound/soc/codecs/tas2764.c | 95 +++++++++++++++++++++++++ sound/soc/codecs/tas2764.h | 11 +++ 2 files changed, 106 insertions(+) diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c index 36e25e48b354..423b7073b302 100644 --- a/sound/soc/codecs/tas2764.c +++ b/sound/soc/codecs/tas2764.c @@ -44,6 +44,11 @@ struct tas2764_priv { =20 bool dac_powered; bool unmuted; + + struct { + int tx_mode; + unsigned int tx_mask; + } idle_slot_config; }; =20 #include "tas2764-quirks.h" @@ -509,11 +514,101 @@ static int tas2764_set_dai_tdm_slot(struct snd_soc_d= ai *dai, return 0; } =20 +static int tas2764_write_sdout_idle_mask(struct tas2764_priv *tas2764, u32= mask) +{ + struct snd_soc_component *component =3D tas2764->component; + int i, ret; + + /* Hardware supports up to 64 slots, but we don't */ + for (i =3D 0; i < 4; i++) { + ret =3D snd_soc_component_write(component, + TAS2764_SDOUT_HIZ_1 + i, + (mask >> (i * 8)) & 0xff); + if (ret < 0) + return ret; + } + + return 0; +} + +static int tas2764_set_dai_tdm_idle(struct snd_soc_dai *dai, + unsigned int tx_mask, unsigned int rx_mask, + int tx_mode, int rx_mode) +{ + struct snd_soc_component *component =3D dai->component; + struct tas2764_priv *tas2764 =3D snd_soc_component_get_drvdata(component); + int ret; + + /* We don't support setting anything on SDIN */ + if (rx_mode) + return -EOPNOTSUPP; + + if (tas2764->idle_slot_config.tx_mask =3D=3D tx_mask && + tas2764->idle_slot_config.tx_mode =3D=3D tx_mode) + return 0; + + switch (tx_mode) { + case SND_SOC_DAI_TDM_IDLE_ZERO: + if (!tx_mask) + return -EINVAL; + + ret =3D tas2764_write_sdout_idle_mask(tas2764, tx_mask); + if (ret < 0) + return ret; + + ret =3D snd_soc_component_update_bits(component, + TAS2764_SDOUT_HIZ_9, + TAS2764_SDOUT_HIZ_9_FORCE_0_EN, + TAS2764_SDOUT_HIZ_9_FORCE_0_EN); + if (ret < 0) + return ret; + + tas2764->idle_slot_config.tx_mask =3D tx_mask; + tas2764->idle_slot_config.tx_mode =3D tx_mode; + break; + case SND_SOC_DAI_TDM_IDLE_HIZ: + case SND_SOC_DAI_TDM_IDLE_OFF: + /* HiZ mode does not support a slot mask */ + ret =3D tas2764_write_sdout_idle_mask(tas2764, 0); + if (ret < 0) + return ret; + + ret =3D snd_soc_component_update_bits(component, + TAS2764_SDOUT_HIZ_9, + TAS2764_SDOUT_HIZ_9_FORCE_0_EN, 0); + if (ret < 0) + return ret; + + tas2764->idle_slot_config.tx_mask =3D 0; + tas2764->idle_slot_config.tx_mode =3D tx_mode; + break; + default: + return -EOPNOTSUPP; + } + + return 0; +} + +/* The SDOUT idle slot mask must be cropped based on the BCLK ratio */ +static int tas2764_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ra= tio) +{ + struct tas2764_priv *tas2764 =3D snd_soc_component_get_drvdata(dai->compo= nent); + + if (!tas2764->idle_slot_config.tx_mask) + return 0; + + tas2764->idle_slot_config.tx_mask &=3D GENMASK((ratio / 8) - 1, 0); + + return tas2764_write_sdout_idle_mask(tas2764, tas2764->idle_slot_config.t= x_mask); +} + static const struct snd_soc_dai_ops tas2764_dai_ops =3D { .mute_stream =3D tas2764_mute, .hw_params =3D tas2764_hw_params, .set_fmt =3D tas2764_set_fmt, + .set_bclk_ratio =3D tas2764_set_bclk_ratio, .set_tdm_slot =3D tas2764_set_dai_tdm_slot, + .set_tdm_idle =3D tas2764_set_dai_tdm_idle, .no_capture_mute =3D 1, }; =20 diff --git a/sound/soc/codecs/tas2764.h b/sound/soc/codecs/tas2764.h index 538290ed3d92..4494bc4889dc 100644 --- a/sound/soc/codecs/tas2764.h +++ b/sound/soc/codecs/tas2764.h @@ -126,4 +126,15 @@ =20 #define TAS2764_BOP_CFG0 TAS2764_REG(0X0, 0x1d) =20 +#define TAS2764_SDOUT_HIZ_1 TAS2764_REG(0x1, 0x3d) +#define TAS2764_SDOUT_HIZ_2 TAS2764_REG(0x1, 0x3e) +#define TAS2764_SDOUT_HIZ_3 TAS2764_REG(0x1, 0x3f) +#define TAS2764_SDOUT_HIZ_4 TAS2764_REG(0x1, 0x40) +#define TAS2764_SDOUT_HIZ_5 TAS2764_REG(0x1, 0x41) +#define TAS2764_SDOUT_HIZ_6 TAS2764_REG(0x1, 0x42) +#define TAS2764_SDOUT_HIZ_7 TAS2764_REG(0x1, 0x43) +#define TAS2764_SDOUT_HIZ_8 TAS2764_REG(0x1, 0x44) +#define TAS2764_SDOUT_HIZ_9 TAS2764_REG(0x1, 0x45) +#define TAS2764_SDOUT_HIZ_9_FORCE_0_EN BIT(7) + #endif /* __TAS2764__ */ --=20 2.52.0 From nobody Sun Feb 8 18:32:39 2026 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3262A283FCF for ; Sun, 21 Dec 2025 09:37:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309843; cv=none; b=LPIScvJcf9lT374i0llarSgYHGbez9Ou2iruFQqHvpGLSpxnop4zg+I0yaO+SHT5VIj6Vy74YqEfcHrF4BInUwqfqXImJfu0PvHzjDw7AUdtGfu/jJOuYPP/Gaf1AfBml5bxrE7ErpBXcHWlsPkrDYbjW2gWEUo4Evuityjh1TE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766309843; c=relaxed/simple; bh=hQ3yIQ+LRbuFbg4idC7Bt8j/T1Iri2PmTgdBl9Lz8Vw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f3uenz+jQQgw5bYbPIrKT2JCf7ewCAId2hdund8ra5JZZhHYQpAiFs6CB9ElknGJtT9BsKTzrV7UXrtl7p/o1LVZtrKBMra2brR6l2tN5s67IxqQZHujcvcWV/5B9vmmANydErC7pArqMIqWDVKBJ1JMgSuYW/g0D8wU2DGZTzI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cYXaWRml; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cYXaWRml" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2a0bb2f093aso31823355ad.3 for ; Sun, 21 Dec 2025 01:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766309840; x=1766914640; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sytcPbDCFIWJAyTshVfbcn49iCD+Fu/IyW5F/eizSLg=; b=cYXaWRmlCBpmKneLWpX+F/JZLk6QEd7UZSO3Fhi9CBem6OkL+jpJJoHTXgkRtswpnp oCk6slBebaTpmu47RE3okRTPD8zIxgov6g/VsH2KPWyDdrcfYDRqDbuVFgUdWT4oGuoY EUaWPuxZCdDF81P42qfnZ+unBzPlsQeUZNZHf5DT9/PbXhvyUQ+0a44d2E/dnmr3mQAg dYxC/UE7yxkLuFHrs6bkTSPmI2t+iZXRLXcCXBaeU8+ApO4pIk1KUPKlSbMfDr4c/KKs tNLJ9VV+/Qx7jiz+XKmZsRGFOWYcWvDvs/BbtregKHZEwEhKOfqWXJXkK/3ms6tA1dlu mKUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766309840; x=1766914640; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=sytcPbDCFIWJAyTshVfbcn49iCD+Fu/IyW5F/eizSLg=; b=vQkRd9gKpw22/PAamI0N8cqiu+FjxhIGQzzfWOZpeXEtXUmcpFg/w/18xmv19Yolhk uCQg+F6Pgs1FCmO+zaaXu2uukxzQ+LHsBi6oY8byNahkvZ/vvZCDORsp1aWbhSv7gavV NIVPdxjfsQ/XcUHGcupxSeeGlQFY09LS44zyp34JQkys9vxvksc7oK20S7Gy63kPJIBd P3/k2q4d0eFlFoJ34+5uRYCJjZaEpnSwgYsZshN0kFdMJA+xlL4U/5u512nIhj0xsedx hs9E0MLm7Zwt9TNVyOTxJjw/pjphsIvUNelHbP5XN1aUD4DHbo/7Duve6Qs33sB49W1L PYdA== X-Forwarded-Encrypted: i=1; AJvYcCWN97ik5bXfcHzaizDvO2V+2ccju3SB1jkOu+9OTj262vAwKX5j8xfuGgQawoJiWmTxB3yaBeXCQ8xVAPc=@vger.kernel.org X-Gm-Message-State: AOJu0YzY5RweesojSn0bSd/4isVcIYUFmWa4tzvpxpFVIpUuYCXOP6h+ eD7O9cbSUj91gZJzN4ZD/K3GoziD0jP+zk8srdnb/BlLJAdGlT6diRjF X-Gm-Gg: AY/fxX7c7CY5HB7/8XZGrtBl8VgF15DB59ezKAjIXTCMZSfHi0w785WPwmLucjuWklK 3xs1UFUxlCsq5RW35Ph4u5p4tK7rIoepx+CSijw6VZO1aruJQN6DhSqGwG5ZY127872iMwplQ68 DAh7hsCJ5VqYn1yL7Fd3KIPHSzdSIxDlDiRerNzgeAKS4Xm8bnyP3pvIB/tdObxgv4F52AwjjIO krxZvt0iFAG4Te8TQuy4bANDuJoRrbpLXEYBB0aHBI2zwQBE9yQlGMEVqqm8FqXbav32Z6IpKUB 3yZzXK0AL8q7/KOuSbYXoK/CRW7NxmQsS6f2fkKofVz6EsqwYZ15vt74XmjzunBF9WuOh5YxH5u HlGd+dLFZcZBjbx7d/vjjLxeR4odl1iBdcVw3clRgC0FbHW81JIAqZVNT2jJ+wwPb2uXQNhAVAS F9VjVhAKE5zqeNWhKXHuCQVEbU4M32yjdz88tvYMAKZvQpY4jiiLrLVtUSGhOUS3JPaEBiovZsU aHyhRxO53+o7LzmX13WarfL4i8YLg/zLtqWjnnF9YjyWEwhZZWYz3n4hbd9ioLdf9mMTK0Ps1Iq Urk8q2FW3nheYpThYAs3gATvN/v/ha8fZxWMK9Ww5q7f33lkS2o= X-Google-Smtp-Source: AGHT+IG3qoMi1pT3L1mx8WGusEqRkmhnU95IldSZ76zQsfA/ovZNAZJZT0w8l8bvTDKlgtAC1QBfZg== X-Received: by 2002:a17:902:e541:b0:29f:1bf:6424 with SMTP id d9443c01a7336-2a2f221ff92mr79985445ad.18.1766309840329; Sun, 21 Dec 2025 01:37:20 -0800 (PST) Received: from [192.168.2.3] (2403-580a-80ed-0-4835-5a07-49e7-f115.ip6.aussiebb.net. [2403:580a:80ed:0:4835:5a07:49e7:f115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d4d363sm67629495ad.62.2025.12.21.01.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Dec 2025 01:37:19 -0800 (PST) From: James Calligeros Date: Sun, 21 Dec 2025 19:36:03 +1000 Subject: [PATCH v2 7/7] ASoC: tas2770: expose SDOUT bus keeper via set_tdm_idle Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251221-tdm-idle-slots-v2-7-ed4d96413aec@gmail.com> References: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> In-Reply-To: <20251221-tdm-idle-slots-v2-0-ed4d96413aec@gmail.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kuninori Morimoto , Shengjiu Wang , Jaroslav Kysela , Takashi Iwai , Shenghao Ding , Kevin Lu , Baojun Xu Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, James Calligeros X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4520; i=jcalligeros99@gmail.com; h=from:subject:message-id; bh=hQ3yIQ+LRbuFbg4idC7Bt8j/T1Iri2PmTgdBl9Lz8Vw=; b=owGbwMvMwCV2xczoYuD3ygTG02pJDJnu+yfrR21YfWKb47yGtwc+xpW/9c6z/JkwvT6vOXraG cUJZmskOyayMIhxMViKKbJsaBLymG3EdrNfpHIvzBxWJpAh0iINDEDAwsCXm5hXaqRjpGeqbahn aKhjrGPEwMUpAFNt+oDhf9rmVdsiknuYdpu3fMtLPui2w+6rv+XNqN5K1Qs2BV2aSxgZNsq6aS5 aNXflmtX5286cmq/g+1sz6eHq6U9fZc14/rAngRUA X-Developer-Key: i=jcalligeros99@gmail.com; a=openpgp; fpr=B08212489B3206D98F1479BDD43632D151F77960 TAS2770 includes a bus keeper which can be used to control the behaviour of the SDOUT pin during specified TDM slots. The chip can either pull the pin to ground, actively transmit zeroes, or keep the pin floating (default/uninitialised behaviour). Expose the bus keeper via the set_tdm_idle DAI op so that it can be configured by consumers. Signed-off-by: James Calligeros --- sound/soc/codecs/tas2770.c | 75 +++++++++++++++++++++++++ sound/soc/codecs/tas2770.h | 12 ++++ 2 files changed, 87 insertions(+) diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c index 6f878b01716f..d4d7d056141b 100644 --- a/sound/soc/codecs/tas2770.c +++ b/sound/soc/codecs/tas2770.c @@ -492,11 +492,86 @@ static int tas2770_set_dai_tdm_slot(struct snd_soc_da= i *dai, return 0; } =20 +static int tas2770_set_dai_tdm_idle(struct snd_soc_dai *dai, + unsigned int tx_mask, + unsigned int rx_mask, + int tx_mode, int rx_mode) +{ + struct snd_soc_component *component =3D dai->component; + struct tas2770_priv *tas2770 =3D snd_soc_component_get_drvdata(component); + int ret; + + /* We don't support setting anything for SDIN */ + if (rx_mode) + return -EOPNOTSUPP; + + if (tas2770->idle_tx_mode =3D=3D tx_mode) + return 0; + + switch (tx_mode) { + case SND_SOC_DAI_TDM_IDLE_PULLDOWN: + ret =3D snd_soc_component_update_bits(component, TAS2770_DIN_PD, + TAS2770_DIN_PD_SDOUT, + TAS2770_DIN_PD_SDOUT); + if (ret) + return ret; + + break; + case SND_SOC_DAI_TDM_IDLE_ZERO: + ret =3D snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4, + TAS2770_TDM_CFG_REG4_TX_KEEPER, + TAS2770_TDM_CFG_REG4_TX_KEEPER); + if (ret) + return ret; + + ret =3D snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4, + TAS2770_TDM_CFG_REG4_TX_FILL, 0); + if (ret) + return ret; + + break; + case SND_SOC_DAI_TDM_IDLE_HIZ: + ret =3D snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4, + TAS2770_TDM_CFG_REG4_TX_KEEPER, + TAS2770_TDM_CFG_REG4_TX_KEEPER); + if (ret) + return ret; + + ret =3D snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4, + TAS2770_TDM_CFG_REG4_TX_FILL, + TAS2770_TDM_CFG_REG4_TX_FILL); + if (ret) + return ret; + + break; + case SND_SOC_DAI_TDM_IDLE_OFF: + ret =3D snd_soc_component_update_bits(component, TAS2770_DIN_PD, + TAS2770_DIN_PD_SDOUT, 0); + if (ret) + return ret; + + ret =3D snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4, + TAS2770_TDM_CFG_REG4_TX_KEEPER, 0); + if (ret) + return ret; + + break; + + default: + return -EOPNOTSUPP; + } + + tas2770->idle_tx_mode =3D tx_mode; + + return 0; +} + static const struct snd_soc_dai_ops tas2770_dai_ops =3D { .mute_stream =3D tas2770_mute, .hw_params =3D tas2770_hw_params, .set_fmt =3D tas2770_set_fmt, .set_tdm_slot =3D tas2770_set_dai_tdm_slot, + .set_tdm_idle =3D tas2770_set_dai_tdm_idle, .no_capture_mute =3D 1, }; =20 diff --git a/sound/soc/codecs/tas2770.h b/sound/soc/codecs/tas2770.h index 3fd2e7003c50..102040b6bdf8 100644 --- a/sound/soc/codecs/tas2770.h +++ b/sound/soc/codecs/tas2770.h @@ -67,6 +67,14 @@ #define TAS2770_TDM_CFG_REG3_RXS_SHIFT 0x4 #define TAS2770_TDM_CFG_REG3_30_MASK GENMASK(3, 0) #define TAS2770_TDM_CFG_REG3_30_SHIFT 0 + /* TDM Configuration Reg4 */ +#define TAS2770_TDM_CFG_REG4 TAS2770_REG(0X0, 0x0E) +#define TAS2770_TDM_CFG_REG4_TX_LSB_CFG BIT(7) +#define TAS2770_TDM_CFG_REG4_TX_KEEPER_CFG BIT(6) +#define TAS2770_TDM_CFG_REG4_TX_KEEPER BIT(5) +#define TAS2770_TDM_CFG_REG4_TX_FILL BIT(4) +#define TAS2770_TDM_CFG_REG4_TX_OFFSET_MASK GENMASK(3, 1) +#define TAS2770_TDM_CFG_REG4_TX_EDGE_FALLING BIT(0) /* TDM Configuration Reg5 */ #define TAS2770_TDM_CFG_REG5 TAS2770_REG(0X0, 0x0F) #define TAS2770_TDM_CFG_REG5_VSNS_MASK BIT(6) @@ -115,6 +123,9 @@ #define TAS2770_TEMP_LSB TAS2770_REG(0X0, 0x2A) /* Interrupt Configuration */ #define TAS2770_INT_CFG TAS2770_REG(0X0, 0x30) + /* Data In Pull-Down */ +#define TAS2770_DIN_PD TAS2770_REG(0X0, 0x31) +#define TAS2770_DIN_PD_SDOUT BIT(7) /* Misc IRQ */ #define TAS2770_MISC_IRQ TAS2770_REG(0X0, 0x32) /* Clock Configuration */ @@ -146,6 +157,7 @@ struct tas2770_priv { int pdm_slot; bool dac_powered; bool unmuted; + int idle_tx_mode; }; =20 #endif /* __TAS2770__ */ --=20 2.52.0