From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
	(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 916081B4236;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736750146; cv=none; b=OSGpCIXOUBhxnRTMoEGHxWpu0DmfdgJvx2eyLz0/MWxI3RY+ikZ4og9iuQ4efMl2mOP87HP/3OfXLtIGkptfY9xeYstJ6JvgNAPUc/HyHhQFs7y+0jKS1DKrkAZb2jrSIrFgtThUP6ieiMSN8YA4XS38LtYlvhM6k/iTGqhHNKs=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736750146; c=relaxed/simple;
	bh=jTNH048J8/e37rPd6oTYl8kF3JhnEDxWF56FPekHMjE=;
	h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=CfNWgDzDtoSLuK6oIqSuJ/zEOcOnBivJ8RA4ZNKCcXf2g09snsQJ3+44CNohU28LGaeiQpiQwtbDHCQkoCfZykbTzT0JNWYA7G5VsbV0+hCXjNOGgquoFks3x/lqnFpxfjSDj1/YnvoH+4jKbMX7nZXNS5SkXYjbjUSwCs8b12c=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MoMkt8YH; arc=none smtp.client-ip=10.30.226.201
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MoMkt8YH"
Received: by smtp.kernel.org (Postfix) with ESMTPS id 1C714C4CED6;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1736750146;
	bh=jTNH048J8/e37rPd6oTYl8kF3JhnEDxWF56FPekHMjE=;
	h=From:Subject:Date:To:Cc:Reply-To:From;
	b=MoMkt8YHcrwIqGAAUSz8wPAph1rZMXMe0aRXDbRfgSdTp8AZpNqaAK/J/kdEONx23
	 jFUR75ep9xRmy5c1P2UovMT9EdtfLVIy/Gx8zmqD6oLUGkzjFVMZhA9qf4FIdM2YiW
	 W3NMBRtRG/q/J4XG5R6CEpvGQK1Ky8UN9ck9XS0qqGUHVoDcN+hycGI6XvoYmYoWWh
	 QCpwL6e0eIiO4296uoWh/GPkbeuxwc94FXDwE1DSYg8AEx46TTXpSwMCAwTzNNNqZX
	 KBvJpjSlMie/g71hLkAb/eP+GJ6KTcKofb3iUIXY7H/XNBDizueUVHLdWJJrbi/02W
	 +LMkfj52fewIg==
Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1])
	by smtp.lore.kernel.org (Postfix) with ESMTP id F1C4EE7719E;
	Mon, 13 Jan 2025 06:35:45 +0000 (UTC)
From: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>
Subject: [PATCH 0/3] Add support for S4 audio
Date: Mon, 13 Jan 2025 14:35:12 +0800
Message-Id: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIACG0hGcC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE
 vPSU3UzU4B8JSMDI1MDQ0MD3cTSlMz8+JSisszUIl0D80RTYwvDZBNLkyQloJaCotS0zAqwcdG
 xtbUAVy28hV4AAAA=
X-Change-ID: 20250110-audio_drvier-07a5381c494b
To: Jerome Brunet <jbrunet@baylibre.com>, 
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, 
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, 
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>, 
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>, 
 Kevin Hilman <khilman@baylibre.com>, 
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
 linux-amlogic@lists.infradead.org, jiebing chen <jiebing.chen@amlogic.com>
X-Mailer: b4 0.14.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1736750144; l=1136;
 i=jiebing.chen@amlogic.com; s=20250110; h=from:subject:message-id;
 bh=jTNH048J8/e37rPd6oTYl8kF3JhnEDxWF56FPekHMjE=;
 b=zGklfCbSRH4yBG2RsEX2vhu/9ldv5Wjvg/qtKRhQIJW7IToz0zt7qIztoJwr2Tg7lR98AKjfB
 4eXneib0EVrClzcwjQKfqXlUYUGjcwHG4T4zCfukXL2UQFptj3PvQys
X-Developer-Key: i=jiebing.chen@amlogic.com; a=ed25519;
 pk=6rFvvF45A84pLNRy03hfUHeROxHCnZ+1KAGw/DoqKic=
X-Endpoint-Received: by B4 Relay for jiebing.chen@amlogic.com/20250110 with
 auth_id=316
X-Original-From: jiebing chen <jiebing.chen@amlogic.com>
Reply-To: jiebing.chen@amlogic.com

Add the tdmout pad control and tocodec control driver. 

Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
---
jiebing chen (3):
      ASoC: dt-bindings: Add Amlogic S4 audio
      ASoC: meson: s4:support for the on-chip audio
      arm64: dts: amlogic: Add Amlogic S4 Audio

 .../bindings/sound/amlogic,s4-tdmout-pad.yaml      |  36 ++
 .../bindings/sound/amlogic,s4-tocodec.yaml         |  44 +++
 .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts     | 226 ++++++++++++
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi          | 385 ++++++++++++++++++++-
 sound/soc/meson/Kconfig                            |  16 +
 sound/soc/meson/Makefile                           |   6 +
 sound/soc/meson/s4-pad-out-control.c               | 372 ++++++++++++++++++++
 sound/soc/meson/s4-tocodec-control.c               | 376 ++++++++++++++++++++
 sound/soc/meson/t9015.c                            |   5 +-
 9 files changed, 1461 insertions(+), 5 deletions(-)
---
base-commit: 6ecd20965bdc21b265a0671ccf36d9ad8043f5ab
change-id: 20250110-audio_drvier-07a5381c494b

Best regards,
-- 
jiebing chen <jiebing.chen@amlogic.com>



From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
	(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 916A6230D32;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736750146; cv=none; b=Nqg4aIap4BEgJTMMaTOw6jGjIOfc/NagqhNKeQ8C7DNDnEuadZez9MYcN92KmY1A+J6UWNJoJH6nXsoCXWBNOOLjAeCgE5eSX9wWX6C5Y5s8q4eeMiScSL9Vks5NWIJcvt8sHApNYw/H1Z5oatFLnxQTJAVd8TmF4AZQSl03xpc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736750146; c=relaxed/simple;
	bh=TVWgIhv7jNPBn03yzeSSA6nU+Yg1gSNtcBJ4IGCNeJw=;
	h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
	 In-Reply-To:To:Cc; b=I9a2jXF5h5Bcq/lgfwreRWG+gOETx150WeafLmoIQ6Za8nU0bl5pJi6/003Cv73QzhxC0eMTkHuyNvUpnaK62Muid+BJ/JNcLF0vzXKawx9/zBD3w/AQcXYQDzQtyNx16KWlKewo/xcoSVKvI5499z06HK6KqlT6bMpkOdqwsQY=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d1f3cbF5; arc=none smtp.client-ip=10.30.226.201
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d1f3cbF5"
Received: by smtp.kernel.org (Postfix) with ESMTPS id 2794CC4CEE3;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1736750146;
	bh=TVWgIhv7jNPBn03yzeSSA6nU+Yg1gSNtcBJ4IGCNeJw=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;
	b=d1f3cbF5Jlts0cA079nixdITOu2A6yJOvh1HemRh4Qk3aHbyn+Bli3MTQT5YclCZM
	 6FOTMrYRk5KMUUGIYh7begdpW8Z6qEP5praTmx45aT5XQUOzoi81bYzlzRZLAIe07R
	 zvAbCnOj6LhIWGLSAq4F8e3op8zFilpUAXstcJKON0kRopovUb9UtIHPbw+X+M61IY
	 RGy84gcPDr//LNRi3b2vmyOIn4A60rdG/ol+U1JCYtckrFISiri9KIYbfxk/naoJxB
	 dkmRuKaKvvx/ps14MfyueHFNh9jgMrZF4ZVnirlfjCMWdac9d8nbZYfIY/aZLqsNfz
	 1su8mPzOaJVTw==
Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1])
	by smtp.lore.kernel.org (Postfix) with ESMTP id 11338C02181;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
From: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>
Date: Mon, 13 Jan 2025 14:35:13 +0800
Subject: [PATCH 1/3] ASoC: dt-bindings: Add Amlogic S4 audio
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250113-audio_drvier-v1-1-8c14770f38a0@amlogic.com>
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
In-Reply-To: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>, 
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, 
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, 
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>, 
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>, 
 Kevin Hilman <khilman@baylibre.com>, 
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
 linux-amlogic@lists.infradead.org, jiebing chen <jiebing.chen@amlogic.com>
X-Mailer: b4 0.14.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1736750144; l=2813;
 i=jiebing.chen@amlogic.com; s=20250110; h=from:subject:message-id;
 bh=WCHwNizSKV+MVm8cr+tvi7sYlTiE07e5O4lnJdR4l0s=;
 b=EAQ/sWZRwRHDES9kXCR4bRpzb5k5JJQvE7U+C4aMeBUpmUb95W8OSeWgevMGcsLYQkNFO64Yf
 zYgk09Bs42sDcegEYaRYDt0ObX2B+i8IhDGiH0cY7qebfgvrr4m5mpA
X-Developer-Key: i=jiebing.chen@amlogic.com; a=ed25519;
 pk=6rFvvF45A84pLNRy03hfUHeROxHCnZ+1KAGw/DoqKic=
X-Endpoint-Received: by B4 Relay for jiebing.chen@amlogic.com/20250110 with
 auth_id=316
X-Original-From: jiebing chen <jiebing.chen@amlogic.com>
Reply-To: jiebing.chen@amlogic.com

From: jiebing chen <jiebing.chen@amlogic.com>

Add documentation describing the Amlogic S4 TDM output pad and toacodec.

Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
---
 .../bindings/sound/amlogic,s4-tdmout-pad.yaml      | 36 ++++++++++++++++++
 .../bindings/sound/amlogic,s4-tocodec.yaml         | 44 ++++++++++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/amlogic,s4-tdmout-pad.yaml b/Documentation/devicetree/bindings/sound/amlogic,s4-tdmout-pad.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..52c945e63fb277c92149fad7abd69355f5c9fc9d
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/amlogic,s4-tdmout-pad.yaml
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2024 Amlogic, Inc. All rights reserved
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,s4-tdmout-pad.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic TDM Internal PAD
+
+maintainers:
+  - Jiebing Chen <jiebing.chen@amlogic.com>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    items:
+      - const: amlogic,s4-tdmout-pad
+  reg:
+    maxItems: 1
+
+  sound-name-prefix: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    audio-controller@e58 {
+        compatible = "amlogic,s4-tdmout-pad";
+        reg = <0xe58 0x28>;
+    };
diff --git a/Documentation/devicetree/bindings/sound/amlogic,s4-tocodec.yaml b/Documentation/devicetree/bindings/sound/amlogic,s4-tocodec.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..a4d7388c0e48095b4aea0530c7feafcaf066b063
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/amlogic,s4-tocodec.yaml
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2024 Amlogic, Inc. All rights reserved
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,s4-tocodec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic S4 Audio Tocodec Control
+
+maintainers:
+  - Jiebing Chen <jiebing.chen@amlogic.com>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    items:
+      - const: amlogic,s4-tocodec
+
+  reg:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  sound-name-prefix: true
+
+required:
+  - compatible
+  - reg
+  - resets
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
+    audio-controller@740 {
+        compatible = "amlogic,s4-tocodec";
+        reg = <0x0 0x740 0x0 0x4>;
+        sound-name-prefix = "TOACODEC";
+        resets = <&clkc_audio AUD_RESET_TOACODEC>;
+    };

-- 
2.43.0



From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
	(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 9E967231A2A;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736750146; cv=none; b=uqaZp0SMafHBMfWTh8H2ZPseU/uzS0li63dTSgs2bSBkQ41YvUoCF3RmnwwzJ0RhHnCsgM4WQ05uPQKpbR3TWU8E8FlDns8KYdi8hcZ8jb/hMh/qtE2MOrx3A2iDD5Cq31nQlUaFXeTP9ooZYnymhQzAPQohizOO34vmQ8JehLc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736750146; c=relaxed/simple;
	bh=ApfxHKEe79RuhMyVCQS4T3mC7rEhIxsFIcwZqRrmwv4=;
	h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
	 In-Reply-To:To:Cc; b=sPK1TScSwauRcRMhJGksCI/gNtlXytB9WBR0GF8xmbu/Qh3zXIyHFg7OllGp6iZptzTPqDMu4JOxP54aqQHiKWq9xB+qdufEJP+4Z5bWY2xiUg44r9iyKn1PClM9bwRra03S3tPmIcJDOGRnt7CohXuFYPg0v8dgh1i1FH+ilSs=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OWi/AFWX; arc=none smtp.client-ip=10.30.226.201
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OWi/AFWX"
Received: by smtp.kernel.org (Postfix) with ESMTPS id 45F7FC4CEE5;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1736750146;
	bh=ApfxHKEe79RuhMyVCQS4T3mC7rEhIxsFIcwZqRrmwv4=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;
	b=OWi/AFWX/dbrrk37Gv4KRCkXrVTxrZqYG6j8zQ5qQVAem95DEuX862hAKVFtwZcuH
	 tZJdRGHpW57W8xLGEy29mKhrdZqt7pxjgenjV9A4I6Y584pv10rcT3ryhN7B7dxu+6
	 yW3gMwRQC5/wDq3OK+Zxd9AcM8McGbWQl7wQohZNpBX34TZzhhOI9/xGR9xxvvgbc2
	 rDaHmrleXlGa9WD3eykeu06Y+04j5IbXfUkzfTOIhs43Rin+aqmmwLtXb1d0PXnIgz
	 ZhgUgOw/WuE+shBg864nyxkC4kxpuO0Mcl1OcwGLGKxc7Wn7OOwRu251qSpPmL29mj
	 KI1bczJ/e2r/g==
Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1])
	by smtp.lore.kernel.org (Postfix) with ESMTP id 305E7C02184;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
From: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>
Date: Mon, 13 Jan 2025 14:35:15 +0800
Subject: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
In-Reply-To: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>, 
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, 
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, 
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>, 
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>, 
 Kevin Hilman <khilman@baylibre.com>, 
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
 linux-amlogic@lists.infradead.org, jiebing chen <jiebing.chen@amlogic.com>
X-Mailer: b4 0.14.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1736750144; l=20860;
 i=jiebing.chen@amlogic.com; s=20250110; h=from:subject:message-id;
 bh=2u7GHXpPa/EtVO2Qk293Yt7S+43atX06hHJjPyDEP0o=;
 b=87cQQvF4kNzgPxgOJzfRW2Y9nYdid+7u3bjqWeIEyWTSqLulNrGjmgO+NrjO9VPCBQiIHZdhd
 NUQf83G5uBHBc39EUzjz2nk4NOmDBTktMvS+kIQ6SifYWaP8AV6gdse
X-Developer-Key: i=jiebing.chen@amlogic.com; a=ed25519;
 pk=6rFvvF45A84pLNRy03hfUHeROxHCnZ+1KAGw/DoqKic=
X-Endpoint-Received: by B4 Relay for jiebing.chen@amlogic.com/20250110 with
 auth_id=316
X-Original-From: jiebing chen <jiebing.chen@amlogic.com>
Reply-To: jiebing.chen@amlogic.com

From: jiebing chen <jiebing.chen@amlogic.com>

Add basic audio driver support for the Amlogic S4 based Amlogic
AQ222 board.

Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
---
 .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts     | 226 ++++++++++++
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi          | 385 ++++++++++++++++++++-
 2 files changed, 610 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
index 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c5528b43422b705b20130 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
@@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
 	       regulator-always-on;
 	};
 
+	vcc5v_reg: regulator-vcc-5v {
+		compatible = "regulator-fixed";
+		vin-supply = <&main_12v>;
+		regulator-name = "VCC5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
+		startup-delay-us = <7000>;
+		enable-active-high;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
 	/* SY8120B1ABC DC/DC Regulator. */
 	vddcpu: regulator-vddcpu {
 		compatible = "pwm-regulator";
@@ -129,6 +142,219 @@ vddcpu: regulator-vddcpu {
 				<699000 98>,
 				<689000 100>;
 	};
+	dmics: audio-codec-1 {
+		compatible = "dmic-codec";
+		#sound-dai-cells = <0>;
+		num-channels = <2>;
+		wakeup-delay-ms = <50>;
+		sound-name-prefix = "MIC";
+	};
+
+	dioo2133: audio-amplifier-0 {
+		compatible = "simple-audio-amplifier";
+		enable-gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
+		VCC-supply = <&vcc5v_reg>;
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "10U2";
+	};
+
+	spdif_dir: audio-spdif-in {
+		compatible = "linux,spdif-dir";
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "DIR";
+	};
+
+	spdif_dit: audio-spdif-out {
+		compatible = "linux,spdif-dit";
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "DIT";
+	};
+
+	sound {
+		compatible = "amlogic,axg-sound-card";
+		model = "aq222";
+		audio-widgets = "Line", "Lineout";
+		audio-aux-devs = <&tdmout_a>, <&tdmout_b>, <&tdmout_c>,
+				 <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
+				 <&tdmin_lb>, <&dioo2133>, <&tdmout_pad>, <&toacodec>;
+		audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
+				"TDMOUT_A IN 1", "FRDDR_B OUT 0",
+				"TDMOUT_A IN 2", "FRDDR_C OUT 0",
+				"TDM_A Playback", "TDMOUT_A OUT",
+				"TDMA_OUT SEL",   "TDM_A Playback",
+				"TDMOUT_B IN 0", "FRDDR_A OUT 1",
+				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
+				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
+				"TDM_B Playback", "TDMOUT_B OUT",
+				"TDMB_OUT SEL",   "TDM_B Playback",
+				"TDMOUT_C IN 0", "FRDDR_A OUT 2",
+				"TDMOUT_C IN 1", "FRDDR_B OUT 2",
+				"TDMOUT_C IN 2", "FRDDR_C OUT 2",
+				"TDM_C Playback", "TDMOUT_C OUT",
+				"TDMC_OUT SEL",   "TDM_C Playback",
+				"TOACODEC TDMA", "TDM_A Playback",
+				"TOACODEC TDMB", "TDM_B Playback",
+				"TOACODEC TDMC", "TDM_C Playback",
+				"SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
+				"SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
+				"SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
+				"SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
+				"SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
+				"SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
+				"TDMIN_A IN 0", "TDM_A Capture",
+				"TDMIN_A IN 1", "TDM_B Capture",
+				"TDMIN_A IN 2", "TDM_C Capture",
+				"TDMIN_A IN 3", "TDM_A Loopback",
+				"TDMIN_A IN 4", "TDM_B Loopback",
+				"TDMIN_A IN 5", "TDM_C Loopback",
+				"TDMIN_B IN 0", "TDM_A Capture",
+				"TDMIN_B IN 1", "TDM_B Capture",
+				"TDMIN_B IN 2", "TDM_C Capture",
+				"TDMIN_B IN 3", "TDM_A Loopback",
+				"TDMIN_B IN 4", "TDM_B Loopback",
+				"TDMIN_B IN 5", "TDM_C Loopback",
+				"TDMIN_C IN 0", "TDM_A Capture",
+				"TDMIN_C IN 1", "TDM_B Capture",
+				"TDMIN_C IN 2", "TDM_C Capture",
+				"TDMIN_C IN 3", "TDM_A Loopback",
+				"TDMIN_C IN 4", "TDM_B Loopback",
+				"TDMIN_C IN 5", "TDM_C Loopback",
+				"TDMIN_LB IN 3", "TDM_A Capture",
+				"TDMIN_LB IN 4", "TDM_B Capture",
+				"TDMIN_LB IN 5", "TDM_C Capture",
+				"TDMIN_LB IN 0", "TDM_A Loopback",
+				"TDMIN_LB IN 1", "TDM_B Loopback",
+				"TDMIN_LB IN 2", "TDM_C Loopback",
+				"TODDR_A IN 0", "TDMIN_A OUT",
+				"TODDR_B IN 0", "TDMIN_A OUT",
+				"TODDR_C IN 0", "TDMIN_A OUT",
+				"TODDR_A IN 1", "TDMIN_B OUT",
+				"TODDR_B IN 1", "TDMIN_B OUT",
+				"TODDR_C IN 1", "TDMIN_B OUT",
+				"TODDR_A IN 2", "TDMIN_C OUT",
+				"TODDR_B IN 2", "TDMIN_C OUT",
+				"TODDR_C IN 2", "TDMIN_C OUT",
+				"TODDR_A IN 3", "SPDIFIN Capture",
+				"TODDR_B IN 3", "SPDIFIN Capture",
+				"TODDR_C IN 3", "SPDIFIN Capture",
+				"TODDR_A IN 6", "TDMIN_LB OUT",
+				"TODDR_B IN 6", "TDMIN_LB OUT",
+				"TODDR_C IN 6", "TDMIN_LB OUT",
+				"10U2 INL", "ACODEC LOLP",
+				"10U2 INR", "ACODEC LORP",
+				"Lineout", "10U2 OUTL",
+				"Lineout", "10U2 OUTR";
+		assigned-clocks = <&clkc_pll CLKID_HIFI_PLL>,
+				  <&clkc_pll CLKID_MPLL2>,
+				  <&clkc_pll CLKID_MPLL0>,
+				  <&clkc_pll CLKID_MPLL1>;
+		assigned-clock-rates = <491520000>,
+				       <294912000>,
+				       <270950400>,
+				       <393216000>;
+
+		dai-link-0 {
+			sound-dai = <&frddr_a>;
+		};
+
+		dai-link-1 {
+			sound-dai = <&frddr_b>;
+		};
+
+		dai-link-2 {
+			sound-dai = <&frddr_c>;
+		};
+
+		dai-link-3 {
+			sound-dai = <&toddr_a>;
+		};
+
+		dai-link-4 {
+			sound-dai = <&toddr_b>;
+		};
+
+		dai-link-5 {
+			sound-dai = <&toddr_c>;
+		};
+
+		/* Connected to the WIFI/BT chip */
+		dai-link-6 {
+			sound-dai = <&tdmif_a>;
+			dai-format = "dsp_a";
+			dai-tdm-slot-tx-mask-0 = <1 1>;
+			mclk-fs = <256>;
+			codec-0 {
+				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
+			};
+		};
+
+		/* Connected to the onboard AD82584F DAC */
+		dai-link-7 {
+			sound-dai = <&tdmif_b>;
+			dai-format = "i2s";
+			dai-tdm-slot-tx-mask-0 = <1 1>;
+			mclk-fs = <256>;
+
+			codec-0 {
+				sound-dai = <&acodec>;
+			};
+
+			codec-1 {
+				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
+			};
+		};
+
+		/* 8ch HDMI interface */
+		dai-link-8 {
+			sound-dai = <&tdmif_c>;
+			dai-format = "i2s";
+			dai-tdm-slot-tx-mask-0 = <1 1>;
+			dai-tdm-slot-tx-mask-1 = <1 1>;
+			dai-tdm-slot-tx-mask-2 = <1 1>;
+			dai-tdm-slot-tx-mask-3 = <1 1>;
+			mclk-fs = <256>;
+
+			codec-0 {
+				sound-dai = <&acodec>;
+			};
+
+			codec-1 {
+				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
+			};
+		};
+
+		/* spdif hdmi and coax output */
+		dai-link-9 {
+			sound-dai = <&spdifout_a>;
+
+			codec-0 {
+				sound-dai = <&spdif_dit>;
+			};
+
+			codec-1 {
+				sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>;
+			};
+		};
+
+		/* spdif hdmi interface */
+		dai-link-10 {
+			sound-dai = <&spdifout_b>;
+
+			codec {
+				sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>;
+			};
+		};
+
+		/* spdif coax input */
+		dai-link-11 {
+			sound-dai = <&spdifin>;
+
+			codec {
+				sound-dai = <&spdif_dir>;
+			};
+		};
+	};
+
 };
 
 &pwm_ef {
diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
index 957577d986c0675a503115e1ccbc4387c2051620..87a00ace23131e31822bb43fbe956b8abcbaef40 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
@@ -11,7 +11,11 @@
 #include <dt-bindings/clock/amlogic,s4-peripherals-clkc.h>
 #include <dt-bindings/power/meson-s4-power.h>
 #include <dt-bindings/reset/amlogic,meson-s4-reset.h>
-
+#include <dt-bindings/clock/axg-audio-clkc.h>
+#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
+#include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>
+#include <dt-bindings/sound/meson-g12a-toacodec.h>
+#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
 / {
 	cpus {
 		#address-cells = <2>;
@@ -46,6 +50,42 @@ cpu3: cpu@3 {
 		};
 	};
 
+	tdmif_a: audio-controller-0 {
+		compatible = "amlogic,axg-tdm-iface";
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "TDM_A";
+		clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
+			 <&clkc_audio AUD_CLKID_MST_A_SCLK>,
+			 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
+		clock-names = "mclk", "sclk", "lrclk";
+		assigned-clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK_SEL>;
+		assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
+	};
+
+	tdmif_b: audio-controller-1 {
+		compatible = "amlogic,axg-tdm-iface";
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "TDM_B";
+		clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
+			 <&clkc_audio AUD_CLKID_MST_B_SCLK>,
+			 <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
+		clock-names = "mclk", "sclk", "lrclk";
+		assigned-clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK_SEL>;
+		assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
+	};
+
+	tdmif_c: audio-controller-2 {
+		compatible = "amlogic,axg-tdm-iface";
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "TDM_C";
+		clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK>,
+			 <&clkc_audio AUD_CLKID_MST_C_SCLK>,
+			 <&clkc_audio AUD_CLKID_MST_C_LRCLK>;
+		clock-names = "mclk", "sclk", "lrclk";
+		assigned-clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK_SEL>;
+		assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
@@ -850,3 +890,346 @@ emmc: mmc@fe08c000 {
 		};
 	};
 };
+
+&apb4 {
+	audio: bus@330000 {
+		compatible = "simple-bus";
+		reg = <0x0 0x330000 0x0 0x1000>;
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges = <0x0 0x0 0x0 0x330000 0x0 0x1000>;
+
+		clkc_audio: clock-controller@0 {
+			compatible = "amlogic,sm1-audio-clkc";
+			reg = <0x0 0x0 0x0 0xb4>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+			power-domains = <&pwrc PWRC_S4_AUDIO_ID>;
+			clocks = <&clkc_periphs CLKID_AUDIO>,
+				 <&clkc_pll CLKID_MPLL0>,
+				 <&clkc_pll CLKID_MPLL1>,
+				 <&clkc_pll CLKID_MPLL2>,
+				 <&clkc_pll CLKID_MPLL3>,
+				 <&clkc_pll CLKID_HIFI_PLL>,
+				 <&clkc_pll CLKID_FCLK_DIV3>,
+				 <&clkc_pll CLKID_FCLK_DIV4>,
+				 <&clkc_pll CLKID_FCLK_DIV5>;
+			clock-names = "pclk",
+				      "mst_in0",
+				      "mst_in1",
+				      "mst_in2",
+				      "mst_in3",
+				      "mst_in4",
+				      "mst_in5",
+				      "mst_in6",
+				      "mst_in7";
+
+			resets = <&reset RESET_AUDIO>;
+		};
+
+		toddr_a: audio-controller@100 {
+			compatible = "amlogic,sm1-toddr",
+				     "amlogic,axg-toddr";
+			reg = <0x0 0x100 0x0 0x2c>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "TODDR_A";
+			interrupts = <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_TODDR_A>;
+			resets = <&arb AXG_ARB_TODDR_A>,
+				 <&clkc_audio AUD_RESET_TODDR_A>;
+			reset-names = "arb", "rst";
+			amlogic,fifo-depth = <8192>;
+		};
+
+		toddr_b: audio-controller@140 {
+			compatible = "amlogic,sm1-toddr",
+				     "amlogic,axg-toddr";
+			reg = <0x0 0x140 0x0 0x2c>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "TODDR_B";
+			interrupts = <GIC_SPI 33 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_TODDR_B>;
+			resets = <&arb AXG_ARB_TODDR_B>,
+				 <&clkc_audio AUD_RESET_TODDR_B>;
+			reset-names = "arb", "rst";
+			amlogic,fifo-depth = <256>;
+		};
+
+		toddr_c: audio-controller@180 {
+			compatible = "amlogic,sm1-toddr",
+				     "amlogic,axg-toddr";
+			reg = <0x0 0x180 0x0 0x2c>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "TODDR_C";
+			interrupts = <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_TODDR_C>;
+			resets = <&arb AXG_ARB_TODDR_C>,
+				 <&clkc_audio AUD_RESET_TODDR_C>;
+			reset-names = "arb", "rst";
+			amlogic,fifo-depth = <256>;
+		};
+
+		frddr_a: audio-controller@1c0 {
+			compatible = "amlogic,sm1-frddr",
+				     "amlogic,axg-frddr";
+			reg = <0x0 0x1c0 0x0 0x2c>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "FRDDR_A";
+			interrupts = <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
+			resets = <&arb AXG_ARB_FRDDR_A>,
+				 <&clkc_audio AUD_RESET_FRDDR_A>;
+			reset-names = "arb", "rst";
+			amlogic,fifo-depth = <512>;
+		};
+
+		frddr_b: audio-controller@200 {
+			compatible = "amlogic,sm1-frddr",
+				     "amlogic,axg-frddr";
+			reg = <0x0 0x200 0x0 0x2c>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "FRDDR_B";
+			interrupts = <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_FRDDR_B>;
+			resets = <&arb AXG_ARB_FRDDR_B>,
+				 <&clkc_audio AUD_RESET_FRDDR_B>;
+			reset-names = "arb", "rst";
+			amlogic,fifo-depth = <256>;
+		};
+
+		frddr_c: audio-controller@240 {
+			compatible = "amlogic,sm1-frddr",
+				     "amlogic,axg-frddr";
+			reg = <0x0 0x240 0x0 0x2c>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "FRDDR_C";
+			interrupts = <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_FRDDR_C>;
+			resets = <&arb AXG_ARB_FRDDR_C>,
+				 <&clkc_audio AUD_RESET_FRDDR_C>;
+			reset-names = "arb", "rst";
+			amlogic,fifo-depth = <256>;
+		};
+
+		arb: reset-controller@280 {
+			compatible = "amlogic,meson-sm1-audio-arb";
+			reg = <0x0 0x280 0x0 0x4>;
+			#reset-cells = <1>;
+			clocks = <&clkc_audio AUD_CLKID_DDR_ARB>;
+		};
+
+		tdmin_a: audio-controller@300 {
+			compatible = "amlogic,sm1-tdmin",
+				     "amlogic,axg-tdmin";
+			reg = <0x0 0x300 0x0 0x40>;
+			sound-name-prefix = "TDMIN_A";
+			resets = <&clkc_audio AUD_RESET_TDMIN_A>;
+			clocks = <&clkc_audio AUD_CLKID_TDMIN_A>,
+				 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK>,
+				 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK_SEL>,
+				 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>,
+				 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>;
+			clock-names = "pclk", "sclk", "sclk_sel",
+				      "lrclk", "lrclk_sel";
+		};
+
+		tdmin_b: audio-controller@340 {
+			compatible = "amlogic,sm1-tdmin",
+				     "amlogic,axg-tdmin";
+			reg = <0x0 0x340 0x0 0x40>;
+			sound-name-prefix = "TDMIN_B";
+			resets = <&clkc_audio AUD_RESET_TDMIN_B>;
+			clocks = <&clkc_audio AUD_CLKID_TDMIN_B>,
+				 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK>,
+				 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK_SEL>,
+				 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>,
+				 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>;
+			clock-names = "pclk", "sclk", "sclk_sel",
+				      "lrclk", "lrclk_sel";
+		};
+
+		tdmin_c: audio-controller@380 {
+			compatible = "amlogic,sm1-tdmin",
+				     "amlogic,axg-tdmin";
+			reg = <0x0 0x380 0x0 0x40>;
+			sound-name-prefix = "TDMIN_C";
+			resets = <&clkc_audio AUD_RESET_TDMIN_C>;
+			clocks = <&clkc_audio AUD_CLKID_TDMIN_C>,
+				 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK>,
+				 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK_SEL>,
+				 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>,
+				 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>;
+			clock-names = "pclk", "sclk", "sclk_sel",
+				      "lrclk", "lrclk_sel";
+		};
+
+		tdmin_lb: audio-controller@3c0 {
+			compatible = "amlogic,sm1-tdmin",
+				     "amlogic,axg-tdmin";
+			reg = <0x0 0x3c0 0x0 0x40>;
+			sound-name-prefix = "TDMIN_LB";
+			resets = <&clkc_audio AUD_RESET_TDMIN_LB>;
+			clocks = <&clkc_audio AUD_CLKID_TDMIN_LB>,
+				 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK>,
+				 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK_SEL>,
+				 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>,
+				 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>;
+			clock-names = "pclk", "sclk", "sclk_sel",
+				      "lrclk", "lrclk_sel";
+		};
+
+		spdifin: audio-controller@400 {
+			compatible = "amlogic,g12a-spdifin",
+				     "amlogic,axg-spdifin";
+			reg = <0x0 0x400 0x0 0x30>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "SPDIFIN";
+			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
+			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
+			clock-names = "pclk", "refclk";
+			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
+		};
+
+		spdifout_a: audio-controller@480 {
+			compatible = "amlogic,g12a-spdifout",
+				     "amlogic,axg-spdifout";
+			reg = <0x0 0x480 0x0 0x50>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "SPDIFOUT_A";
+			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
+			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
+			clock-names = "pclk", "mclk";
+			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
+		};
+
+		tdmout_a: audio-controller@500 {
+			compatible = "amlogic,sm1-tdmout";
+			reg = <0x0 0x500 0x0 0x40>;
+			sound-name-prefix = "TDMOUT_A";
+			resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
+			clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
+			clock-names = "pclk", "sclk", "sclk_sel",
+				      "lrclk", "lrclk_sel";
+		};
+
+		tdmout_b: audio-controller@540 {
+			compatible = "amlogic,sm1-tdmout";
+			reg = <0x0 0x540 0x0 0x40>;
+			sound-name-prefix = "TDMOUT_B";
+			resets = <&clkc_audio AUD_RESET_TDMOUT_B>;
+			clocks = <&clkc_audio AUD_CLKID_TDMOUT_B>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK_SEL>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>;
+			clock-names = "pclk", "sclk", "sclk_sel",
+				      "lrclk", "lrclk_sel";
+		};
+
+		tdmout_c: audio-controller@580 {
+			compatible = "amlogic,sm1-tdmout";
+			reg = <0x0 0x580 0x0 0x40>;
+			sound-name-prefix = "TDMOUT_C";
+			resets = <&clkc_audio AUD_RESET_TDMOUT_C>;
+			clocks = <&clkc_audio AUD_CLKID_TDMOUT_C>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK_SEL>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>,
+				 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>;
+			clock-names = "pclk", "sclk", "sclk_sel",
+				      "lrclk", "lrclk_sel";
+		};
+
+		spdifout_b: audio-controller@680 {
+			compatible = "amlogic,g12a-spdifout",
+				     "amlogic,axg-spdifout";
+			reg = <0x0 0x680 0x0 0x50>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "SPDIFOUT_B";
+			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
+				 <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
+			clock-names = "pclk", "mclk";
+			resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
+		};
+
+		toacodec: audio-controller@740 {
+			compatible = "amlogic,s4-tocodec";
+			reg = <0x0 0x740 0x0 0x4>;
+			sound-name-prefix = "TOACODEC";
+			resets = <&clkc_audio AUD_RESET_TOACODEC>;
+		};
+
+		tohdmitx: audio-controller@744 {
+			compatible = "amlogic,sm1-tohdmitx",
+				     "amlogic,g12a-tohdmitx";
+			reg = <0x0 0x744 0x0 0x4>;
+			#sound-dai-cells = <1>;
+			sound-name-prefix = "TOHDMITX";
+			resets = <&clkc_audio AUD_RESET_TOHDMITX>;
+		};
+
+		toddr_d: audio-controller@840 {
+			compatible = "amlogic,sm1-toddr",
+				     "amlogic,axg-toddr";
+			reg = <0x0 0x840 0x0 0x2c>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "TODDR_D";
+			interrupts = <GIC_SPI 45 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_TODDR_D>;
+			resets = <&arb AXG_ARB_TODDR_D>,
+				 <&clkc_audio AUD_RESET_TODDR_D>;
+			reset-names = "arb", "rst";
+			amlogic,fifo-depth = <256>;
+		};
+
+		frddr_d: audio-controller@880 {
+			 compatible = "amlogic,sm1-frddr",
+				      "amlogic,axg-frddr";
+			reg = <0x0 0x880 0x0 0x2c>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "FRDDR_D";
+			interrupts = <GIC_SPI 46 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_FRDDR_D>;
+			resets = <&arb AXG_ARB_FRDDR_D>,
+				 <&clkc_audio AUD_RESET_FRDDR_D>;
+			reset-names = "arb", "rst";
+			amlogic,fifo-depth = <256>;
+		};
+
+		tdmout_pad: audio-controller@E58 {
+			compatible = "amlogic,s4-tdmout-pad";
+			reg = <0x0 0xe58 0x0 0x28>;
+		};
+	};
+
+	pdm: audio-controller@331000 {
+		compatible = "amlogic,sm1-pdm",
+			     "amlogic,axg-pdm";
+		reg = <0x0 0x331000 0x0 0x34>;
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "PDM";
+		clocks = <&clkc_audio AUD_CLKID_PDM>,
+			 <&clkc_audio AUD_CLKID_PDM_DCLK>,
+			 <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
+		clock-names = "pclk", "dclk", "sysclk";
+		resets = <&clkc_audio AUD_RESET_PDM>;
+		assigned-clocks = <&clkc_audio AUD_CLKID_PDM_DCLK_SEL>,
+				  <&clkc_audio AUD_CLKID_PDM_SYSCLK_SEL>;
+		assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>,<&clkc_pll CLKID_HIFI_PLL>;
+	};
+	 acodec: audio-controller@1A000 {
+		compatible = "amlogic,t9015";
+		reg = <0x0 0x1A000 0x0 0x14>;
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "ACODEC";
+		clocks = <&clkc_periphs CLKID_ACODEC>;
+		clock-names = "pclk";
+		resets = <&reset RESET_ACODEC>;
+	};
+
+};

-- 
2.43.0



From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
	(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 9E907230D37;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736750146; cv=none; b=bFgPXRV4y7CeIE5Q7flqrt686erCALCgwJDVNCRR3X1Wu1+BLBDv2YMGS0CQBb/KijSU8PCtcTIpywuX3NfhkA1urkkPXEhD8im9jhdCvUynLuXIK6oRIGFb1UFZ9CLnrcVw6XYvoEqwGUdLQa8TV2bokX4z7vKD1BD67GfarMs=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736750146; c=relaxed/simple;
	bh=X+D6Wp9iKExTxMbquq2bVUvq4l65Ln1JowFLpqB7wWg=;
	h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
	 In-Reply-To:To:Cc; b=WcsYXuZKUHiexSkYtX+exWRhiyUT2auK+KTTT+BMlNVSW1RpRA9Pe64LQrcpENmt6HNUgV6h8rDaoWrzJtVaa3uYZhpai32yX8lsEUJIn79xMwR8tCMZTLJNYGEK56CVn1yCapuJeeRlONlKdq3XoxbBmIN3U4jkObl/pz4ulkc=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vt6Ik55b; arc=none smtp.client-ip=10.30.226.201
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vt6Ik55b"
Received: by smtp.kernel.org (Postfix) with ESMTPS id 42ADBC4CEE4;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1736750146;
	bh=X+D6Wp9iKExTxMbquq2bVUvq4l65Ln1JowFLpqB7wWg=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;
	b=Vt6Ik55bmIaqzsx6mUC6WAgusBDpZO1SJWtJz1YarM7B1W+LEo+CDW85r3L0hBS5K
	 AMkmK5KXunkDoYqhQzCn0QJ3cU/c0uAvzJ3j9i6nhqvbzQ/hczebDvH7cfh6fjDMeP
	 n008eASXh45tlK8rHoeF5pY8BtH+0qSbGRBFzoqckupkgfFzk9yIibFSPPwhelOxaV
	 vEDpeo5FilUI3InMrdv6s2tWIV3VC4xUwEdnYl1NGQsWVpUV/U2wEJkty6jw4ayzi8
	 oBAerJ/TnFXU+m1rpZ3fug/CaaZs/iBrE8GfNC6GS2xjzyDbu6RMBegdnK435xE4/t
	 Ow1ieG0ii5SoA==
Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1])
	by smtp.lore.kernel.org (Postfix) with ESMTP id 20A15E7719F;
	Mon, 13 Jan 2025 06:35:46 +0000 (UTC)
From: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>
Date: Mon, 13 Jan 2025 14:35:14 +0800
Subject: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
In-Reply-To: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>, 
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, 
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, 
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>, 
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>, 
 Kevin Hilman <khilman@baylibre.com>, 
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, 
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
 linux-amlogic@lists.infradead.org, jiebing chen <jiebing.chen@amlogic.com>
X-Mailer: b4 0.14.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1736750144; l=28495;
 i=jiebing.chen@amlogic.com; s=20250110; h=from:subject:message-id;
 bh=jaJ9B/y4s3w6VQWE6+tqXUR9XM5vgnlu1yFxZDn/q/k=;
 b=fvATIsE0mOCmOdn/H3WrnLPrAaQkU9IV7YegtF8n3WIv9xBEHShAZnQgZpHh3cG/12AQcyex3
 v6uwxvgzsP+BH8DH9zr5M6HA20mpZgSkOtEbrFCpG6G0MmmnvAk/8KZ
X-Developer-Key: i=jiebing.chen@amlogic.com; a=ed25519;
 pk=6rFvvF45A84pLNRy03hfUHeROxHCnZ+1KAGw/DoqKic=
X-Endpoint-Received: by B4 Relay for jiebing.chen@amlogic.com/20250110 with
 auth_id=316
X-Original-From: jiebing chen <jiebing.chen@amlogic.com>
Reply-To: jiebing.chen@amlogic.com

From: jiebing chen <jiebing.chen@amlogic.com>

Add audio support for Amlogic S4.The audio output pad
can be freelycombined with the output lane,and the tocodec
control logic has been optimized.

Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
---
 sound/soc/meson/Kconfig              |  16 ++
 sound/soc/meson/Makefile             |   6 +
 sound/soc/meson/s4-pad-out-control.c | 372 ++++++++++++++++++++++++++++++++++
 sound/soc/meson/s4-tocodec-control.c | 376 +++++++++++++++++++++++++++++++++++
 sound/soc/meson/t9015.c              |   5 +-
 5 files changed, 771 insertions(+), 4 deletions(-)

diff --git a/sound/soc/meson/Kconfig b/sound/soc/meson/Kconfig
index 6458d5dc4902f665211bb9e4ae7d274e4bff2fdc..d01e284642fd987cf4bdf88e5bf5f7c9a241af59 100644
--- a/sound/soc/meson/Kconfig
+++ b/sound/soc/meson/Kconfig
@@ -69,6 +69,8 @@ config SND_MESON_AXG_SOUND_CARD
 	imply SND_MESON_AXG_SPDIFIN
 	imply SND_MESON_AXG_PDM
 	imply SND_MESON_G12A_TOACODEC
+	imply SND_SOC_MESON_PAD_OUT
+	imply SND_SOC_MESON_TOCODEC_CONTROL
 	imply SND_MESON_G12A_TOHDMITX if DRM_MESON_DW_HDMI
 	help
 	  Select Y or M to add support for the AXG SoC sound card
@@ -135,4 +137,18 @@ config SND_SOC_MESON_T9015
 	help
 	  Say Y or M if you want to add support for the internal DAC found
 	  on GXL, G12 and SM1 SoC family.
+
+config SND_SOC_MESON_PAD_OUT
+	tristate "Amlogic PAD OUT"
+	select REGMAP_MMIO
+	help
+	  Say Y or M if you want to add support for the S4 Audio Output from
+	  the data Pad.
+
+config SND_SOC_MESON_TOCODEC_CONTROL
+	tristate "Amlogic TOCODEC CONTROL"
+	select REGMAP_MMIO
+	help
+	 Say Y or M if you want to add support for the internal DAC control
+	 on SM1 SoC family.
 endmenu
diff --git a/sound/soc/meson/Makefile b/sound/soc/meson/Makefile
index 24078e4396b02d545d8ba4bcb1632979001354e3..afbefcb1313670f9b1365e88b8eb1a0badd7dc1e 100644
--- a/sound/soc/meson/Makefile
+++ b/sound/soc/meson/Makefile
@@ -24,8 +24,11 @@ snd-soc-meson-codec-glue-y := meson-codec-glue.o
 snd-soc-meson-gx-sound-card-y := gx-card.o
 snd-soc-meson-g12a-toacodec-y := g12a-toacodec.o
 snd-soc-meson-g12a-tohdmitx-y := g12a-tohdmitx.o
+snd-soc-meson-s4-padout-objs := s4-pad-out-control.o
+snd-soc-meson-s4-tocodec-control-objs := s4-tocodec-control.o
 snd-soc-meson-t9015-y := t9015.o
 
+
 obj-$(CONFIG_SND_MESON_AIU) += snd-soc-meson-aiu.o
 obj-$(CONFIG_SND_MESON_AXG_FIFO) += snd-soc-meson-axg-fifo.o
 obj-$(CONFIG_SND_MESON_AXG_FRDDR) += snd-soc-meson-axg-frddr.o
@@ -43,4 +46,7 @@ obj-$(CONFIG_SND_MESON_CODEC_GLUE) += snd-soc-meson-codec-glue.o
 obj-$(CONFIG_SND_MESON_GX_SOUND_CARD) += snd-soc-meson-gx-sound-card.o
 obj-$(CONFIG_SND_MESON_G12A_TOACODEC) += snd-soc-meson-g12a-toacodec.o
 obj-$(CONFIG_SND_MESON_G12A_TOHDMITX) += snd-soc-meson-g12a-tohdmitx.o
+obj-$(CONFIG_SND_SOC_MESON_PAD_OUT) += snd-soc-meson-s4-padout.o
+obj-$(CONFIG_SND_SOC_MESON_TOCODEC_CONTROL) += snd-soc-meson-s4-tocodec-control.o
 obj-$(CONFIG_SND_SOC_MESON_T9015) += snd-soc-meson-t9015.o
+
diff --git a/sound/soc/meson/s4-pad-out-control.c b/sound/soc/meson/s4-pad-out-control.c
new file mode 100644
index 0000000000000000000000000000000000000000..a86dcf8a5995926f0ddf8d2911f42006daed0feb
--- /dev/null
+++ b/sound/soc/meson/s4-pad-out-control.c
@@ -0,0 +1,372 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+/*
+ * Copyright (C) 2024 Amlogic, Inc. All rights reserved
+ */
+
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/regmap.h>
+#include <sound/soc.h>
+#include <sound/soc-dai.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include<linux/kstrtox.h>
+
+#include "axg-tdm.h"
+
+static const struct regmap_config tdmout_pad_regmap_cfg = {
+	.reg_bits	= 32,
+	.val_bits	= 32,
+	.reg_stride	= 4,
+	.max_register	= 0x28,
+};
+
+#define TDM_IFACE 0
+#define TDM_A_PAD 0
+#define TDM_B_PAD 1
+#define TDM_C_PAD 2
+
+#define EE_AUDIO_DAT_PAD_CTRL6 0x0
+#define EE_AUDIO_DAT_PAD_CTRL7 0x4
+#define EE_AUDIO_DAT_PAD_CTRL8 0x8
+#define EE_AUDIO_DAT_PAD_CTRL9 0xc
+#define EE_AUDIO_DAT_PAD_CTRLA 0x10
+#define EE_AUDIO_DAT_PAD_CTRLB 0x14
+#define EE_AUDIO_DAT_PAD_CTRLC 0x1c
+#define EE_AUDIO_DAT_PAD_CTRLD 0x20
+#define EE_AUDIO_DAT_PAD_CTRLE 0x24
+#define EE_AUDIO_DAT_PAD_CTRLF 0x28
+
+#define REG_OFFSET 4
+
+static const char * const s4_tdmout_sel_texts[] = {
+	"TDM_D0", "TDM_D1", "TDM_D2", "TDM_D3", "TDM_D4", "TDM_D5", "TDM_D6", "TDM_D7",
+	"TDM_D8", "TDM_D9", "TDM_D10", "TDM_D11", "TDM_D12", "TDM_D13", "TDM_D14", "TDM_D15",
+	"TDM_D16", "TDM_D17", "TDM_D18", "TDM_D19", "TDM_D20", "TDM_D21", "TDM_D22", "TDM_D23",
+	"TDM_D24", "TDM_D25", "TDM_D26", "TDM_D27", "TDM_D28", "TDM_D29", "TDM_D30", "TDM_D31"
+};
+
+static const struct soc_enum tdmout_sel_enum =
+	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tdmout_sel_texts),
+			s4_tdmout_sel_texts);
+
+static struct snd_soc_dai *tdm_get_ahead_be(struct snd_soc_dapm_widget *w)
+{
+	struct snd_soc_dapm_path *p;
+	struct snd_soc_dai *be;
+
+	snd_soc_dapm_widget_for_each_source_path(w, p) {
+		if (p->source->id == snd_soc_dapm_dai_in)
+			return (struct snd_soc_dai *)p->source->priv;
+		be = tdm_get_ahead_be(p->source);
+		if (be && be->id == TDM_IFACE)
+			return be;
+	}
+	return NULL;
+}
+
+#define SND_SOC_DAPM_DEMUX_E(wname, wreg, wshift, winvert, wcontrols, \
+	wevent, wflags) \
+((struct snd_soc_dapm_widget) { \
+	.id = snd_soc_dapm_demux, .name = wname, \
+	SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
+	.kcontrol_news = wcontrols, .num_kcontrols = 1, \
+	.event = wevent, .event_flags = wflags})
+
+static const struct snd_kcontrol_new tdmout_sel_demux[] = {
+	SOC_DAPM_ENUM("TDMOUTA SEL", tdmout_sel_enum),
+	SOC_DAPM_ENUM("TDMOUTB SEL", tdmout_sel_enum),
+	SOC_DAPM_ENUM("TDMOUTC SEL", tdmout_sel_enum),
+};
+
+static unsigned int aml_simple_strtoull(const char *cp)
+{
+	unsigned int result = 0;
+	unsigned int value = 0;
+	unsigned int len =  strlen(cp);
+
+	while (len != 0) {
+		len--;
+		value = isdigit(*cp);
+		if (value) {
+			value = *cp - '0';
+		} else {
+			cp++;
+			continue;
+		}
+		cp++;
+		result = result * 10 + value;
+	}
+	return result;
+}
+
+static int tdm_out_pad_set(struct snd_soc_dapm_widget *w)
+{
+	struct snd_soc_dai *be;
+	struct axg_tdm_stream *stream;
+	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+	unsigned int tdm_id = TDM_A_PAD;
+	const char *dai_widget_name;
+	struct snd_soc_dapm_path *p;
+	unsigned int lane_num = 0;
+	unsigned long pin = 0;
+	unsigned int reg, mask, val = 0;
+	int lane_cnt;
+
+	be = tdm_get_ahead_be(w);
+	if (!be) {
+		dev_err(component->dev, "%s not find the be\n", __func__);
+		return -EINVAL;
+	}
+	stream = snd_soc_dai_dma_data_get_playback(be);
+	if (!stream) {
+		dev_err(component->dev, "%s not find the stream\n", __func__);
+		return -EINVAL;
+	}
+	lane_cnt = (stream->channels - 1) / stream->iface->slots + 1;
+	/*we like to use dai id, but it is fixed val*/
+	dai_widget_name = be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
+	if (strstr(dai_widget_name, "TDM_A"))
+		tdm_id = TDM_A_PAD;
+	else if (strstr(dai_widget_name, "TDM_B"))
+		tdm_id = TDM_B_PAD;
+	else if (strstr(dai_widget_name, "TDM_C"))
+		tdm_id = TDM_C_PAD;
+	else
+		dev_err(component->dev, "%s not find the be dai widget\n", __func__);
+	dev_dbg(component->dev, "tdm_id:%d, channel:%d, slot:%d\n",
+		tdm_id, stream->channels, stream->iface->slots);
+	snd_soc_dapm_widget_for_each_sink_path(w, p) {
+		if (p->sink->id == snd_soc_dapm_output) {
+			if (p->connect) {
+				pin = aml_simple_strtoull(p->name);
+				reg = (pin / 4) * REG_OFFSET;
+				/*calculate mask pos */
+				mask = 0x1f << ((pin % 4) * 8);
+				val = tdm_id * 8 + lane_num;
+				snd_soc_component_update_bits(component, reg, mask, val);
+				snd_soc_component_update_bits(component, EE_AUDIO_DAT_PAD_CTRLF,
+							      0x1 << pin, 0 << pin);
+				lane_num++;
+				if (lane_num > lane_cnt - 1)
+					break;
+			}
+		}
+	}
+	return 0;
+}
+
+static int tdmout_sel_pad_event(struct snd_soc_dapm_widget *w,
+				struct snd_kcontrol *control,
+				int event)
+{
+	int ret = 0;
+	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+
+	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		tdm_out_pad_set(w);
+		break;
+
+	case SND_SOC_DAPM_PRE_PMD:
+		break;
+
+	default:
+		dev_err(component->dev, "Unexpected event %d\n", event);
+		return -EINVAL;
+	}
+
+	return ret;
+}
+
+static const struct snd_soc_dapm_widget s4_tdmout_pad_dapm_widgets[] = {
+	SND_SOC_DAPM_DEMUX_E("TDMA_OUT SEL", SND_SOC_NOPM, 0, 0,
+			     &tdmout_sel_demux[TDM_A_PAD], tdmout_sel_pad_event,
+			   (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
+	SND_SOC_DAPM_DEMUX_E("TDMB_OUT SEL", SND_SOC_NOPM, 0, 0,
+			     &tdmout_sel_demux[TDM_B_PAD], tdmout_sel_pad_event,
+			   (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
+	SND_SOC_DAPM_DEMUX_E("TDMC_OUT SEL", SND_SOC_NOPM, 0, 0,
+			     &tdmout_sel_demux[TDM_C_PAD], tdmout_sel_pad_event,
+			   (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
+	SND_SOC_DAPM_OUTPUT("TDM_D0"),
+	SND_SOC_DAPM_OUTPUT("TDM_D1"),
+	SND_SOC_DAPM_OUTPUT("TDM_D2"),
+	SND_SOC_DAPM_OUTPUT("TDM_D3"),
+	SND_SOC_DAPM_OUTPUT("TDM_D4"),
+	SND_SOC_DAPM_OUTPUT("TDM_D5"),
+	SND_SOC_DAPM_OUTPUT("TDM_D6"),
+	SND_SOC_DAPM_OUTPUT("TDM_D7"),
+	SND_SOC_DAPM_OUTPUT("TDM_D8"),
+	SND_SOC_DAPM_OUTPUT("TDM_D9"),
+	SND_SOC_DAPM_OUTPUT("TDM_D10"),
+	SND_SOC_DAPM_OUTPUT("TDM_D11"),
+	SND_SOC_DAPM_OUTPUT("TDM_D12"),
+	SND_SOC_DAPM_OUTPUT("TDM_D13"),
+	SND_SOC_DAPM_OUTPUT("TDM_D14"),
+	SND_SOC_DAPM_OUTPUT("TDM_D15"),
+	SND_SOC_DAPM_OUTPUT("TDM_D16"),
+	SND_SOC_DAPM_OUTPUT("TDM_D17"),
+	SND_SOC_DAPM_OUTPUT("TDM_D18"),
+	SND_SOC_DAPM_OUTPUT("TDM_D19"),
+	SND_SOC_DAPM_OUTPUT("TDM_D20"),
+	SND_SOC_DAPM_OUTPUT("TDM_D21"),
+	SND_SOC_DAPM_OUTPUT("TDM_D22"),
+	SND_SOC_DAPM_OUTPUT("TDM_D23"),
+	SND_SOC_DAPM_OUTPUT("TDM_D24"),
+	SND_SOC_DAPM_OUTPUT("TDM_D25"),
+	SND_SOC_DAPM_OUTPUT("TDM_D26"),
+	SND_SOC_DAPM_OUTPUT("TDM_D27"),
+	SND_SOC_DAPM_OUTPUT("TDM_D28"),
+	SND_SOC_DAPM_OUTPUT("TDM_D29"),
+	SND_SOC_DAPM_OUTPUT("TDM_D30"),
+	SND_SOC_DAPM_OUTPUT("TDM_D31"),
+};
+
+static const struct snd_soc_dapm_route s4_tdmout_pad_dapm_routes[] = {
+	{ "TDM_D0", "TDM_D0", "TDMA_OUT SEL" },
+	{ "TDM_D1", "TDM_D1", "TDMA_OUT SEL" },
+	{ "TDM_D2", "TDM_D2", "TDMA_OUT SEL" },
+	{ "TDM_D3", "TDM_D3", "TDMA_OUT SEL" },
+	{ "TDM_D4", "TDM_D4", "TDMA_OUT SEL" },
+	{ "TDM_D5", "TDM_D5", "TDMA_OUT SEL" },
+	{ "TDM_D6", "TDM_D6", "TDMA_OUT SEL" },
+	{ "TDM_D7", "TDM_D7", "TDMA_OUT SEL" },
+	{ "TDM_D8", "TDM_D8", "TDMA_OUT SEL" },
+	{ "TDM_D9", "TDM_D9", "TDMA_OUT SEL" },
+	{ "TDM_D10", "TDM_D10", "TDMA_OUT SEL" },
+	{ "TDM_D11", "TDM_D11", "TDMA_OUT SEL" },
+	{ "TDM_D12", "TDM_D12", "TDMA_OUT SEL" },
+	{ "TDM_D13", "TDM_D13", "TDMA_OUT SEL" },
+	{ "TDM_D14", "TDM_D14", "TDMA_OUT SEL" },
+	{ "TDM_D15", "TDM_D15", "TDMA_OUT SEL" },
+	{ "TDM_D16", "TDM_D16", "TDMA_OUT SEL" },
+	{ "TDM_D17", "TDM_D17", "TDMA_OUT SEL" },
+	{ "TDM_D18", "TDM_D18", "TDMA_OUT SEL" },
+	{ "TDM_D19", "TDM_D19", "TDMA_OUT SEL" },
+	{ "TDM_D20", "TDM_D20", "TDMA_OUT SEL" },
+	{ "TDM_D21", "TDM_D21", "TDMA_OUT SEL" },
+	{ "TDM_D22", "TDM_D22", "TDMA_OUT SEL" },
+	{ "TDM_D23", "TDM_D23", "TDMA_OUT SEL" },
+	{ "TDM_D24", "TDM_D24", "TDMA_OUT SEL" },
+	{ "TDM_D25", "TDM_D25", "TDMA_OUT SEL" },
+	{ "TDM_D26", "TDM_D26", "TDMA_OUT SEL" },
+	{ "TDM_D27", "TDM_D27", "TDMA_OUT SEL" },
+	{ "TDM_D28", "TDM_D28", "TDMA_OUT SEL" },
+	{ "TDM_D29", "TDM_D29", "TDMA_OUT SEL" },
+	{ "TDM_D30", "TDM_D30", "TDMA_OUT SEL" },
+	{ "TDM_D31", "TDM_D31", "TDMA_OUT SEL" },
+	{ "TDM_D0", "TDM_D0", "TDMB_OUT SEL" },
+	{ "TDM_D1", "TDM_D1", "TDMB_OUT SEL" },
+	{ "TDM_D2", "TDM_D2", "TDMB_OUT SEL" },
+	{ "TDM_D3", "TDM_D3", "TDMB_OUT SEL" },
+	{ "TDM_D4", "TDM_D4", "TDMB_OUT SEL" },
+	{ "TDM_D5", "TDM_D5", "TDMB_OUT SEL" },
+	{ "TDM_D6", "TDM_D6", "TDMB_OUT SEL" },
+	{ "TDM_D7", "TDM_D7", "TDMB_OUT SEL" },
+	{ "TDM_D8", "TDM_D8", "TDMB_OUT SEL" },
+	{ "TDM_D9", "TDM_D9", "TDMB_OUT SEL" },
+	{ "TDM_D10", "TDM_D10", "TDMB_OUT SEL" },
+	{ "TDM_D11", "TDM_D11", "TDMB_OUT SEL" },
+	{ "TDM_D12", "TDM_D12", "TDMB_OUT SEL" },
+	{ "TDM_D13", "TDM_D13", "TDMB_OUT SEL" },
+	{ "TDM_D14", "TDM_D14", "TDMB_OUT SEL" },
+	{ "TDM_D15", "TDM_D15", "TDMB_OUT SEL" },
+
+	{ "TDM_D16", "TDM_D16", "TDMB_OUT SEL" },
+	{ "TDM_D17", "TDM_D17", "TDMB_OUT SEL" },
+	{ "TDM_D18", "TDM_D18", "TDMB_OUT SEL" },
+	{ "TDM_D19", "TDM_D19", "TDMB_OUT SEL" },
+	{ "TDM_D20", "TDM_D20", "TDMB_OUT SEL" },
+	{ "TDM_D21", "TDM_D21", "TDMB_OUT SEL" },
+	{ "TDM_D22", "TDM_D22", "TDMB_OUT SEL" },
+	{ "TDM_D23", "TDM_D23", "TDMB_OUT SEL" },
+	{ "TDM_D24", "TDM_D24", "TDMB_OUT SEL" },
+	{ "TDM_D25", "TDM_D25", "TDMB_OUT SEL" },
+	{ "TDM_D26", "TDM_D26", "TDMB_OUT SEL" },
+	{ "TDM_D27", "TDM_D27", "TDMB_OUT SEL" },
+	{ "TDM_D28", "TDM_D28", "TDMB_OUT SEL" },
+	{ "TDM_D29", "TDM_D29", "TDMB_OUT SEL" },
+	{ "TDM_D30", "TDM_D30", "TDMB_OUT SEL" },
+	{ "TDM_D31", "TDM_D31", "TDMB_OUT SEL" },
+	{ "TDM_D0", "TDM_D0", "TDMC_OUT SEL" },
+	{ "TDM_D1", "TDM_D1", "TDMC_OUT SEL" },
+	{ "TDM_D2", "TDM_D2", "TDMC_OUT SEL" },
+	{ "TDM_D3", "TDM_D3", "TDMC_OUT SEL" },
+	{ "TDM_D4", "TDM_D4", "TDMC_OUT SEL" },
+	{ "TDM_D5", "TDM_D5", "TDMC_OUT SEL" },
+	{ "TDM_D6", "TDM_D6", "TDMC_OUT SEL" },
+	{ "TDM_D7", "TDM_D7", "TDMC_OUT SEL" },
+	{ "TDM_D8", "TDM_D8", "TDMC_OUT SEL" },
+	{ "TDM_D9", "TDM_D9", "TDMC_OUT SEL" },
+	{ "TDM_D10", "TDM_D10", "TDMC_OUT SEL" },
+	{ "TDM_D11", "TDM_D11", "TDMC_OUT SEL" },
+	{ "TDM_D12", "TDM_D12", "TDMC_OUT SEL" },
+	{ "TDM_D13", "TDM_D13", "TDMC_OUT SEL" },
+	{ "TDM_D14", "TDM_D14", "TDMC_OUT SEL" },
+	{ "TDM_D15", "TDM_D15", "TDMC_OUT SEL" },
+	{ "TDM_D16", "TDM_D16", "TDMC_OUT SEL" },
+	{ "TDM_D17", "TDM_D17", "TDMC_OUT SEL" },
+	{ "TDM_D18", "TDM_D18", "TDMC_OUT SEL" },
+	{ "TDM_D19", "TDM_D19", "TDMC_OUT SEL" },
+	{ "TDM_D20", "TDM_D20", "TDMC_OUT SEL" },
+	{ "TDM_D21", "TDM_D21", "TDMC_OUT SEL" },
+	{ "TDM_D22", "TDM_D22", "TDMC_OUT SEL" },
+	{ "TDM_D23", "TDM_D23", "TDMC_OUT SEL" },
+	{ "TDM_D24", "TDM_D24", "TDMC_OUT SEL" },
+	{ "TDM_D25", "TDM_D25", "TDMC_OUT SEL" },
+	{ "TDM_D26", "TDM_D26", "TDMC_OUT SEL" },
+	{ "TDM_D27", "TDM_D27", "TDMC_OUT SEL" },
+	{ "TDM_D28", "TDM_D28", "TDMC_OUT SEL" },
+	{ "TDM_D29", "TDM_D29", "TDMC_OUT SEL" },
+	{ "TDM_D30", "TDM_D30", "TDMC_OUT SEL" },
+	{ "TDM_D31", "TDM_D31", "TDMC_OUT SEL" },
+};
+
+static const struct snd_soc_component_driver s4_tdmout_pad_component_drv = {
+	.dapm_widgets		= s4_tdmout_pad_dapm_widgets,
+	.num_dapm_widgets	= ARRAY_SIZE(s4_tdmout_pad_dapm_widgets),
+	.dapm_routes		= s4_tdmout_pad_dapm_routes,
+	.num_dapm_routes	= ARRAY_SIZE(s4_tdmout_pad_dapm_routes),
+
+};
+
+static const struct of_device_id s4_tdmout_pad_of_match[] = {
+	{
+		.compatible = "amlogic,s4-tdmout-pad",
+	}, {}
+};
+
+MODULE_DEVICE_TABLE(of, s4_tdmout_pad_of_match);
+
+static int tdm_pad_out_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct regmap *map;
+	void __iomem *regs;
+
+	regs = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(regs))
+		return PTR_ERR(regs);
+
+	map = devm_regmap_init_mmio(dev, regs, &tdmout_pad_regmap_cfg);
+	if (IS_ERR(map))
+		return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap\n");
+
+	return devm_snd_soc_register_component(dev, &s4_tdmout_pad_component_drv,
+					       NULL, 0);
+}
+
+static struct platform_driver tdmout_pad_pdrv = {
+	.probe = tdm_pad_out_probe,
+	.driver = {
+		.name = "s4-pad-out",
+		.of_match_table = s4_tdmout_pad_of_match,
+	},
+};
+
+module_platform_driver(tdmout_pad_pdrv);
+
+MODULE_DESCRIPTION("Amlogic TDM PAD DRIVER");
+MODULE_AUTHOR("jiebing.chen@amlogic.com");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/meson/s4-tocodec-control.c b/sound/soc/meson/s4-tocodec-control.c
new file mode 100644
index 0000000000000000000000000000000000000000..e5d824fae0eba545d38dc36e2566e7cee590e7f5
--- /dev/null
+++ b/sound/soc/meson/s4-tocodec-control.c
@@ -0,0 +1,376 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+/*
+ * Copyright (C) 2023 Amlogic, Inc. All rights reserved
+ */
+
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/regmap.h>
+#include <sound/soc.h>
+#include <sound/soc-dai.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include<linux/kstrtox.h>
+#include <linux/clk-provider.h>
+#include <linux/reset.h>
+#include "axg-tdm.h"
+
+#define TOACODEC_CTRL0			0x0
+
+#define CTRL0_ENABLE_SHIFT		31
+#define CTRL0_BCLK_ENABLE_SHIFT		30
+#define CTRL0_MCLK_ENABLE_SHIFT		29
+#define CTRL0_BLK_CAP_INV_SHIFT		9
+
+#define TDM_IFACE 0
+#define TDM_A_PAD 0
+#define TDM_B_PAD 1
+#define TDM_C_PAD 2
+
+struct toacodec {
+	struct regmap_field *field_dat_sel;
+	struct regmap_field *field_lrclk_sel;
+	struct regmap_field *field_bclk_sel;
+	struct regmap_field *field_mclk_sel;
+};
+
+struct toacodec_match_data {
+	const struct snd_soc_component_driver *component_drv;
+	const struct reg_field field_dat_sel;
+	const struct reg_field field_lrclk_sel;
+	const struct reg_field field_bclk_sel;
+	const struct reg_field field_mclk_sel;
+};
+
+static const struct regmap_config tocodec_regmap_cfg = {
+	.reg_bits	= 32,
+	.val_bits	= 32,
+	.reg_stride	= 4,
+	.max_register	= 0x1,
+};
+
+#define S4_LANE_OFFSET 8
+
+static const char * const s4_tocodec_lane_sel_texts[] = {
+	"Lane0", "Lane1", "Lane2", "Lane3", "Lane4", "Lane5", "Lane6", "Lane7"
+};
+
+static const struct soc_enum s4_tocodec_lane_sel_enum =
+	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_lane_sel_texts),
+			s4_tocodec_lane_sel_texts);
+
+static const struct snd_kcontrol_new s4_tocodec_lane_sel =
+	SOC_DAPM_ENUM("TOCODEC LANE SEL", s4_tocodec_lane_sel_enum);
+
+static const char * const s4_tocodec_src_sel_texts[] = {
+	"TDMA", "TDMB", "TDMC"
+};
+
+static const struct soc_enum s4_tocodec_src_sel_enum =
+	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_src_sel_texts),
+			s4_tocodec_src_sel_texts);
+
+static const struct snd_kcontrol_new s4_tocodec_src_sel =
+	SOC_DAPM_ENUM("TOCODEC SEL", s4_tocodec_src_sel_enum);
+
+static const struct snd_kcontrol_new s4_toacodec_out_enable =
+	SOC_DAPM_SINGLE_AUTODISABLE("Switch", TOACODEC_CTRL0,
+				    CTRL0_ENABLE_SHIFT, 1, 0);
+
+static struct snd_soc_dai *tocodec_tdm_get_ahead_be(struct snd_soc_dapm_widget *w)
+{
+	struct snd_soc_dapm_path *p;
+	struct snd_soc_dai *be;
+
+	snd_soc_dapm_widget_for_each_source_path(w, p) {
+		if (!p->connect)
+			continue;
+		if (p->source->id == snd_soc_dapm_dai_in)
+			return (struct snd_soc_dai *)p->source->priv;
+		be = tocodec_tdm_get_ahead_be(p->source);
+		if (be && be->id == TDM_IFACE)
+			return be;
+	}
+	return NULL;
+}
+
+static unsigned int aml_simple_strtoull(const char *cp)
+{
+	unsigned int result = 0;
+	unsigned int value = 0;
+	unsigned int len = strlen(cp);
+
+	while (len != 0) {
+		len--;
+		value = isdigit(*cp);
+		if (value) {
+			value = *cp - '0';
+		} else {
+			cp++;
+			continue;
+		}
+		cp++;
+		result = result * 10 + value;
+	}
+	return result;
+}
+
+static int aml_get_clk_id(const char *name)
+{
+	int clk_id = 0;
+
+	if (strstr(name, "mst_a"))
+		clk_id = 0;
+	else if (strstr(name, "mst_b"))
+		clk_id = 1;
+	else if (strstr(name, "mst_c"))
+		clk_id = 2;
+	else if (strstr(name, "mst_d"))
+		clk_id = 3;
+	else if (strstr(name, "mst_e"))
+		clk_id = 4;
+	else if (strstr(name, "mst_f"))
+		clk_id = 5;
+
+	return clk_id;
+}
+
+static int aml_tocodec_sel_set(struct snd_soc_dapm_widget *w)
+{
+	struct snd_soc_dai *be;
+	struct axg_tdm_stream *stream;
+	struct axg_tdm_iface *iface;
+	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+	struct toacodec *priv = snd_soc_component_get_drvdata(component);
+	unsigned int tdm_id = TDM_A_PAD;
+	const char *dai_widget_name;
+	struct snd_soc_dapm_path *p;
+	unsigned int lane = 0;
+	unsigned int val = 0;
+	struct clk *sclk, *mclk;
+	char *clk_name;
+	int mclk_id, sclk_id;
+
+	be = tocodec_tdm_get_ahead_be(w);
+	if (!be) {
+		dev_err(component->dev, "%s not find the be\n", __func__);
+		return -EINVAL;
+	}
+	stream = snd_soc_dai_dma_data_get_playback(be);
+	if (!stream) {
+		dev_err(component->dev, "%s not find the stream\n", __func__);
+		return -EINVAL;
+	}
+	/*we like to use dai id, but it is fixed val*/
+	dai_widget_name = be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
+	if (strstr(dai_widget_name, "TDM_A"))
+		tdm_id = TDM_A_PAD;
+	else if (strstr(dai_widget_name, "TDM_B"))
+		tdm_id = TDM_B_PAD;
+	else if (strstr(dai_widget_name, "TDM_C"))
+		tdm_id = TDM_C_PAD;
+	snd_soc_dapm_widget_for_each_source_path(w, p) {
+		if (p->connect && p->name) {
+			lane = aml_simple_strtoull(p->name);
+			val = lane + tdm_id * S4_LANE_OFFSET;
+			regmap_field_write(priv->field_dat_sel, val);
+		}
+	}
+	iface = stream->iface;
+	mclk = iface->mclk;
+	sclk = iface->sclk;
+	mclk_id = aml_get_clk_id(__clk_get_name(mclk));
+	sclk_id = aml_get_clk_id(__clk_get_name(sclk));
+	regmap_field_write(priv->field_mclk_sel, mclk_id);
+	regmap_field_write(priv->field_bclk_sel, sclk_id);
+	regmap_field_write(priv->field_lrclk_sel, sclk_id);
+
+	return 0;
+}
+
+static int tocodec_sel_event(struct snd_soc_dapm_widget *w,
+			     struct snd_kcontrol *control,
+			     int event)
+{
+	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+	int ret = 0;
+
+	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		ret = aml_tocodec_sel_set(w);
+		break;
+
+	case SND_SOC_DAPM_PRE_PMD:
+		break;
+
+	default:
+		dev_err(component->dev, "Unexpected event %d\n", event);
+		return -EINVAL;
+	}
+
+	return ret;
+}
+
+static int tocodec_clk_enable(struct snd_soc_dapm_widget *w,
+			      struct snd_kcontrol *control,
+			      int event)
+{
+	int ret = 0;
+	unsigned int mask = 0, val = 0;
+	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
+
+	snd_soc_component_update_bits(component, TOACODEC_CTRL0,
+				      1 << CTRL0_BLK_CAP_INV_SHIFT, 1 << CTRL0_BLK_CAP_INV_SHIFT);
+	switch (event) {
+	case SND_SOC_DAPM_PRE_PMU:
+		mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
+		val = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
+		snd_soc_component_update_bits(component, TOACODEC_CTRL0, mask, val);
+		break;
+	case SND_SOC_DAPM_PRE_PMD:
+		mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
+		val = 0 << CTRL0_MCLK_ENABLE_SHIFT | 0 << CTRL0_BCLK_ENABLE_SHIFT;
+		snd_soc_component_update_bits(component, TOACODEC_CTRL0, mask, val);
+		break;
+	default:
+		dev_err(component->dev, "Unexpected event %d\n", event);
+		return -EINVAL;
+	}
+
+	return ret;
+}
+
+static const struct snd_soc_dapm_widget s4_toacodec_widgets[] = {
+	SND_SOC_DAPM_MUX_E("Lane SRC", SND_SOC_NOPM, 0, 0,
+			   &s4_tocodec_lane_sel, tocodec_sel_event,
+			   (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
+	SND_SOC_DAPM_MUX("INPUT SRC", SND_SOC_NOPM, 0, 0, &s4_tocodec_src_sel),
+	SND_SOC_DAPM_SWITCH_E("OUT EN", SND_SOC_NOPM, 0, 0,
+			      &s4_toacodec_out_enable, tocodec_clk_enable,
+				(SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
+	SND_SOC_DAPM_AIF_IN("TDMA", NULL, 0, SND_SOC_NOPM, 0, 0),
+	SND_SOC_DAPM_AIF_IN("TDMB", NULL, 0, SND_SOC_NOPM, 0, 0),
+	SND_SOC_DAPM_AIF_IN("TDMC", NULL, 0, SND_SOC_NOPM, 0, 0),
+	SND_SOC_DAPM_OUT_DRV("Lane0", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_OUT_DRV("Lane1", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_OUT_DRV("Lane2", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_OUT_DRV("Lane3", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_OUT_DRV("Lane4", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_OUT_DRV("Lane5", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_OUT_DRV("Lane6", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_OUT_DRV("Lane7", SND_SOC_NOPM, 0, 0, NULL, 0),
+	SND_SOC_DAPM_OUTPUT("TDM_TO_ACODEC"),
+};
+
+static const struct snd_soc_dapm_route s4_tocodec_dapm_routes[] = {
+	{ "INPUT SRC", "TDMA", "TDMA"},
+	{ "INPUT SRC", "TDMB", "TDMB"},
+	{ "INPUT SRC", "TDMC", "TDMC"},
+	{ "Lane0", NULL, "INPUT SRC" },
+	{ "Lane1", NULL, "INPUT SRC"},
+	{ "Lane2", NULL, "INPUT SRC"},
+	{ "Lane3", NULL, "INPUT SRC"},
+	{ "Lane4", NULL, "INPUT SRC"},
+	{ "Lane5", NULL, "INPUT SRC"},
+	{ "Lane6", NULL, "INPUT SRC"},
+	{ "Lane7", NULL, "INPUT SRC"},
+	{ "Lane SRC", "Lane0", "Lane0"},
+	{ "Lane SRC", "Lane1", "Lane1"},
+	{ "Lane SRC", "Lane2", "Lane2"},
+	{ "Lane SRC", "Lane3", "Lane3"},
+	{ "Lane SRC", "Lane4", "Lane4"},
+	{ "Lane SRC", "Lane5", "Lane5"},
+	{ "Lane SRC", "Lane6", "Lane6"},
+	{ "Lane SRC", "Lane7", "Lane7"},
+	{ "OUT EN", "Switch", "Lane SRC"},
+	{ "TDM_TO_ACODEC", NULL, "OUT EN"},
+
+};
+
+static const struct snd_soc_component_driver s4_tocodec_component_drv = {
+	.dapm_widgets		= s4_toacodec_widgets,
+	.num_dapm_widgets	= ARRAY_SIZE(s4_toacodec_widgets),
+	.dapm_routes		= s4_tocodec_dapm_routes,
+	.num_dapm_routes	= ARRAY_SIZE(s4_tocodec_dapm_routes),
+};
+
+static const struct toacodec_match_data s4_toacodec_match_data = {
+	.component_drv	= &s4_tocodec_component_drv,
+	.field_dat_sel	= REG_FIELD(TOACODEC_CTRL0, 16, 20),
+	.field_lrclk_sel = REG_FIELD(TOACODEC_CTRL0, 12, 14),
+	.field_bclk_sel	= REG_FIELD(TOACODEC_CTRL0, 4, 6),
+	.field_mclk_sel	= REG_FIELD(TOACODEC_CTRL0, 0, 2),
+};
+
+static const struct of_device_id s4_tocodec_of_match[] = {
+	{
+		.compatible = "amlogic,s4-tocodec",
+		.data = &s4_toacodec_match_data,
+	}, {}
+};
+
+MODULE_DEVICE_TABLE(of, s4_tocodec_of_match);
+
+static int tocodec_probe(struct platform_device *pdev)
+{
+	const struct toacodec_match_data *data;
+	struct device *dev = &pdev->dev;
+	struct toacodec *priv;
+	void __iomem *regs;
+	struct regmap *map;
+	int ret;
+
+	data = device_get_match_data(dev);
+	if (!data)
+		return dev_err_probe(dev, -ENODEV, "failed to match device\n");
+	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	platform_set_drvdata(pdev, priv);
+
+	ret = device_reset(dev);
+	if (ret)
+		return ret;
+
+	regs = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(regs))
+		return PTR_ERR(regs);
+
+	map = devm_regmap_init_mmio(dev, regs, &tocodec_regmap_cfg);
+	if (IS_ERR(map))
+		return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap\n");
+
+	priv->field_dat_sel = devm_regmap_field_alloc(dev, map, data->field_dat_sel);
+	if (IS_ERR(priv->field_dat_sel))
+		return PTR_ERR(priv->field_dat_sel);
+
+	priv->field_lrclk_sel = devm_regmap_field_alloc(dev, map, data->field_lrclk_sel);
+	if (IS_ERR(priv->field_lrclk_sel))
+		return PTR_ERR(priv->field_lrclk_sel);
+
+	priv->field_bclk_sel = devm_regmap_field_alloc(dev, map, data->field_bclk_sel);
+	if (IS_ERR(priv->field_bclk_sel))
+		return PTR_ERR(priv->field_bclk_sel);
+
+	priv->field_mclk_sel = devm_regmap_field_alloc(dev, map, data->field_mclk_sel);
+	if (IS_ERR(priv->field_mclk_sel))
+		return PTR_ERR(priv->field_mclk_sel);
+
+	return devm_snd_soc_register_component(dev,
+			data->component_drv, NULL, 0);
+}
+
+static struct platform_driver tocodec_pdrv = {
+	.probe = tocodec_probe,
+	.driver = {
+		.name = "s4-tocodec",
+		.of_match_table = s4_tocodec_of_match,
+	},
+};
+
+module_platform_driver(tocodec_pdrv);
+
+MODULE_DESCRIPTION("Amlogic to codec driver");
+MODULE_AUTHOR("jiebing.chen@amlogic.com");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
index 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648 100644
--- a/sound/soc/meson/t9015.c
+++ b/sound/soc/meson/t9015.c
@@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
 		.channels_min = 1,
 		.channels_max = 2,
 		.rates = SNDRV_PCM_RATE_8000_96000,
-		.formats = (SNDRV_PCM_FMTBIT_S8 |
-			    SNDRV_PCM_FMTBIT_S16_LE |
-			    SNDRV_PCM_FMTBIT_S20_LE |
-			    SNDRV_PCM_FMTBIT_S24_LE),
+		.formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE),
 	},
 	.ops = &t9015_dai_ops,
 };

-- 
2.43.0



From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
	(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 A4B8D28FD;
	Mon, 13 Jan 2025 07:19:57 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736752797; cv=none; b=BGxVtUBL4oZaY+yBfOI9/NX+GAczC5JJSwjSPGlwKOOlDHrDiay60vz7lmZPe2pcLQtXppOpuxQx0Fer4HLP3SHzBkao5SYPF0MUHw2+gFCjwM6wkLNIcCfvvVR6zn0prcuLQdH0dam0peAwITkmHOEUapC1wvDjDujavWO2NX8=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736752797; c=relaxed/simple;
	bh=MYJh3nER0YHHitikyQndEMbpoJyhZPDW6g9Dil0vlRY=;
	h=Date:Content-Type:MIME-Version:From:Cc:To:In-Reply-To:References:
	 Message-Id:Subject; b=Qy0m4JS89y+I51EKrcUJ/ILrhXgq5HwL1LHcPk+WrhJdkKvRLR6DD5OXUXIkfk/ycPo/qSVyUtLVo7ayCjpAZvUYO8DOY7EVSJyI7MtMY+bbiN2rTnm43a/nSKy9m9zI/Y5jC5ixbc/zoLDo7qHZ7amFHya+oUftxGfYW98BO+8=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mjKFkpRj; arc=none smtp.client-ip=10.30.226.201
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mjKFkpRj"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A9A8C4CED6;
	Mon, 13 Jan 2025 07:19:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1736752797;
	bh=MYJh3nER0YHHitikyQndEMbpoJyhZPDW6g9Dil0vlRY=;
	h=Date:From:Cc:To:In-Reply-To:References:Subject:From;
	b=mjKFkpRjdNsXXJ5zthwnqTsDxtfOwux3uS6dTV9/A8lV3ByHLs7QPzZoG5eOX3XTu
	 Z9Y6yGThfI432tMiVYIueQY4bFTd1oy20h+H2JfbtijnbZom14Vzd9PoG9p+HObrH+
	 9iCFrUMlX5B8RSLX1xf+dtGPqjlK/NNjZjtmjShbqyj14xpNMwiLKjA9JdT4ucp919
	 asB5Q5Di+p3sPXIQ08Tf8telCIYOX1wkRg4Iqvhzmzl28rHR9ZATGve5/jmPTXItjZ
	 7ccTeP5T3pn2qLLwpSljNU4DSYOWTiFUyD7EwozyfUT+HrvoLTZ3kkBaTgI8KnFP/n
	 MppiBw38PetPw==
Date: Mon, 13 Jan 2025 01:19:56 -0600
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
From: "Rob Herring (Arm)" <robh@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>, Kevin Hilman <khilman@baylibre.com>, 
 linux-sound@vger.kernel.org, Jerome Brunet <jbrunet@baylibre.com>, 
 Krzysztof Kozlowski <krzk+dt@kernel.org>, 
 linux-arm-kernel@lists.infradead.org, 
 Neil Armstrong <neil.armstrong@linaro.org>, linux-kernel@vger.kernel.org, 
 Conor Dooley <conor+dt@kernel.org>, Mark Brown <broonie@kernel.org>, 
 Takashi Iwai <tiwai@suse.com>, devicetree@vger.kernel.org, 
 linux-amlogic@lists.infradead.org, 
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>, 
 Liam Girdwood <lgirdwood@gmail.com>
To: jiebing chen <jiebing.chen@amlogic.com>
In-Reply-To: <20250113-audio_drvier-v1-1-8c14770f38a0@amlogic.com>
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-1-8c14770f38a0@amlogic.com>
Message-Id: <173675279619.745064.11661644624607210871.robh@kernel.org>
Subject: Re: [PATCH 1/3] ASoC: dt-bindings: Add Amlogic S4 audio


On Mon, 13 Jan 2025 14:35:13 +0800, jiebing chen wrote:
> Add documentation describing the Amlogic S4 TDM output pad and toacodec.
> 
> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
> ---
>  .../bindings/sound/amlogic,s4-tdmout-pad.yaml      | 36 ++++++++++++++++++
>  .../bindings/sound/amlogic,s4-tocodec.yaml         | 44 ++++++++++++++++++++++
>  2 files changed, 80 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/sound/amlogic,s4-tocodec.example.dts:23.35-36 syntax error
FATAL ERROR: Unable to parse input tree
make[2]: *** [scripts/Makefile.dtbs:131: Documentation/devicetree/bindings/sound/amlogic,s4-tocodec.example.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1506: dt_binding_check] Error 2
make: *** [Makefile:251: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250113-audio_drvier-v1-1-8c14770f38a0@amlogic.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48])
	(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 81FBF20459B
	for <linux-kernel@vger.kernel.org>; Mon, 13 Jan 2025 14:31:41 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736778705; cv=none; b=ZazAvIik++PZhcpte/RWX66lHKlV95Z0ebq6pGNAI4roTLy5scVGqPsNdcz1edAL66K/U5Y1dyO5QPLqBAneNKjSlr8myp2aghc37otPA7hXMYQlCqhajyi0B6TlkLTgz+5Py8VIjBLX5j7QfIadzP3qMaGgi/aLu06/77FxMJc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736778705; c=relaxed/simple;
	bh=DFMyj7BU0LMrEt4o+1e7ZtVDqKoOovhrtsLeqdJY0zY=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=SXlJfkna5iWXA7HEEP+JGf2JvYbabems5mc+D830Yg+frAawTssK/CJALMavTAbZaleV5gn/3tJ44jneTz1AMEZDasSXzf0+lS9i8xAHr1GCrptg8XFuDrhtgNNOrRFpuaE//JH1g2H3LeL3tTWUClJHyg4/29IEig2DtHh+CsI=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=sotk+C82; arc=none smtp.client-ip=209.85.128.48
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="sotk+C82"
Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-43675b1155bso50241765e9.2
        for <linux-kernel@vger.kernel.org>; Mon, 13 Jan 2025 06:31:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736778700; x=1737383500; darn=vger.kernel.org;
        h=mime-version:message-id:date:user-agent:references:in-reply-to
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=tkJZOWdQ7DSSfWzIyKLMYvgbqLowNP+cyEYkO9/h/9A=;
        b=sotk+C822JyQUHZlVCBeMMLTwPhbX1FKnUjKRZ4e9jKWd630XR2Ya4u2zTRV0fwVEp
         1XL+cRygJ/W2PPbujm22l+qykMUPrLsPsmbjXwwXfGTpXifvPglllHA+sOD4+Fi654fj
         +l4U8pybUdykyZsE1mAWWsaPR1oeaXy2ULvwsVvTHzXdSuDCQG/Dfe2i5LvfX3MaoaTW
         L7zM+p4u35K+8LGDJSzy37jk2F+JhR9HAj9+vHn5IEfuqYDmknYoDrNPa6VU4m+zwp8v
         hSwI2J0/US0LhJRdWkZsZ9ucW+NIHCBPamimun/Bamwa6RyHVqUXFWWlTU9X6Dfi1Fbd
         w/iA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1736778700; x=1737383500;
        h=mime-version:message-id:date:user-agent:references:in-reply-to
         :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=tkJZOWdQ7DSSfWzIyKLMYvgbqLowNP+cyEYkO9/h/9A=;
        b=NtdIzo9R0H5rkI6zpokCSdxDbvPWAhl2+fEKFmiyz9KW39OnmYMOOoCdxBuHdr9Z+w
         tBao9BXRhFB3TOUFL5YMd22qMdsOPj5yQKtWZmlwg91nm68OMv44g1uVSfCHoZFR8MgA
         yA6J3LxT/ajSW3uGwp3V2v7pTTuXawOARJz1+UWSA2sJ82koMPHWOO00xGFPWZp/bdwX
         XyKB3LiaGzc7XpRJO61q2X6bnRIBBoIfDkaHbo+rLC5msuZ/9LXMg9s44hLgfciFeFiJ
         ortTa74nJi08aVWIxbPDnrrqiZ2yCG3G/qceyaqeksjGRIbGc6YvtPqBJIMWC5wJ67pf
         dARg==
X-Forwarded-Encrypted: i=1; AJvYcCVXSyBmUXC8lgTd+UbBDF/c14z1JWFVMz5ZfnMlQgfHpAu7qRM82ZRCg09nK+BYw05G39KrT3Xf8/zvw04=@vger.kernel.org
X-Gm-Message-State: AOJu0YzZrSnNY7m1bakw026Vbb256nzI33ZM576PxM79vizY6MnKD+Xu
	TWBrrEeL6+EwLg1ldgSLITtRfYuDnMN1RawdJ9pmSY+nNrA8oXpoAk6ESE57Dgk=
X-Gm-Gg: ASbGncsXTnWUnGNpU/gez/MKGPBVvnShs1eheHxEv2q9dWgskFhMl0kgc+eSrb7VcJ6
	/1tS7dgtcPvlGJ1Gqo9ftM/vriFjgdhuh+EVWRL0g6XCNInhal640SPhbg8lQ0hy3viyHyrxP1v
	E1OGM94cPz0VjZji5QO2FyiEKS5XbxomuMQJH6aR4NTGm1TRtOmL/zXTT0B+z7/ANXmxgp3nOpX
	tfkAMRojJjdTNhQA43O5a+h+W3RR23qTdm5m4U84F1s+cg7RWd8gCPY
X-Google-Smtp-Source: AGHT+IH5sJ5xFp1Qx36jmJXkEkjo1gH2JT5g2s2ZQM9VcCRmiSmu2sWdlu3uMuHB4dSa4Y2Ssfc6+Q==
X-Received: by 2002:a05:600c:46ce:b0:436:6ddf:7a27 with SMTP id 5b1f17b1804b1-436e27072a7mr170981525e9.23.1736778699604;
        Mon, 13 Jan 2025 06:31:39 -0800 (PST)
Received: from localhost ([2a01:e0a:3c5:5fb1:9d2d:28cc:aafd:8429])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9dd1cc3sm144236365e9.14.2025.01.13.06.31.38
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 13 Jan 2025 06:31:39 -0800 (PST)
From: Jerome Brunet <jbrunet@baylibre.com>
To: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,  Mark Brown <broonie@kernel.org>,
  Rob Herring <robh@kernel.org>,  Krzysztof Kozlowski <krzk+dt@kernel.org>,
  Conor Dooley <conor+dt@kernel.org>,  Jaroslav Kysela <perex@perex.cz>,
  Takashi Iwai <tiwai@suse.com>,  Neil Armstrong
 <neil.armstrong@linaro.org>,  Kevin Hilman <khilman@baylibre.com>,  Martin
 Blumenstingl <martin.blumenstingl@googlemail.com>,
  jiebing.chen@amlogic.com,  linux-sound@vger.kernel.org,
  devicetree@vger.kernel.org,  linux-kernel@vger.kernel.org,
  linux-arm-kernel@lists.infradead.org,  linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
In-Reply-To: <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com> (jiebing
	chen via's message of "Mon, 13 Jan 2025 14:35:14 +0800")
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
	<20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
User-Agent: mu4e 1.12.7; emacs 29.4
Date: Mon, 13 Jan 2025 15:31:38 +0100
Message-ID: <1jwmey9451.fsf@starbuckisacylon.baylibre.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain

On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:

> From: jiebing chen <jiebing.chen@amlogic.com>
>
> Add audio support for Amlogic S4.The audio output pad
> can be freelycombined with the output lane,and the tocodec
> control logic has been optimized.

The patch is a mixture of different HW modules.

Each patch should have one clear purpose and, as such, deal with a
single HW module

>
> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
> ---
>  sound/soc/meson/Kconfig              |  16 ++
>  sound/soc/meson/Makefile             |   6 +
>  sound/soc/meson/s4-pad-out-control.c | 372 ++++++++++++++++++++++++++++++++++
>  sound/soc/meson/s4-tocodec-control.c | 376 +++++++++++++++++++++++++++++++++++
>  sound/soc/meson/t9015.c              |   5 +-
>  5 files changed, 771 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/meson/Kconfig b/sound/soc/meson/Kconfig
> index 6458d5dc4902f665211bb9e4ae7d274e4bff2fdc..d01e284642fd987cf4bdf88e5bf5f7c9a241af59 100644
> --- a/sound/soc/meson/Kconfig
> +++ b/sound/soc/meson/Kconfig
> @@ -69,6 +69,8 @@ config SND_MESON_AXG_SOUND_CARD
>  	imply SND_MESON_AXG_SPDIFIN
>  	imply SND_MESON_AXG_PDM
>  	imply SND_MESON_G12A_TOACODEC
> +	imply SND_SOC_MESON_PAD_OUT
> +	imply SND_SOC_MESON_TOCODEC_CONTROL
>  	imply SND_MESON_G12A_TOHDMITX if DRM_MESON_DW_HDMI
>  	help
>  	  Select Y or M to add support for the AXG SoC sound card
> @@ -135,4 +137,18 @@ config SND_SOC_MESON_T9015
>  	help
>  	  Say Y or M if you want to add support for the internal DAC found
>  	  on GXL, G12 and SM1 SoC family.
> +
> +config SND_SOC_MESON_PAD_OUT
> +	tristate "Amlogic PAD OUT"
> +	select REGMAP_MMIO
> +	help
> +	  Say Y or M if you want to add support for the S4 Audio Output from
> +	  the data Pad.
> +
> +config SND_SOC_MESON_TOCODEC_CONTROL
> +	tristate "Amlogic TOCODEC CONTROL"
> +	select REGMAP_MMIO
> +	help
> +	 Say Y or M if you want to add support for the internal DAC control
> +	 on SM1 SoC family.
>  endmenu
> diff --git a/sound/soc/meson/Makefile b/sound/soc/meson/Makefile
> index 24078e4396b02d545d8ba4bcb1632979001354e3..afbefcb1313670f9b1365e88b8eb1a0badd7dc1e 100644
> --- a/sound/soc/meson/Makefile
> +++ b/sound/soc/meson/Makefile
> @@ -24,8 +24,11 @@ snd-soc-meson-codec-glue-y := meson-codec-glue.o
>  snd-soc-meson-gx-sound-card-y := gx-card.o
>  snd-soc-meson-g12a-toacodec-y := g12a-toacodec.o
>  snd-soc-meson-g12a-tohdmitx-y := g12a-tohdmitx.o
> +snd-soc-meson-s4-padout-objs := s4-pad-out-control.o
> +snd-soc-meson-s4-tocodec-control-objs := s4-tocodec-control.o
>  snd-soc-meson-t9015-y := t9015.o
>  
> +
>  obj-$(CONFIG_SND_MESON_AIU) += snd-soc-meson-aiu.o
>  obj-$(CONFIG_SND_MESON_AXG_FIFO) += snd-soc-meson-axg-fifo.o
>  obj-$(CONFIG_SND_MESON_AXG_FRDDR) += snd-soc-meson-axg-frddr.o
> @@ -43,4 +46,7 @@ obj-$(CONFIG_SND_MESON_CODEC_GLUE) += snd-soc-meson-codec-glue.o
>  obj-$(CONFIG_SND_MESON_GX_SOUND_CARD) += snd-soc-meson-gx-sound-card.o
>  obj-$(CONFIG_SND_MESON_G12A_TOACODEC) += snd-soc-meson-g12a-toacodec.o
>  obj-$(CONFIG_SND_MESON_G12A_TOHDMITX) += snd-soc-meson-g12a-tohdmitx.o
> +obj-$(CONFIG_SND_SOC_MESON_PAD_OUT) += snd-soc-meson-s4-padout.o
> +obj-$(CONFIG_SND_SOC_MESON_TOCODEC_CONTROL) += snd-soc-meson-s4-tocodec-control.o
>  obj-$(CONFIG_SND_SOC_MESON_T9015) += snd-soc-meson-t9015.o
> +
> diff --git a/sound/soc/meson/s4-pad-out-control.c b/sound/soc/meson/s4-pad-out-control.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..a86dcf8a5995926f0ddf8d2911f42006daed0feb
> --- /dev/null
> +++ b/sound/soc/meson/s4-pad-out-control.c
> @@ -0,0 +1,372 @@
> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
> +/*
> + * Copyright (C) 2024 Amlogic, Inc. All rights reserved
> + */
> +
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> +#include <linux/regmap.h>
> +#include <sound/soc.h>
> +#include <sound/soc-dai.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include<linux/kstrtox.h>
> +
> +#include "axg-tdm.h"
> +
> +static const struct regmap_config tdmout_pad_regmap_cfg = {
> +	.reg_bits	= 32,
> +	.val_bits	= 32,
> +	.reg_stride	= 4,
> +	.max_register	= 0x28,
> +};
> +
> +#define TDM_IFACE 0
> +#define TDM_A_PAD 0
> +#define TDM_B_PAD 1
> +#define TDM_C_PAD 2
> +
> +#define EE_AUDIO_DAT_PAD_CTRL6 0x0
> +#define EE_AUDIO_DAT_PAD_CTRL7 0x4
> +#define EE_AUDIO_DAT_PAD_CTRL8 0x8
> +#define EE_AUDIO_DAT_PAD_CTRL9 0xc
> +#define EE_AUDIO_DAT_PAD_CTRLA 0x10
> +#define EE_AUDIO_DAT_PAD_CTRLB 0x14
> +#define EE_AUDIO_DAT_PAD_CTRLC 0x1c
> +#define EE_AUDIO_DAT_PAD_CTRLD 0x20
> +#define EE_AUDIO_DAT_PAD_CTRLE 0x24
> +#define EE_AUDIO_DAT_PAD_CTRLF 0x28
> +
> +#define REG_OFFSET 4
> +
> +static const char * const s4_tdmout_sel_texts[] = {
> +	"TDM_D0", "TDM_D1", "TDM_D2", "TDM_D3", "TDM_D4", "TDM_D5", "TDM_D6", "TDM_D7",
> +	"TDM_D8", "TDM_D9", "TDM_D10", "TDM_D11", "TDM_D12", "TDM_D13", "TDM_D14", "TDM_D15",
> +	"TDM_D16", "TDM_D17", "TDM_D18", "TDM_D19", "TDM_D20", "TDM_D21", "TDM_D22", "TDM_D23",
> +	"TDM_D24", "TDM_D25", "TDM_D26", "TDM_D27", "TDM_D28", "TDM_D29", "TDM_D30", "TDM_D31"
> +};

This thing does not belong in ASoC. This is clearly yet another layer of
pinctrl. Please deal with it there.


> +
> +static const struct soc_enum tdmout_sel_enum =
> +	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tdmout_sel_texts),
> +			s4_tdmout_sel_texts);
> +
> +static struct snd_soc_dai *tdm_get_ahead_be(struct snd_soc_dapm_widget *w)
> +{
> +	struct snd_soc_dapm_path *p;
> +	struct snd_soc_dai *be;
> +
> +	snd_soc_dapm_widget_for_each_source_path(w, p) {
> +		if (p->source->id == snd_soc_dapm_dai_in)
> +			return (struct snd_soc_dai *)p->source->priv;
> +		be = tdm_get_ahead_be(p->source);
> +		if (be && be->id == TDM_IFACE)
> +			return be;
> +	}
> +	return NULL;
> +}
> +
> +#define SND_SOC_DAPM_DEMUX_E(wname, wreg, wshift, winvert, wcontrols, \
> +	wevent, wflags) \
> +((struct snd_soc_dapm_widget) { \
> +	.id = snd_soc_dapm_demux, .name = wname, \
> +	SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
> +	.kcontrol_news = wcontrols, .num_kcontrols = 1, \
> +	.event = wevent, .event_flags = wflags})
> +
> +static const struct snd_kcontrol_new tdmout_sel_demux[] = {
> +	SOC_DAPM_ENUM("TDMOUTA SEL", tdmout_sel_enum),
> +	SOC_DAPM_ENUM("TDMOUTB SEL", tdmout_sel_enum),
> +	SOC_DAPM_ENUM("TDMOUTC SEL", tdmout_sel_enum),
> +};
> +
> +static unsigned int aml_simple_strtoull(const char *cp)
> +{
> +	unsigned int result = 0;
> +	unsigned int value = 0;
> +	unsigned int len =  strlen(cp);
> +
> +	while (len != 0) {
> +		len--;
> +		value = isdigit(*cp);
> +		if (value) {
> +			value = *cp - '0';
> +		} else {
> +			cp++;
> +			continue;
> +		}
> +		cp++;
> +		result = result * 10 + value;
> +	}
> +	return result;
> +}
> +
> +static int tdm_out_pad_set(struct snd_soc_dapm_widget *w)
> +{
> +	struct snd_soc_dai *be;
> +	struct axg_tdm_stream *stream;
> +	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> +	unsigned int tdm_id = TDM_A_PAD;
> +	const char *dai_widget_name;
> +	struct snd_soc_dapm_path *p;
> +	unsigned int lane_num = 0;
> +	unsigned long pin = 0;
> +	unsigned int reg, mask, val = 0;
> +	int lane_cnt;
> +
> +	be = tdm_get_ahead_be(w);
> +	if (!be) {
> +		dev_err(component->dev, "%s not find the be\n", __func__);
> +		return -EINVAL;
> +	}
> +	stream = snd_soc_dai_dma_data_get_playback(be);
> +	if (!stream) {
> +		dev_err(component->dev, "%s not find the stream\n", __func__);
> +		return -EINVAL;
> +	}
> +	lane_cnt = (stream->channels - 1) / stream->iface->slots + 1;
> +	/*we like to use dai id, but it is fixed val*/
> +	dai_widget_name = be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
> +	if (strstr(dai_widget_name, "TDM_A"))
> +		tdm_id = TDM_A_PAD;
> +	else if (strstr(dai_widget_name, "TDM_B"))
> +		tdm_id = TDM_B_PAD;
> +	else if (strstr(dai_widget_name, "TDM_C"))
> +		tdm_id = TDM_C_PAD;
> +	else
> +		dev_err(component->dev, "%s not find the be dai widget\n", __func__);
> +	dev_dbg(component->dev, "tdm_id:%d, channel:%d, slot:%d\n",
> +		tdm_id, stream->channels, stream->iface->slots);
> +	snd_soc_dapm_widget_for_each_sink_path(w, p) {
> +		if (p->sink->id == snd_soc_dapm_output) {
> +			if (p->connect) {
> +				pin = aml_simple_strtoull(p->name);
> +				reg = (pin / 4) * REG_OFFSET;
> +				/*calculate mask pos */
> +				mask = 0x1f << ((pin % 4) * 8);
> +				val = tdm_id * 8 + lane_num;
> +				snd_soc_component_update_bits(component, reg, mask, val);
> +				snd_soc_component_update_bits(component, EE_AUDIO_DAT_PAD_CTRLF,
> +							      0x1 << pin, 0 << pin);
> +				lane_num++;
> +				if (lane_num > lane_cnt - 1)
> +					break;
> +			}
> +		}
> +	}
> +	return 0;
> +}
> +
> +static int tdmout_sel_pad_event(struct snd_soc_dapm_widget *w,
> +				struct snd_kcontrol *control,
> +				int event)
> +{
> +	int ret = 0;
> +	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> +
> +	switch (event) {
> +	case SND_SOC_DAPM_PRE_PMU:
> +		tdm_out_pad_set(w);
> +		break;
> +
> +	case SND_SOC_DAPM_PRE_PMD:
> +		break;
> +
> +	default:
> +		dev_err(component->dev, "Unexpected event %d\n", event);
> +		return -EINVAL;
> +	}
> +
> +	return ret;
> +}
> +
> +static const struct snd_soc_dapm_widget s4_tdmout_pad_dapm_widgets[] = {
> +	SND_SOC_DAPM_DEMUX_E("TDMA_OUT SEL", SND_SOC_NOPM, 0, 0,
> +			     &tdmout_sel_demux[TDM_A_PAD], tdmout_sel_pad_event,
> +			   (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
> +	SND_SOC_DAPM_DEMUX_E("TDMB_OUT SEL", SND_SOC_NOPM, 0, 0,
> +			     &tdmout_sel_demux[TDM_B_PAD], tdmout_sel_pad_event,
> +			   (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
> +	SND_SOC_DAPM_DEMUX_E("TDMC_OUT SEL", SND_SOC_NOPM, 0, 0,
> +			     &tdmout_sel_demux[TDM_C_PAD], tdmout_sel_pad_event,
> +			   (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
> +	SND_SOC_DAPM_OUTPUT("TDM_D0"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D1"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D2"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D3"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D4"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D5"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D6"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D7"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D8"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D9"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D10"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D11"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D12"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D13"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D14"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D15"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D16"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D17"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D18"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D19"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D20"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D21"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D22"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D23"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D24"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D25"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D26"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D27"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D28"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D29"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D30"),
> +	SND_SOC_DAPM_OUTPUT("TDM_D31"),
> +};
> +
> +static const struct snd_soc_dapm_route s4_tdmout_pad_dapm_routes[] = {
> +	{ "TDM_D0", "TDM_D0", "TDMA_OUT SEL" },
> +	{ "TDM_D1", "TDM_D1", "TDMA_OUT SEL" },
> +	{ "TDM_D2", "TDM_D2", "TDMA_OUT SEL" },
> +	{ "TDM_D3", "TDM_D3", "TDMA_OUT SEL" },
> +	{ "TDM_D4", "TDM_D4", "TDMA_OUT SEL" },
> +	{ "TDM_D5", "TDM_D5", "TDMA_OUT SEL" },
> +	{ "TDM_D6", "TDM_D6", "TDMA_OUT SEL" },
> +	{ "TDM_D7", "TDM_D7", "TDMA_OUT SEL" },
> +	{ "TDM_D8", "TDM_D8", "TDMA_OUT SEL" },
> +	{ "TDM_D9", "TDM_D9", "TDMA_OUT SEL" },
> +	{ "TDM_D10", "TDM_D10", "TDMA_OUT SEL" },
> +	{ "TDM_D11", "TDM_D11", "TDMA_OUT SEL" },
> +	{ "TDM_D12", "TDM_D12", "TDMA_OUT SEL" },
> +	{ "TDM_D13", "TDM_D13", "TDMA_OUT SEL" },
> +	{ "TDM_D14", "TDM_D14", "TDMA_OUT SEL" },
> +	{ "TDM_D15", "TDM_D15", "TDMA_OUT SEL" },
> +	{ "TDM_D16", "TDM_D16", "TDMA_OUT SEL" },
> +	{ "TDM_D17", "TDM_D17", "TDMA_OUT SEL" },
> +	{ "TDM_D18", "TDM_D18", "TDMA_OUT SEL" },
> +	{ "TDM_D19", "TDM_D19", "TDMA_OUT SEL" },
> +	{ "TDM_D20", "TDM_D20", "TDMA_OUT SEL" },
> +	{ "TDM_D21", "TDM_D21", "TDMA_OUT SEL" },
> +	{ "TDM_D22", "TDM_D22", "TDMA_OUT SEL" },
> +	{ "TDM_D23", "TDM_D23", "TDMA_OUT SEL" },
> +	{ "TDM_D24", "TDM_D24", "TDMA_OUT SEL" },
> +	{ "TDM_D25", "TDM_D25", "TDMA_OUT SEL" },
> +	{ "TDM_D26", "TDM_D26", "TDMA_OUT SEL" },
> +	{ "TDM_D27", "TDM_D27", "TDMA_OUT SEL" },
> +	{ "TDM_D28", "TDM_D28", "TDMA_OUT SEL" },
> +	{ "TDM_D29", "TDM_D29", "TDMA_OUT SEL" },
> +	{ "TDM_D30", "TDM_D30", "TDMA_OUT SEL" },
> +	{ "TDM_D31", "TDM_D31", "TDMA_OUT SEL" },
> +	{ "TDM_D0", "TDM_D0", "TDMB_OUT SEL" },
> +	{ "TDM_D1", "TDM_D1", "TDMB_OUT SEL" },
> +	{ "TDM_D2", "TDM_D2", "TDMB_OUT SEL" },
> +	{ "TDM_D3", "TDM_D3", "TDMB_OUT SEL" },
> +	{ "TDM_D4", "TDM_D4", "TDMB_OUT SEL" },
> +	{ "TDM_D5", "TDM_D5", "TDMB_OUT SEL" },
> +	{ "TDM_D6", "TDM_D6", "TDMB_OUT SEL" },
> +	{ "TDM_D7", "TDM_D7", "TDMB_OUT SEL" },
> +	{ "TDM_D8", "TDM_D8", "TDMB_OUT SEL" },
> +	{ "TDM_D9", "TDM_D9", "TDMB_OUT SEL" },
> +	{ "TDM_D10", "TDM_D10", "TDMB_OUT SEL" },
> +	{ "TDM_D11", "TDM_D11", "TDMB_OUT SEL" },
> +	{ "TDM_D12", "TDM_D12", "TDMB_OUT SEL" },
> +	{ "TDM_D13", "TDM_D13", "TDMB_OUT SEL" },
> +	{ "TDM_D14", "TDM_D14", "TDMB_OUT SEL" },
> +	{ "TDM_D15", "TDM_D15", "TDMB_OUT SEL" },
> +
> +	{ "TDM_D16", "TDM_D16", "TDMB_OUT SEL" },
> +	{ "TDM_D17", "TDM_D17", "TDMB_OUT SEL" },
> +	{ "TDM_D18", "TDM_D18", "TDMB_OUT SEL" },
> +	{ "TDM_D19", "TDM_D19", "TDMB_OUT SEL" },
> +	{ "TDM_D20", "TDM_D20", "TDMB_OUT SEL" },
> +	{ "TDM_D21", "TDM_D21", "TDMB_OUT SEL" },
> +	{ "TDM_D22", "TDM_D22", "TDMB_OUT SEL" },
> +	{ "TDM_D23", "TDM_D23", "TDMB_OUT SEL" },
> +	{ "TDM_D24", "TDM_D24", "TDMB_OUT SEL" },
> +	{ "TDM_D25", "TDM_D25", "TDMB_OUT SEL" },
> +	{ "TDM_D26", "TDM_D26", "TDMB_OUT SEL" },
> +	{ "TDM_D27", "TDM_D27", "TDMB_OUT SEL" },
> +	{ "TDM_D28", "TDM_D28", "TDMB_OUT SEL" },
> +	{ "TDM_D29", "TDM_D29", "TDMB_OUT SEL" },
> +	{ "TDM_D30", "TDM_D30", "TDMB_OUT SEL" },
> +	{ "TDM_D31", "TDM_D31", "TDMB_OUT SEL" },
> +	{ "TDM_D0", "TDM_D0", "TDMC_OUT SEL" },
> +	{ "TDM_D1", "TDM_D1", "TDMC_OUT SEL" },
> +	{ "TDM_D2", "TDM_D2", "TDMC_OUT SEL" },
> +	{ "TDM_D3", "TDM_D3", "TDMC_OUT SEL" },
> +	{ "TDM_D4", "TDM_D4", "TDMC_OUT SEL" },
> +	{ "TDM_D5", "TDM_D5", "TDMC_OUT SEL" },
> +	{ "TDM_D6", "TDM_D6", "TDMC_OUT SEL" },
> +	{ "TDM_D7", "TDM_D7", "TDMC_OUT SEL" },
> +	{ "TDM_D8", "TDM_D8", "TDMC_OUT SEL" },
> +	{ "TDM_D9", "TDM_D9", "TDMC_OUT SEL" },
> +	{ "TDM_D10", "TDM_D10", "TDMC_OUT SEL" },
> +	{ "TDM_D11", "TDM_D11", "TDMC_OUT SEL" },
> +	{ "TDM_D12", "TDM_D12", "TDMC_OUT SEL" },
> +	{ "TDM_D13", "TDM_D13", "TDMC_OUT SEL" },
> +	{ "TDM_D14", "TDM_D14", "TDMC_OUT SEL" },
> +	{ "TDM_D15", "TDM_D15", "TDMC_OUT SEL" },
> +	{ "TDM_D16", "TDM_D16", "TDMC_OUT SEL" },
> +	{ "TDM_D17", "TDM_D17", "TDMC_OUT SEL" },
> +	{ "TDM_D18", "TDM_D18", "TDMC_OUT SEL" },
> +	{ "TDM_D19", "TDM_D19", "TDMC_OUT SEL" },
> +	{ "TDM_D20", "TDM_D20", "TDMC_OUT SEL" },
> +	{ "TDM_D21", "TDM_D21", "TDMC_OUT SEL" },
> +	{ "TDM_D22", "TDM_D22", "TDMC_OUT SEL" },
> +	{ "TDM_D23", "TDM_D23", "TDMC_OUT SEL" },
> +	{ "TDM_D24", "TDM_D24", "TDMC_OUT SEL" },
> +	{ "TDM_D25", "TDM_D25", "TDMC_OUT SEL" },
> +	{ "TDM_D26", "TDM_D26", "TDMC_OUT SEL" },
> +	{ "TDM_D27", "TDM_D27", "TDMC_OUT SEL" },
> +	{ "TDM_D28", "TDM_D28", "TDMC_OUT SEL" },
> +	{ "TDM_D29", "TDM_D29", "TDMC_OUT SEL" },
> +	{ "TDM_D30", "TDM_D30", "TDMC_OUT SEL" },
> +	{ "TDM_D31", "TDM_D31", "TDMC_OUT SEL" },
> +};
> +
> +static const struct snd_soc_component_driver s4_tdmout_pad_component_drv = {
> +	.dapm_widgets		= s4_tdmout_pad_dapm_widgets,
> +	.num_dapm_widgets	= ARRAY_SIZE(s4_tdmout_pad_dapm_widgets),
> +	.dapm_routes		= s4_tdmout_pad_dapm_routes,
> +	.num_dapm_routes	= ARRAY_SIZE(s4_tdmout_pad_dapm_routes),
> +
> +};
> +
> +static const struct of_device_id s4_tdmout_pad_of_match[] = {
> +	{
> +		.compatible = "amlogic,s4-tdmout-pad",
> +	}, {}
> +};
> +
> +MODULE_DEVICE_TABLE(of, s4_tdmout_pad_of_match);
> +
> +static int tdm_pad_out_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct regmap *map;
> +	void __iomem *regs;
> +
> +	regs = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(regs))
> +		return PTR_ERR(regs);
> +
> +	map = devm_regmap_init_mmio(dev, regs, &tdmout_pad_regmap_cfg);
> +	if (IS_ERR(map))
> +		return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap\n");
> +
> +	return devm_snd_soc_register_component(dev, &s4_tdmout_pad_component_drv,
> +					       NULL, 0);
> +}
> +
> +static struct platform_driver tdmout_pad_pdrv = {
> +	.probe = tdm_pad_out_probe,
> +	.driver = {
> +		.name = "s4-pad-out",
> +		.of_match_table = s4_tdmout_pad_of_match,
> +	},
> +};
> +
> +module_platform_driver(tdmout_pad_pdrv);
> +
> +MODULE_DESCRIPTION("Amlogic TDM PAD DRIVER");
> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
> +MODULE_LICENSE("GPL");
> diff --git a/sound/soc/meson/s4-tocodec-control.c b/sound/soc/meson/s4-tocodec-control.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..e5d824fae0eba545d38dc36e2566e7cee590e7f5
> --- /dev/null
> +++ b/sound/soc/meson/s4-tocodec-control.c

There is already a to-acodec driver a not reason has been provided as to why a
completly new driver is required.

Please have look at the existing driver and do try to use it.
If you need to do things so differently, clear justification are necessary.

> @@ -0,0 +1,376 @@
> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
> +/*
> + * Copyright (C) 2023 Amlogic, Inc. All rights reserved
> + */
> +
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> +#include <linux/regmap.h>
> +#include <sound/soc.h>
> +#include <sound/soc-dai.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include<linux/kstrtox.h>
> +#include <linux/clk-provider.h>
> +#include <linux/reset.h>
> +#include "axg-tdm.h"
> +
> +#define TOACODEC_CTRL0			0x0
> +
> +#define CTRL0_ENABLE_SHIFT		31
> +#define CTRL0_BCLK_ENABLE_SHIFT		30
> +#define CTRL0_MCLK_ENABLE_SHIFT		29
> +#define CTRL0_BLK_CAP_INV_SHIFT		9
> +
> +#define TDM_IFACE 0
> +#define TDM_A_PAD 0
> +#define TDM_B_PAD 1
> +#define TDM_C_PAD 2
> +
> +struct toacodec {
> +	struct regmap_field *field_dat_sel;
> +	struct regmap_field *field_lrclk_sel;
> +	struct regmap_field *field_bclk_sel;
> +	struct regmap_field *field_mclk_sel;
> +};
> +
> +struct toacodec_match_data {
> +	const struct snd_soc_component_driver *component_drv;
> +	const struct reg_field field_dat_sel;
> +	const struct reg_field field_lrclk_sel;
> +	const struct reg_field field_bclk_sel;
> +	const struct reg_field field_mclk_sel;
> +};
> +
> +static const struct regmap_config tocodec_regmap_cfg = {
> +	.reg_bits	= 32,
> +	.val_bits	= 32,
> +	.reg_stride	= 4,
> +	.max_register	= 0x1,
> +};
> +
> +#define S4_LANE_OFFSET 8
> +
> +static const char * const s4_tocodec_lane_sel_texts[] = {
> +	"Lane0", "Lane1", "Lane2", "Lane3", "Lane4", "Lane5", "Lane6", "Lane7"
> +};
> +
> +static const struct soc_enum s4_tocodec_lane_sel_enum =
> +	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_lane_sel_texts),
> +			s4_tocodec_lane_sel_texts);
> +
> +static const struct snd_kcontrol_new s4_tocodec_lane_sel =
> +	SOC_DAPM_ENUM("TOCODEC LANE SEL", s4_tocodec_lane_sel_enum);
> +
> +static const char * const s4_tocodec_src_sel_texts[] = {
> +	"TDMA", "TDMB", "TDMC"
> +};
> +
> +static const struct soc_enum s4_tocodec_src_sel_enum =
> +	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_src_sel_texts),
> +			s4_tocodec_src_sel_texts);
> +
> +static const struct snd_kcontrol_new s4_tocodec_src_sel =
> +	SOC_DAPM_ENUM("TOCODEC SEL", s4_tocodec_src_sel_enum);
> +
> +static const struct snd_kcontrol_new s4_toacodec_out_enable =
> +	SOC_DAPM_SINGLE_AUTODISABLE("Switch", TOACODEC_CTRL0,
> +				    CTRL0_ENABLE_SHIFT, 1, 0);
> +
> +static struct snd_soc_dai *tocodec_tdm_get_ahead_be(struct snd_soc_dapm_widget *w)
> +{
> +	struct snd_soc_dapm_path *p;
> +	struct snd_soc_dai *be;
> +
> +	snd_soc_dapm_widget_for_each_source_path(w, p) {
> +		if (!p->connect)
> +			continue;
> +		if (p->source->id == snd_soc_dapm_dai_in)
> +			return (struct snd_soc_dai *)p->source->priv;
> +		be = tocodec_tdm_get_ahead_be(p->source);
> +		if (be && be->id == TDM_IFACE)
> +			return be;
> +	}
> +	return NULL;
> +}
> +
> +static unsigned int aml_simple_strtoull(const char *cp)
> +{
> +	unsigned int result = 0;
> +	unsigned int value = 0;
> +	unsigned int len = strlen(cp);
> +
> +	while (len != 0) {
> +		len--;
> +		value = isdigit(*cp);
> +		if (value) {
> +			value = *cp - '0';
> +		} else {
> +			cp++;
> +			continue;
> +		}
> +		cp++;
> +		result = result * 10 + value;
> +	}
> +	return result;
> +}
> +
> +static int aml_get_clk_id(const char *name)
> +{
> +	int clk_id = 0;
> +
> +	if (strstr(name, "mst_a"))
> +		clk_id = 0;
> +	else if (strstr(name, "mst_b"))
> +		clk_id = 1;
> +	else if (strstr(name, "mst_c"))
> +		clk_id = 2;
> +	else if (strstr(name, "mst_d"))
> +		clk_id = 3;
> +	else if (strstr(name, "mst_e"))
> +		clk_id = 4;
> +	else if (strstr(name, "mst_f"))
> +		clk_id = 5;
> +
> +	return clk_id;
> +}
> +
> +static int aml_tocodec_sel_set(struct snd_soc_dapm_widget *w)
> +{
> +	struct snd_soc_dai *be;
> +	struct axg_tdm_stream *stream;
> +	struct axg_tdm_iface *iface;
> +	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> +	struct toacodec *priv = snd_soc_component_get_drvdata(component);
> +	unsigned int tdm_id = TDM_A_PAD;
> +	const char *dai_widget_name;
> +	struct snd_soc_dapm_path *p;
> +	unsigned int lane = 0;
> +	unsigned int val = 0;
> +	struct clk *sclk, *mclk;
> +	char *clk_name;
> +	int mclk_id, sclk_id;
> +
> +	be = tocodec_tdm_get_ahead_be(w);
> +	if (!be) {
> +		dev_err(component->dev, "%s not find the be\n", __func__);
> +		return -EINVAL;
> +	}
> +	stream = snd_soc_dai_dma_data_get_playback(be);
> +	if (!stream) {
> +		dev_err(component->dev, "%s not find the stream\n", __func__);
> +		return -EINVAL;
> +	}
> +	/*we like to use dai id, but it is fixed val*/
> +	dai_widget_name = be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
> +	if (strstr(dai_widget_name, "TDM_A"))
> +		tdm_id = TDM_A_PAD;
> +	else if (strstr(dai_widget_name, "TDM_B"))
> +		tdm_id = TDM_B_PAD;
> +	else if (strstr(dai_widget_name, "TDM_C"))
> +		tdm_id = TDM_C_PAD;
> +	snd_soc_dapm_widget_for_each_source_path(w, p) {
> +		if (p->connect && p->name) {
> +			lane = aml_simple_strtoull(p->name);
> +			val = lane + tdm_id * S4_LANE_OFFSET;
> +			regmap_field_write(priv->field_dat_sel, val);
> +		}
> +	}
> +	iface = stream->iface;
> +	mclk = iface->mclk;
> +	sclk = iface->sclk;
> +	mclk_id = aml_get_clk_id(__clk_get_name(mclk));
> +	sclk_id = aml_get_clk_id(__clk_get_name(sclk));
> +	regmap_field_write(priv->field_mclk_sel, mclk_id);
> +	regmap_field_write(priv->field_bclk_sel, sclk_id);
> +	regmap_field_write(priv->field_lrclk_sel, sclk_id);
> +
> +	return 0;
> +}
> +
> +static int tocodec_sel_event(struct snd_soc_dapm_widget *w,
> +			     struct snd_kcontrol *control,
> +			     int event)
> +{
> +	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> +	int ret = 0;
> +
> +	switch (event) {
> +	case SND_SOC_DAPM_PRE_PMU:
> +		ret = aml_tocodec_sel_set(w);
> +		break;
> +
> +	case SND_SOC_DAPM_PRE_PMD:
> +		break;
> +
> +	default:
> +		dev_err(component->dev, "Unexpected event %d\n", event);
> +		return -EINVAL;
> +	}
> +
> +	return ret;
> +}
> +
> +static int tocodec_clk_enable(struct snd_soc_dapm_widget *w,
> +			      struct snd_kcontrol *control,
> +			      int event)
> +{
> +	int ret = 0;
> +	unsigned int mask = 0, val = 0;
> +	struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
> +
> +	snd_soc_component_update_bits(component, TOACODEC_CTRL0,
> +				      1 << CTRL0_BLK_CAP_INV_SHIFT, 1 << CTRL0_BLK_CAP_INV_SHIFT);
> +	switch (event) {
> +	case SND_SOC_DAPM_PRE_PMU:
> +		mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
> +		val = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
> +		snd_soc_component_update_bits(component, TOACODEC_CTRL0, mask, val);
> +		break;
> +	case SND_SOC_DAPM_PRE_PMD:
> +		mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
> +		val = 0 << CTRL0_MCLK_ENABLE_SHIFT | 0 << CTRL0_BCLK_ENABLE_SHIFT;
> +		snd_soc_component_update_bits(component, TOACODEC_CTRL0, mask, val);
> +		break;
> +	default:
> +		dev_err(component->dev, "Unexpected event %d\n", event);
> +		return -EINVAL;
> +	}
> +
> +	return ret;
> +}
> +
> +static const struct snd_soc_dapm_widget s4_toacodec_widgets[] = {
> +	SND_SOC_DAPM_MUX_E("Lane SRC", SND_SOC_NOPM, 0, 0,
> +			   &s4_tocodec_lane_sel, tocodec_sel_event,
> +			   (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
> +	SND_SOC_DAPM_MUX("INPUT SRC", SND_SOC_NOPM, 0, 0, &s4_tocodec_src_sel),
> +	SND_SOC_DAPM_SWITCH_E("OUT EN", SND_SOC_NOPM, 0, 0,
> +			      &s4_toacodec_out_enable, tocodec_clk_enable,
> +				(SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
> +	SND_SOC_DAPM_AIF_IN("TDMA", NULL, 0, SND_SOC_NOPM, 0, 0),
> +	SND_SOC_DAPM_AIF_IN("TDMB", NULL, 0, SND_SOC_NOPM, 0, 0),
> +	SND_SOC_DAPM_AIF_IN("TDMC", NULL, 0, SND_SOC_NOPM, 0, 0),
> +	SND_SOC_DAPM_OUT_DRV("Lane0", SND_SOC_NOPM, 0, 0, NULL, 0),
> +	SND_SOC_DAPM_OUT_DRV("Lane1", SND_SOC_NOPM, 0, 0, NULL, 0),
> +	SND_SOC_DAPM_OUT_DRV("Lane2", SND_SOC_NOPM, 0, 0, NULL, 0),
> +	SND_SOC_DAPM_OUT_DRV("Lane3", SND_SOC_NOPM, 0, 0, NULL, 0),
> +	SND_SOC_DAPM_OUT_DRV("Lane4", SND_SOC_NOPM, 0, 0, NULL, 0),
> +	SND_SOC_DAPM_OUT_DRV("Lane5", SND_SOC_NOPM, 0, 0, NULL, 0),
> +	SND_SOC_DAPM_OUT_DRV("Lane6", SND_SOC_NOPM, 0, 0, NULL, 0),
> +	SND_SOC_DAPM_OUT_DRV("Lane7", SND_SOC_NOPM, 0, 0, NULL, 0),
> +	SND_SOC_DAPM_OUTPUT("TDM_TO_ACODEC"),
> +};
> +
> +static const struct snd_soc_dapm_route s4_tocodec_dapm_routes[] = {
> +	{ "INPUT SRC", "TDMA", "TDMA"},
> +	{ "INPUT SRC", "TDMB", "TDMB"},
> +	{ "INPUT SRC", "TDMC", "TDMC"},
> +	{ "Lane0", NULL, "INPUT SRC" },
> +	{ "Lane1", NULL, "INPUT SRC"},
> +	{ "Lane2", NULL, "INPUT SRC"},
> +	{ "Lane3", NULL, "INPUT SRC"},
> +	{ "Lane4", NULL, "INPUT SRC"},
> +	{ "Lane5", NULL, "INPUT SRC"},
> +	{ "Lane6", NULL, "INPUT SRC"},
> +	{ "Lane7", NULL, "INPUT SRC"},
> +	{ "Lane SRC", "Lane0", "Lane0"},
> +	{ "Lane SRC", "Lane1", "Lane1"},
> +	{ "Lane SRC", "Lane2", "Lane2"},
> +	{ "Lane SRC", "Lane3", "Lane3"},
> +	{ "Lane SRC", "Lane4", "Lane4"},
> +	{ "Lane SRC", "Lane5", "Lane5"},
> +	{ "Lane SRC", "Lane6", "Lane6"},
> +	{ "Lane SRC", "Lane7", "Lane7"},
> +	{ "OUT EN", "Switch", "Lane SRC"},
> +	{ "TDM_TO_ACODEC", NULL, "OUT EN"},
> +
> +};
> +
> +static const struct snd_soc_component_driver s4_tocodec_component_drv = {
> +	.dapm_widgets		= s4_toacodec_widgets,
> +	.num_dapm_widgets	= ARRAY_SIZE(s4_toacodec_widgets),
> +	.dapm_routes		= s4_tocodec_dapm_routes,
> +	.num_dapm_routes	= ARRAY_SIZE(s4_tocodec_dapm_routes),
> +};
> +
> +static const struct toacodec_match_data s4_toacodec_match_data = {
> +	.component_drv	= &s4_tocodec_component_drv,
> +	.field_dat_sel	= REG_FIELD(TOACODEC_CTRL0, 16, 20),
> +	.field_lrclk_sel = REG_FIELD(TOACODEC_CTRL0, 12, 14),
> +	.field_bclk_sel	= REG_FIELD(TOACODEC_CTRL0, 4, 6),
> +	.field_mclk_sel	= REG_FIELD(TOACODEC_CTRL0, 0, 2),
> +};
> +
> +static const struct of_device_id s4_tocodec_of_match[] = {
> +	{
> +		.compatible = "amlogic,s4-tocodec",
> +		.data = &s4_toacodec_match_data,
> +	}, {}
> +};
> +
> +MODULE_DEVICE_TABLE(of, s4_tocodec_of_match);
> +
> +static int tocodec_probe(struct platform_device *pdev)
> +{
> +	const struct toacodec_match_data *data;
> +	struct device *dev = &pdev->dev;
> +	struct toacodec *priv;
> +	void __iomem *regs;
> +	struct regmap *map;
> +	int ret;
> +
> +	data = device_get_match_data(dev);
> +	if (!data)
> +		return dev_err_probe(dev, -ENODEV, "failed to match device\n");
> +	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> +	if (!priv)
> +		return -ENOMEM;
> +
> +	platform_set_drvdata(pdev, priv);
> +
> +	ret = device_reset(dev);
> +	if (ret)
> +		return ret;
> +
> +	regs = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(regs))
> +		return PTR_ERR(regs);
> +
> +	map = devm_regmap_init_mmio(dev, regs, &tocodec_regmap_cfg);
> +	if (IS_ERR(map))
> +		return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap\n");
> +
> +	priv->field_dat_sel = devm_regmap_field_alloc(dev, map, data->field_dat_sel);
> +	if (IS_ERR(priv->field_dat_sel))
> +		return PTR_ERR(priv->field_dat_sel);
> +
> +	priv->field_lrclk_sel = devm_regmap_field_alloc(dev, map, data->field_lrclk_sel);
> +	if (IS_ERR(priv->field_lrclk_sel))
> +		return PTR_ERR(priv->field_lrclk_sel);
> +
> +	priv->field_bclk_sel = devm_regmap_field_alloc(dev, map, data->field_bclk_sel);
> +	if (IS_ERR(priv->field_bclk_sel))
> +		return PTR_ERR(priv->field_bclk_sel);
> +
> +	priv->field_mclk_sel = devm_regmap_field_alloc(dev, map, data->field_mclk_sel);
> +	if (IS_ERR(priv->field_mclk_sel))
> +		return PTR_ERR(priv->field_mclk_sel);
> +
> +	return devm_snd_soc_register_component(dev,
> +			data->component_drv, NULL, 0);
> +}
> +
> +static struct platform_driver tocodec_pdrv = {
> +	.probe = tocodec_probe,
> +	.driver = {
> +		.name = "s4-tocodec",
> +		.of_match_table = s4_tocodec_of_match,
> +	},
> +};
> +
> +module_platform_driver(tocodec_pdrv);
> +
> +MODULE_DESCRIPTION("Amlogic to codec driver");
> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
> +MODULE_LICENSE("GPL");
> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
> index 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648 100644
> --- a/sound/soc/meson/t9015.c
> +++ b/sound/soc/meson/t9015.c
> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
>  		.channels_min = 1,
>  		.channels_max = 2,
>  		.rates = SNDRV_PCM_RATE_8000_96000,
> -		.formats = (SNDRV_PCM_FMTBIT_S8 |
> -			    SNDRV_PCM_FMTBIT_S16_LE |
> -			    SNDRV_PCM_FMTBIT_S20_LE |
> -			    SNDRV_PCM_FMTBIT_S24_LE),
> +		.formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE),

Again, mixed up changes with zero justification.

This drops S8 and S16 format support for the existing SoCs (such as GXL)
which is known to work and add S32 support on an HW documented as 24bits
only. Can you explain ?

>  	},
>  	.ops = &t9015_dai_ops,
>  };

-- 
Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46])
	(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 5AFCA23A0F5
	for <linux-kernel@vger.kernel.org>; Mon, 13 Jan 2025 14:50:39 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736779843; cv=none; b=g4EBGoWgomQ93RPk9LZ/7pMVE6BHRprEraJD7gjMsBno1Xx29AVWRzGB1xQemj+s1OKVp8hxg3DVar/29/t9hyLIQxXlCTIR7nRw6bUlSc44wq2COlKKQWnu5j41F4OyW1pECwuauFmGBFqAmv6PfjxizrWkuZ29vMb951bVego=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736779843; c=relaxed/simple;
	bh=3HA39ymYx305lNUVvQ39CYDqNTgXsVMHBSc2aSGZF38=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=f+Lfl9CheidMqkYpNoiD+gLOgjuSbyduvcvg/6MRkNvlUR61LxquXqW7w4MuG5huRLdCpaggfMmK27xQXTQejJO6FZbVSUmmrG+j3QMhZl/xkmOoouyIVjj5jNa3/DgMO2It2J54mcuzgUnXefny4D80Fukxn3qHgYW+bcffceI=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=sn9JnvjQ; arc=none smtp.client-ip=209.85.128.46
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="sn9JnvjQ"
Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso31487535e9.2
        for <linux-kernel@vger.kernel.org>; Mon, 13 Jan 2025 06:50:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736779838; x=1737384638; darn=vger.kernel.org;
        h=mime-version:message-id:date:user-agent:references:in-reply-to
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=1s3giDUI3z0SKMOQ7RZwo1PdDhJrl+0Xcjh+T+MelhY=;
        b=sn9JnvjQbkMacFgBaK2gH0TvlLxPNn3E6jwe4mttrEL8376VCM3NVYlcqUg4LGsUZh
         9H/gJvBrmWxGz3cAPLSRvu6CGnER2RLIrDYGEejQ31kDyzZVT0G5SJixHvywfuvXc84g
         0EpvTw0OfyeV2zx5Wikm5JF+b5ZM4FcNe481P769neNqkwDvFoBPQ5VA6cPWeZQMd7G1
         ftP4lwP2zBQJgW3ev81jCGk630yCx7w7P9wBJYTQ/Zfz9pX6wJq6GOwq0IKWoFTQCNZh
         j6sI1RJ0O6yMrTgG7TUYxm5SfxuwrWxpF4finVSBDoBFldJ2e5UtM3S7Q8u4jxu7mhR5
         btMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1736779838; x=1737384638;
        h=mime-version:message-id:date:user-agent:references:in-reply-to
         :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=1s3giDUI3z0SKMOQ7RZwo1PdDhJrl+0Xcjh+T+MelhY=;
        b=GDEsRiewj8FUH7hBP/AFPCYJJhtCWpgHGIjfiMs+RgVHnhKvw50D+MnUvRb1tR9hsD
         bcuEwEV0c6B/UKYOGEU5kBxKSHV4LMptugjE921codcEG+e9ZIxfsIL7UhRFoAOauAlq
         48Q3pD0DZd7Q2FtNNmBtMbiUPfAY7NuJsanml/t7nOsLe4N7GyU1UCit1vhAFOoTOWAj
         iVvqkOtWwrcqpcP6zOa76iKkvaDBEf7Uq8T7fYE3uEIVhDFgb/QKvqI1h8eQSwt0pMqv
         Z4kFpkfmfOMLxkqWttCIZQ5lEX97jnksPJP17Ny4fu/nSIMFZhp9kLV2bUFAF+Z82YlL
         61NQ==
X-Forwarded-Encrypted: i=1; AJvYcCVsseYkEldQVdbxMUmrfyeAM7a6ylODy+ouN0HhNklXCqs+426G9zYKjY7SaBDx2MzZ3COu1yC/Who8zeI=@vger.kernel.org
X-Gm-Message-State: AOJu0Yw4HUH/1PHlJEm1XgVisKLKlRMdDRA+akwT86OdeWsYZ2ymROuD
	UONNWwvqXJ5HIRyy/xiFzWVi5r5weLLUnTZ6stTibsESznjQ5MoohrHIUjp8zXk=
X-Gm-Gg: ASbGncuyUNcgRZ/yWoo9djWf2t5cAoATcMh5UHVRHSpwVulLmyKNnEr7Gj0ziaMIlWl
	3mZ6bVIeP9cO3nXJ3FeUO3GXA8bQiV/qHqPW8KS9isT1UmqNi9HtuoW6LSUCw4AVJ+D8KtWC64N
	ODJuO0+dlLYdbVIiUDJMQvrijmBbZwzAKrWXikGGs0QfbgYgnHmptUXvI6E+QRXW3PEc5ZzqhZs
	dCTxVbBB4TOyigYvGWoTUGeed9WgdyvXwVn3MQPUzoiRDChmXCkugR7
X-Google-Smtp-Source: AGHT+IEMaivEZj86NHY87IPoy73STxO4Y+4wLZhIMG2hyxIdVgYKeXAF+6aPgA6Nv71/tRETIaJqTw==
X-Received: by 2002:a05:600c:4511:b0:434:fe3c:c67c with SMTP id 5b1f17b1804b1-436e26e51eemr168721215e9.26.1736779837618;
        Mon, 13 Jan 2025 06:50:37 -0800 (PST)
Received: from localhost ([2a01:e0a:3c5:5fb1:9d2d:28cc:aafd:8429])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2ddcb5bsm182910565e9.23.2025.01.13.06.50.37
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 13 Jan 2025 06:50:37 -0800 (PST)
From: Jerome Brunet <jbrunet@baylibre.com>
To: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,  Mark Brown <broonie@kernel.org>,
  Rob Herring <robh@kernel.org>,  Krzysztof Kozlowski <krzk+dt@kernel.org>,
  Conor Dooley <conor+dt@kernel.org>,  Jaroslav Kysela <perex@perex.cz>,
  Takashi Iwai <tiwai@suse.com>,  Neil Armstrong
 <neil.armstrong@linaro.org>,  Kevin Hilman <khilman@baylibre.com>,  Martin
 Blumenstingl <martin.blumenstingl@googlemail.com>,
  jiebing.chen@amlogic.com,  linux-sound@vger.kernel.org,
  devicetree@vger.kernel.org,  linux-kernel@vger.kernel.org,
  linux-arm-kernel@lists.infradead.org,  linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
In-Reply-To: <20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com> (jiebing
	chen via's message of "Mon, 13 Jan 2025 14:35:15 +0800")
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
	<20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
User-Agent: mu4e 1.12.7; emacs 29.4
Date: Mon, 13 Jan 2025 15:50:36 +0100
Message-ID: <1jldve939f.fsf@starbuckisacylon.baylibre.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain

On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:

> From: jiebing chen <jiebing.chen@amlogic.com>
>
> Add basic audio driver support for the Amlogic S4 based Amlogic
> AQ222 board.
>
> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
> ---
>  .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts     | 226 ++++++++++++
>  arch/arm64/boot/dts/amlogic/meson-s4.dtsi          | 385 ++++++++++++++++++++-
>  2 files changed, 610 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
> index 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c5528b43422b705b20130 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
> @@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
>  	       regulator-always-on;
>  	};
>  
> +	vcc5v_reg: regulator-vcc-5v {
> +		compatible = "regulator-fixed";
> +		vin-supply = <&main_12v>;
> +		regulator-name = "VCC5V";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
> +		startup-delay-us = <7000>;
> +		enable-active-high;
> +		regulator-boot-on;
> +		regulator-always-on;
> +	};
> +
>  	/* SY8120B1ABC DC/DC Regulator. */
>  	vddcpu: regulator-vddcpu {
>  		compatible = "pwm-regulator";
> @@ -129,6 +142,219 @@ vddcpu: regulator-vddcpu {
>  				<699000 98>,
>  				<689000 100>;
>  	};
> +	dmics: audio-codec-1 {
> +		compatible = "dmic-codec";
> +		#sound-dai-cells = <0>;
> +		num-channels = <2>;
> +		wakeup-delay-ms = <50>;
> +		sound-name-prefix = "MIC";
> +	};
> +
> +	dioo2133: audio-amplifier-0 {
> +		compatible = "simple-audio-amplifier";
> +		enable-gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
> +		VCC-supply = <&vcc5v_reg>;
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "10U2";
> +	};
> +
> +	spdif_dir: audio-spdif-in {
> +		compatible = "linux,spdif-dir";
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "DIR";
> +	};
> +
> +	spdif_dit: audio-spdif-out {
> +		compatible = "linux,spdif-dit";
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "DIT";
> +	};
> +
> +	sound {
> +		compatible = "amlogic,axg-sound-card";
> +		model = "aq222";
> +		audio-widgets = "Line", "Lineout";
> +		audio-aux-devs = <&tdmout_a>, <&tdmout_b>, <&tdmout_c>,
> +				 <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
> +				 <&tdmin_lb>, <&dioo2133>, <&tdmout_pad>, <&toacodec>;
> +		audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
> +				"TDMOUT_A IN 1", "FRDDR_B OUT 0",
> +				"TDMOUT_A IN 2", "FRDDR_C OUT 0",
> +				"TDM_A Playback", "TDMOUT_A OUT",
> +				"TDMA_OUT SEL",   "TDM_A Playback",
> +				"TDMOUT_B IN 0", "FRDDR_A OUT 1",
> +				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
> +				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
> +				"TDM_B Playback", "TDMOUT_B OUT",
> +				"TDMB_OUT SEL",   "TDM_B Playback",
> +				"TDMOUT_C IN 0", "FRDDR_A OUT 2",
> +				"TDMOUT_C IN 1", "FRDDR_B OUT 2",
> +				"TDMOUT_C IN 2", "FRDDR_C OUT 2",
> +				"TDM_C Playback", "TDMOUT_C OUT",
> +				"TDMC_OUT SEL",   "TDM_C Playback",
> +				"TOACODEC TDMA", "TDM_A Playback",
> +				"TOACODEC TDMB", "TDM_B Playback",
> +				"TOACODEC TDMC", "TDM_C Playback",
> +				"SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
> +				"SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
> +				"SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
> +				"SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
> +				"SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
> +				"SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
> +				"TDMIN_A IN 0", "TDM_A Capture",
> +				"TDMIN_A IN 1", "TDM_B Capture",
> +				"TDMIN_A IN 2", "TDM_C Capture",
> +				"TDMIN_A IN 3", "TDM_A Loopback",
> +				"TDMIN_A IN 4", "TDM_B Loopback",
> +				"TDMIN_A IN 5", "TDM_C Loopback",
> +				"TDMIN_B IN 0", "TDM_A Capture",
> +				"TDMIN_B IN 1", "TDM_B Capture",
> +				"TDMIN_B IN 2", "TDM_C Capture",
> +				"TDMIN_B IN 3", "TDM_A Loopback",
> +				"TDMIN_B IN 4", "TDM_B Loopback",
> +				"TDMIN_B IN 5", "TDM_C Loopback",
> +				"TDMIN_C IN 0", "TDM_A Capture",
> +				"TDMIN_C IN 1", "TDM_B Capture",
> +				"TDMIN_C IN 2", "TDM_C Capture",
> +				"TDMIN_C IN 3", "TDM_A Loopback",
> +				"TDMIN_C IN 4", "TDM_B Loopback",
> +				"TDMIN_C IN 5", "TDM_C Loopback",
> +				"TDMIN_LB IN 3", "TDM_A Capture",
> +				"TDMIN_LB IN 4", "TDM_B Capture",
> +				"TDMIN_LB IN 5", "TDM_C Capture",
> +				"TDMIN_LB IN 0", "TDM_A Loopback",
> +				"TDMIN_LB IN 1", "TDM_B Loopback",
> +				"TDMIN_LB IN 2", "TDM_C Loopback",
> +				"TODDR_A IN 0", "TDMIN_A OUT",
> +				"TODDR_B IN 0", "TDMIN_A OUT",
> +				"TODDR_C IN 0", "TDMIN_A OUT",
> +				"TODDR_A IN 1", "TDMIN_B OUT",
> +				"TODDR_B IN 1", "TDMIN_B OUT",
> +				"TODDR_C IN 1", "TDMIN_B OUT",
> +				"TODDR_A IN 2", "TDMIN_C OUT",
> +				"TODDR_B IN 2", "TDMIN_C OUT",
> +				"TODDR_C IN 2", "TDMIN_C OUT",
> +				"TODDR_A IN 3", "SPDIFIN Capture",
> +				"TODDR_B IN 3", "SPDIFIN Capture",
> +				"TODDR_C IN 3", "SPDIFIN Capture",
> +				"TODDR_A IN 6", "TDMIN_LB OUT",
> +				"TODDR_B IN 6", "TDMIN_LB OUT",
> +				"TODDR_C IN 6", "TDMIN_LB OUT",
> +				"10U2 INL", "ACODEC LOLP",
> +				"10U2 INR", "ACODEC LORP",
> +				"Lineout", "10U2 OUTL",
> +				"Lineout", "10U2 OUTR";
> +		assigned-clocks = <&clkc_pll CLKID_HIFI_PLL>,
> +				  <&clkc_pll CLKID_MPLL2>,
> +				  <&clkc_pll CLKID_MPLL0>,
> +				  <&clkc_pll CLKID_MPLL1>;
> +		assigned-clock-rates = <491520000>,
> +				       <294912000>,
> +				       <270950400>,
> +				       <393216000>;

Why do you need 4 base rates ? Which rate family does each provide ?

> +
> +		dai-link-0 {
> +			sound-dai = <&frddr_a>;
> +		};
> +
> +		dai-link-1 {
> +			sound-dai = <&frddr_b>;
> +		};
> +
> +		dai-link-2 {
> +			sound-dai = <&frddr_c>;
> +		};
> +
> +		dai-link-3 {
> +			sound-dai = <&toddr_a>;
> +		};
> +
> +		dai-link-4 {
> +			sound-dai = <&toddr_b>;
> +		};
> +
> +		dai-link-5 {
> +			sound-dai = <&toddr_c>;
> +		};
> +
> +		/* Connected to the WIFI/BT chip */
> +		dai-link-6 {
> +			sound-dai = <&tdmif_a>;
> +			dai-format = "dsp_a";
> +			dai-tdm-slot-tx-mask-0 = <1 1>;
> +			mclk-fs = <256>;
> +			codec-0 {
> +				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
> +			};
> +		};
> +
> +		/* Connected to the onboard AD82584F DAC */
> +		dai-link-7 {
> +			sound-dai = <&tdmif_b>;
> +			dai-format = "i2s";
> +			dai-tdm-slot-tx-mask-0 = <1 1>;
> +			mclk-fs = <256>;
> +
> +			codec-0 {
> +				sound-dai = <&acodec>;
> +			};
> +
> +			codec-1 {
> +				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
> +			};
> +		};
> +
> +		/* 8ch HDMI interface */
> +		dai-link-8 {
> +			sound-dai = <&tdmif_c>;
> +			dai-format = "i2s";
> +			dai-tdm-slot-tx-mask-0 = <1 1>;
> +			dai-tdm-slot-tx-mask-1 = <1 1>;
> +			dai-tdm-slot-tx-mask-2 = <1 1>;
> +			dai-tdm-slot-tx-mask-3 = <1 1>;
> +			mclk-fs = <256>;
> +
> +			codec-0 {
> +				sound-dai = <&acodec>;
> +			};
> +
> +			codec-1 {
> +				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
> +			};
> +		};
> +
> +		/* spdif hdmi and coax output */
> +		dai-link-9 {
> +			sound-dai = <&spdifout_a>;
> +
> +			codec-0 {
> +				sound-dai = <&spdif_dit>;
> +			};
> +
> +			codec-1 {
> +				sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>;
> +			};
> +		};
> +
> +		/* spdif hdmi interface */
> +		dai-link-10 {
> +			sound-dai = <&spdifout_b>;
> +
> +			codec {
> +				sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>;
> +			};
> +		};
> +
> +		/* spdif coax input */
> +		dai-link-11 {
> +			sound-dai = <&spdifin>;
> +
> +			codec {
> +				sound-dai = <&spdif_dir>;
> +			};
> +		};
> +	};
> +
>  };
>  
>  &pwm_ef {
> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
> index 957577d986c0675a503115e1ccbc4387c2051620..87a00ace23131e31822bb43fbe956b8abcbaef40 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
> @@ -11,7 +11,11 @@
>  #include <dt-bindings/clock/amlogic,s4-peripherals-clkc.h>
>  #include <dt-bindings/power/meson-s4-power.h>
>  #include <dt-bindings/reset/amlogic,meson-s4-reset.h>
> -
> +#include <dt-bindings/clock/axg-audio-clkc.h>
> +#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
> +#include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>
> +#include <dt-bindings/sound/meson-g12a-toacodec.h>
> +#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
>  / {
>  	cpus {
>  		#address-cells = <2>;
> @@ -46,6 +50,42 @@ cpu3: cpu@3 {
>  		};
>  	};
>  
> +	tdmif_a: audio-controller-0 {
> +		compatible = "amlogic,axg-tdm-iface";
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "TDM_A";
> +		clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
> +			 <&clkc_audio AUD_CLKID_MST_A_SCLK>,
> +			 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
> +		clock-names = "mclk", "sclk", "lrclk";
> +		assigned-clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK_SEL>;
> +		assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;

Based on clock provider used, I doubt this is of any use.

> +	};
> +
> +	tdmif_b: audio-controller-1 {
> +		compatible = "amlogic,axg-tdm-iface";
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "TDM_B";
> +		clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
> +			 <&clkc_audio AUD_CLKID_MST_B_SCLK>,
> +			 <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
> +		clock-names = "mclk", "sclk", "lrclk";
> +		assigned-clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK_SEL>;
> +		assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
> +	};
> +
> +	tdmif_c: audio-controller-2 {
> +		compatible = "amlogic,axg-tdm-iface";
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "TDM_C";
> +		clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK>,
> +			 <&clkc_audio AUD_CLKID_MST_C_SCLK>,
> +			 <&clkc_audio AUD_CLKID_MST_C_LRCLK>;
> +		clock-names = "mclk", "sclk", "lrclk";
> +		assigned-clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK_SEL>;
> +		assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
> +	};
> +
>  	timer {
>  		compatible = "arm,armv8-timer";
>  		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
> @@ -850,3 +890,346 @@ emmc: mmc@fe08c000 {
>  		};
>  	};
>  };
> +
> +&apb4 {
> +	audio: bus@330000 {
> +		compatible = "simple-bus";
> +		reg = <0x0 0x330000 0x0 0x1000>;
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		ranges = <0x0 0x0 0x0 0x330000 0x0 0x1000>;
> +
> +		clkc_audio: clock-controller@0 {
> +			compatible = "amlogic,sm1-audio-clkc";

I suspect the DT folks would like having SoC specific compatible in
addition to the fall back. In that case, I think that would be wise. I
doubt the compatibility will hold in the long run.

Same goes for the other HW components.

> +			reg = <0x0 0x0 0x0 0xb4>;
> +			#clock-cells = <1>;
> +			#reset-cells = <1>;
> +			power-domains = <&pwrc PWRC_S4_AUDIO_ID>;
> +			clocks = <&clkc_periphs CLKID_AUDIO>,
> +				 <&clkc_pll CLKID_MPLL0>,
> +				 <&clkc_pll CLKID_MPLL1>,
> +				 <&clkc_pll CLKID_MPLL2>,
> +				 <&clkc_pll CLKID_MPLL3>,
> +				 <&clkc_pll CLKID_HIFI_PLL>,
> +				 <&clkc_pll CLKID_FCLK_DIV3>,
> +				 <&clkc_pll CLKID_FCLK_DIV4>,
> +				 <&clkc_pll CLKID_FCLK_DIV5>;
> +			clock-names = "pclk",
> +				      "mst_in0",
> +				      "mst_in1",
> +				      "mst_in2",
> +				      "mst_in3",
> +				      "mst_in4",
> +				      "mst_in5",
> +				      "mst_in6",
> +				      "mst_in7";
> +
> +			resets = <&reset RESET_AUDIO>;
> +		};
> +
> +		toddr_a: audio-controller@100 {
> +			compatible = "amlogic,sm1-toddr",
> +				     "amlogic,axg-toddr";
> +			reg = <0x0 0x100 0x0 0x2c>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "TODDR_A";
> +			interrupts = <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_TODDR_A>;
> +			resets = <&arb AXG_ARB_TODDR_A>,
> +				 <&clkc_audio AUD_RESET_TODDR_A>;
> +			reset-names = "arb", "rst";
> +			amlogic,fifo-depth = <8192>;
> +		};
> +
> +		toddr_b: audio-controller@140 {
> +			compatible = "amlogic,sm1-toddr",
> +				     "amlogic,axg-toddr";
> +			reg = <0x0 0x140 0x0 0x2c>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "TODDR_B";
> +			interrupts = <GIC_SPI 33 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_TODDR_B>;
> +			resets = <&arb AXG_ARB_TODDR_B>,
> +				 <&clkc_audio AUD_RESET_TODDR_B>;
> +			reset-names = "arb", "rst";
> +			amlogic,fifo-depth = <256>;
> +		};
> +
> +		toddr_c: audio-controller@180 {
> +			compatible = "amlogic,sm1-toddr",
> +				     "amlogic,axg-toddr";
> +			reg = <0x0 0x180 0x0 0x2c>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "TODDR_C";
> +			interrupts = <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_TODDR_C>;
> +			resets = <&arb AXG_ARB_TODDR_C>,
> +				 <&clkc_audio AUD_RESET_TODDR_C>;
> +			reset-names = "arb", "rst";
> +			amlogic,fifo-depth = <256>;
> +		};
> +
> +		frddr_a: audio-controller@1c0 {
> +			compatible = "amlogic,sm1-frddr",
> +				     "amlogic,axg-frddr";
> +			reg = <0x0 0x1c0 0x0 0x2c>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "FRDDR_A";
> +			interrupts = <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
> +			resets = <&arb AXG_ARB_FRDDR_A>,
> +				 <&clkc_audio AUD_RESET_FRDDR_A>;
> +			reset-names = "arb", "rst";
> +			amlogic,fifo-depth = <512>;
> +		};
> +
> +		frddr_b: audio-controller@200 {
> +			compatible = "amlogic,sm1-frddr",
> +				     "amlogic,axg-frddr";
> +			reg = <0x0 0x200 0x0 0x2c>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "FRDDR_B";
> +			interrupts = <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_FRDDR_B>;
> +			resets = <&arb AXG_ARB_FRDDR_B>,
> +				 <&clkc_audio AUD_RESET_FRDDR_B>;
> +			reset-names = "arb", "rst";
> +			amlogic,fifo-depth = <256>;
> +		};
> +
> +		frddr_c: audio-controller@240 {
> +			compatible = "amlogic,sm1-frddr",
> +				     "amlogic,axg-frddr";
> +			reg = <0x0 0x240 0x0 0x2c>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "FRDDR_C";
> +			interrupts = <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_FRDDR_C>;
> +			resets = <&arb AXG_ARB_FRDDR_C>,
> +				 <&clkc_audio AUD_RESET_FRDDR_C>;
> +			reset-names = "arb", "rst";
> +			amlogic,fifo-depth = <256>;
> +		};
> +
> +		arb: reset-controller@280 {
> +			compatible = "amlogic,meson-sm1-audio-arb";
> +			reg = <0x0 0x280 0x0 0x4>;
> +			#reset-cells = <1>;
> +			clocks = <&clkc_audio AUD_CLKID_DDR_ARB>;
> +		};
> +
> +		tdmin_a: audio-controller@300 {
> +			compatible = "amlogic,sm1-tdmin",
> +				     "amlogic,axg-tdmin";
> +			reg = <0x0 0x300 0x0 0x40>;
> +			sound-name-prefix = "TDMIN_A";
> +			resets = <&clkc_audio AUD_RESET_TDMIN_A>;
> +			clocks = <&clkc_audio AUD_CLKID_TDMIN_A>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK_SEL>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>;
> +			clock-names = "pclk", "sclk", "sclk_sel",
> +				      "lrclk", "lrclk_sel";
> +		};
> +
> +		tdmin_b: audio-controller@340 {
> +			compatible = "amlogic,sm1-tdmin",
> +				     "amlogic,axg-tdmin";
> +			reg = <0x0 0x340 0x0 0x40>;
> +			sound-name-prefix = "TDMIN_B";
> +			resets = <&clkc_audio AUD_RESET_TDMIN_B>;
> +			clocks = <&clkc_audio AUD_CLKID_TDMIN_B>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK_SEL>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>;
> +			clock-names = "pclk", "sclk", "sclk_sel",
> +				      "lrclk", "lrclk_sel";
> +		};
> +
> +		tdmin_c: audio-controller@380 {
> +			compatible = "amlogic,sm1-tdmin",
> +				     "amlogic,axg-tdmin";
> +			reg = <0x0 0x380 0x0 0x40>;
> +			sound-name-prefix = "TDMIN_C";
> +			resets = <&clkc_audio AUD_RESET_TDMIN_C>;
> +			clocks = <&clkc_audio AUD_CLKID_TDMIN_C>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK_SEL>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>;
> +			clock-names = "pclk", "sclk", "sclk_sel",
> +				      "lrclk", "lrclk_sel";
> +		};
> +
> +		tdmin_lb: audio-controller@3c0 {
> +			compatible = "amlogic,sm1-tdmin",
> +				     "amlogic,axg-tdmin";
> +			reg = <0x0 0x3c0 0x0 0x40>;
> +			sound-name-prefix = "TDMIN_LB";
> +			resets = <&clkc_audio AUD_RESET_TDMIN_LB>;
> +			clocks = <&clkc_audio AUD_CLKID_TDMIN_LB>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK_SEL>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>;
> +			clock-names = "pclk", "sclk", "sclk_sel",
> +				      "lrclk", "lrclk_sel";
> +		};
> +
> +		spdifin: audio-controller@400 {
> +			compatible = "amlogic,g12a-spdifin",
> +				     "amlogic,axg-spdifin";
> +			reg = <0x0 0x400 0x0 0x30>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFIN";
> +			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
> +			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
> +			clock-names = "pclk", "refclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
> +		};
> +
> +		spdifout_a: audio-controller@480 {
> +			compatible = "amlogic,g12a-spdifout",
> +				     "amlogic,axg-spdifout";
> +			reg = <0x0 0x480 0x0 0x50>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFOUT_A";
> +			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
> +			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
> +			clock-names = "pclk", "mclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
> +		};
> +
> +		tdmout_a: audio-controller@500 {
> +			compatible = "amlogic,sm1-tdmout";
> +			reg = <0x0 0x500 0x0 0x40>;
> +			sound-name-prefix = "TDMOUT_A";
> +			resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
> +			clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
> +			clock-names = "pclk", "sclk", "sclk_sel",
> +				      "lrclk", "lrclk_sel";
> +		};
> +
> +		tdmout_b: audio-controller@540 {
> +			compatible = "amlogic,sm1-tdmout";
> +			reg = <0x0 0x540 0x0 0x40>;
> +			sound-name-prefix = "TDMOUT_B";
> +			resets = <&clkc_audio AUD_RESET_TDMOUT_B>;
> +			clocks = <&clkc_audio AUD_CLKID_TDMOUT_B>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK_SEL>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>;
> +			clock-names = "pclk", "sclk", "sclk_sel",
> +				      "lrclk", "lrclk_sel";
> +		};
> +
> +		tdmout_c: audio-controller@580 {
> +			compatible = "amlogic,sm1-tdmout";
> +			reg = <0x0 0x580 0x0 0x40>;
> +			sound-name-prefix = "TDMOUT_C";
> +			resets = <&clkc_audio AUD_RESET_TDMOUT_C>;
> +			clocks = <&clkc_audio AUD_CLKID_TDMOUT_C>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK_SEL>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>,
> +				 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>;
> +			clock-names = "pclk", "sclk", "sclk_sel",
> +				      "lrclk", "lrclk_sel";
> +		};
> +
> +		spdifout_b: audio-controller@680 {
> +			compatible = "amlogic,g12a-spdifout",
> +				     "amlogic,axg-spdifout";
> +			reg = <0x0 0x680 0x0 0x50>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFOUT_B";
> +			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
> +				 <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
> +			clock-names = "pclk", "mclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
> +		};
> +
> +		toacodec: audio-controller@740 {
> +			compatible = "amlogic,s4-tocodec";
> +			reg = <0x0 0x740 0x0 0x4>;
> +			sound-name-prefix = "TOACODEC";
> +			resets = <&clkc_audio AUD_RESET_TOACODEC>;
> +		};
> +
> +		tohdmitx: audio-controller@744 {
> +			compatible = "amlogic,sm1-tohdmitx",
> +				     "amlogic,g12a-tohdmitx";
> +			reg = <0x0 0x744 0x0 0x4>;
> +			#sound-dai-cells = <1>;
> +			sound-name-prefix = "TOHDMITX";
> +			resets = <&clkc_audio AUD_RESET_TOHDMITX>;
> +		};
> +
> +		toddr_d: audio-controller@840 {
> +			compatible = "amlogic,sm1-toddr",
> +				     "amlogic,axg-toddr";
> +			reg = <0x0 0x840 0x0 0x2c>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "TODDR_D";
> +			interrupts = <GIC_SPI 45 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_TODDR_D>;
> +			resets = <&arb AXG_ARB_TODDR_D>,
> +				 <&clkc_audio AUD_RESET_TODDR_D>;
> +			reset-names = "arb", "rst";
> +			amlogic,fifo-depth = <256>;
> +		};
> +
> +		frddr_d: audio-controller@880 {
> +			 compatible = "amlogic,sm1-frddr",
> +				      "amlogic,axg-frddr";
> +			reg = <0x0 0x880 0x0 0x2c>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "FRDDR_D";
> +			interrupts = <GIC_SPI 46 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_FRDDR_D>;
> +			resets = <&arb AXG_ARB_FRDDR_D>,
> +				 <&clkc_audio AUD_RESET_FRDDR_D>;
> +			reset-names = "arb", "rst";
> +			amlogic,fifo-depth = <256>;
> +		};
> +
> +		tdmout_pad: audio-controller@E58 {
> +			compatible = "amlogic,s4-tdmout-pad";
> +			reg = <0x0 0xe58 0x0 0x28>;
> +		};
> +	};
> +
> +	pdm: audio-controller@331000 {
> +		compatible = "amlogic,sm1-pdm",
> +			     "amlogic,axg-pdm";
> +		reg = <0x0 0x331000 0x0 0x34>;
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "PDM";
> +		clocks = <&clkc_audio AUD_CLKID_PDM>,
> +			 <&clkc_audio AUD_CLKID_PDM_DCLK>,
> +			 <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
> +		clock-names = "pclk", "dclk", "sysclk";
> +		resets = <&clkc_audio AUD_RESET_PDM>;
> +		assigned-clocks = <&clkc_audio AUD_CLKID_PDM_DCLK_SEL>,
> +				  <&clkc_audio AUD_CLKID_PDM_SYSCLK_SEL>;
> +		assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>,<&clkc_pll CLKID_HIFI_PLL>;
> +	};
> +	 acodec: audio-controller@1A000 {
> +		compatible = "amlogic,t9015";
> +		reg = <0x0 0x1A000 0x0 0x14>;
> +		#sound-dai-cells = <0>;
> +		sound-name-prefix = "ACODEC";
> +		clocks = <&clkc_periphs CLKID_ACODEC>;
> +		clock-names = "pclk";
> +		resets = <&reset RESET_ACODEC>;
> +	};
> +
> +};

-- 
Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201])
	(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 29F8A1C5D73;
	Mon, 13 Jan 2025 15:26:10 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736781971; cv=none; b=Nl5EhwsuG36JXtM9n2FORsmk2vg8WrRD7hWXRsLWYitb2cvz4BBRD+RiZlQkLcGJovOnGi926MO3ZhEfwPoQXcRrzPiz8PSMrnRr/TEKim8d5Dp7vGrMdA2KWuCOngDqH9AeG/Py9EXS5YDO5ZWZ2QV4D1MNC4REYXXlXNJVYsY=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736781971; c=relaxed/simple;
	bh=T7t+1Ze8yLQOWuB84xpWs3Ri1LIErbNg7RQFQV/TxUQ=;
	h=Date:Content-Type:MIME-Version:From:Cc:To:In-Reply-To:References:
	 Message-Id:Subject; b=NRaP06AkbEsYbRYffVDfToQzqj086PA3Go4RYpA25oqiJhKrGzFv14oeIb7TVPQU5IazeKG4Aw1bOtHdhZKk6ZSna4KRnVnLXTzvfSTCsZZH3v/F+H26uv73ixjRNWusK2fV1KjDH+Ng+Q4fjWlPtfIdSoy7bzn1gCU3PpvnrI4=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jYfqx2/Z; arc=none smtp.client-ip=10.30.226.201
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jYfqx2/Z"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 980F5C4CEE6;
	Mon, 13 Jan 2025 15:26:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1736781970;
	bh=T7t+1Ze8yLQOWuB84xpWs3Ri1LIErbNg7RQFQV/TxUQ=;
	h=Date:From:Cc:To:In-Reply-To:References:Subject:From;
	b=jYfqx2/Z4QGhBfoSDKllsJeP9TSCI17tpVC+pdmI+BN+iG1sGEOtdQGgrZIldw7wh
	 kHluGCOY0QaXSPFusc2eiQI4+bqmFDgr/mUud5vGEJGaA/CYoGYtWA8IdBsN+KojWS
	 /sggSFJ2hQw+t+BfLhsJWTFKNOCJU/2jb42LqVV6nrW/trDBNWHYZvw/Z6SLBcY5Dx
	 mKgqPiuJ8yFCE8nV4EzMPibJ+IUJ5km+9PlhM7lUkrMi3z+vyJ2zNkzq0+jGcqGraJ
	 w5wnBXBcPK8mSJg1InYS54PA/zwBDNgzdEWFZZ3GV1Fbn13B4cOC0S1Mwl0Ye+S+Kn
	 ssXo7DlFm3Tqg==
Date: Mon, 13 Jan 2025 09:26:09 -0600
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
From: "Rob Herring (Arm)" <robh@kernel.org>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>, 
 Mark Brown <broonie@kernel.org>, Kevin Hilman <khilman@baylibre.com>, 
 Jaroslav Kysela <perex@perex.cz>, linux-kernel@vger.kernel.org, 
 Conor Dooley <conor+dt@kernel.org>, Jerome Brunet <jbrunet@baylibre.com>, 
 devicetree@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>, 
 linux-arm-kernel@lists.infradead.org, 
 Krzysztof Kozlowski <krzk+dt@kernel.org>, Takashi Iwai <tiwai@suse.com>, 
 linux-amlogic@lists.infradead.org, linux-sound@vger.kernel.org, 
 Neil Armstrong <neil.armstrong@linaro.org>
To: jiebing chen <jiebing.chen@amlogic.com>
In-Reply-To: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
Message-Id: <173678161502.2153418.9839486392491673173.robh@kernel.org>
Subject: Re: [PATCH 0/3] Add support for S4 audio


On Mon, 13 Jan 2025 14:35:12 +0800, jiebing chen wrote:
> Add the tdmout pad control and tocodec control driver.
> 
> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
> ---
> jiebing chen (3):
>       ASoC: dt-bindings: Add Amlogic S4 audio
>       ASoC: meson: s4:support for the on-chip audio
>       arm64: dts: amlogic: Add Amlogic S4 Audio
> 
>  .../bindings/sound/amlogic,s4-tdmout-pad.yaml      |  36 ++
>  .../bindings/sound/amlogic,s4-tocodec.yaml         |  44 +++
>  .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts     | 226 ++++++++++++
>  arch/arm64/boot/dts/amlogic/meson-s4.dtsi          | 385 ++++++++++++++++++++-
>  sound/soc/meson/Kconfig                            |  16 +
>  sound/soc/meson/Makefile                           |   6 +
>  sound/soc/meson/s4-pad-out-control.c               | 372 ++++++++++++++++++++
>  sound/soc/meson/s4-tocodec-control.c               | 376 ++++++++++++++++++++
>  sound/soc/meson/t9015.c                            |   5 +-
>  9 files changed, 1461 insertions(+), 5 deletions(-)
> ---
> base-commit: 6ecd20965bdc21b265a0671ccf36d9ad8043f5ab
> change-id: 20250110-audio_drvier-07a5381c494b
> 
> Best regards,
> --
> jiebing chen <jiebing.chen@amlogic.com>
> 
> 
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/amlogic/' for 20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com:

arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-0: clock-names:0: 'sclk' was expected
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-0: clock-names:1: 'lrclk' was expected
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-0: clock-names:2: 'mclk' was expected
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-0: Unevaluated properties are not allowed ('clock-names' was unexpected)
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-1: clock-names:0: 'sclk' was expected
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-1: clock-names:1: 'lrclk' was expected
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-1: clock-names:2: 'mclk' was expected
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-1: Unevaluated properties are not allowed ('clock-names' was unexpected)
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-2: clock-names:0: 'sclk' was expected
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-2: clock-names:1: 'lrclk' was expected
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-2: clock-names:2: 'mclk' was expected
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller-2: Unevaluated properties are not allowed ('clock-names' was unexpected)
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: bus@fe000000: audio-controller@1A000: 'ranges' is a required property
	from schema $id: http://devicetree.org/schemas/simple-bus.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: bus@330000: audio-controller@E58: 'ranges' is a required property
	from schema $id: http://devicetree.org/schemas/simple-bus.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: clock-controller@0: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+'
	from schema $id: http://devicetree.org/schemas/clock/amlogic,axg-audio-clkc.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller@300: compatible: ['amlogic,sm1-tdmin', 'amlogic,axg-tdmin'] is too long
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller@340: compatible: ['amlogic,sm1-tdmin', 'amlogic,axg-tdmin'] is too long
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller@380: compatible: ['amlogic,sm1-tdmin', 'amlogic,axg-tdmin'] is too long
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller@3c0: compatible: ['amlogic,sm1-tdmin', 'amlogic,axg-tdmin'] is too long
	from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-controller@1A000: 'AVDD-supply' is a required property
	from schema $id: http://devicetree.org/schemas/sound/amlogic,t9015.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: audio-amplifier-0: '#sound-dai-cells' does not match any of the regexes: 'pinctrl-[0-9]+'
	from schema $id: http://devicetree.org/schemas/sound/simple-audio-amplifier.yaml#
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dtb: sound: 'anyOf' conditional failed, one must be fixed:
	'clocks' is a required property
	'#clock-cells' is a required property
	from schema $id: http://devicetree.org/schemas/clock/clock.yaml#






From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2108.outbound.protection.outlook.com [40.107.255.108])
	(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 8FD831C3BE0;
	Tue, 14 Jan 2025 08:16:49 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.108
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736842612; cv=fail; b=IfbgxPm+6o/epWLMxxELSjyj6NfrHaOd12xFWnS5FHRl156UPPRfO/P/hMzS3vG+DZoINuNgE49ZcWC+1C4JmDJVslDd7VgTfJkYFIEWJqL+W+tdB1b/rY0agdos9bo/jdrQibBtyVcWqoNkRhL4x2dN+ikS0GNAENKihYbdimw=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736842612; c=relaxed/simple;
	bh=NsOZC3Mbjq6gw4Xz5qRE+9YTUFx+CazX57df7uXmtf8=;
	h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=rdCwHA6hoFaza1g4zYj+C/mhAYGFYzPMhRUA1JJBZyTvj8uGQohSYzbcqiS61RFoTJm4C9U/tu3oYelrPhmjYK23p4mhrsbe821coACpSvcC24lOhYnyBNOxQXOdRxvMWUhzorNOp3WPvEK3ppxM/CJFyKr+owgv2f9M9A6mTDA=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=OzYaxzV2; arc=fail smtp.client-ip=40.107.255.108
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="OzYaxzV2"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Jeg9ywvzS6J/57AC09n4JmsglcPTPxwGbQLOkLIBP+vE56y2WT57ZR3Q+xjrf87wQAbtRy3COuppyhwjYBx+/f3BlUZaZvwZ6qTpM231npeLaynRBd+iKRHKHNUa+enrWVJaGDPf5fewCCOcCdEzuhrxX41qnadiQp5kpOoydyMRMDZ219NJe4L9C0TYH2zDESGoxD6o4TA9SDRJA3iAtMT2Vbmm0N3dLuMToV9sdDvU3DyIWQTdOsU/VtvRLSfDHqicdGCiLze/ynQgLmgbGZwKzNJDiHFGsdV+rbxKlZstHqVuqLiaV6iu7guQgpWeyf4bSCMcb4l0IChrpw7aSw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9fhS7QfUhH4AoZ36WNXl8ExkV4odwP47CWmn43y0d4E=;
 b=fayEQ0YHmLSr5dETVOmU94OJZTtbd1Nvs4nXN8WTcV16eBmqZSZv2NRHTEJ+kSCHUOmVPobLzPvhoatArCykK7X5Ao6T5Eh2JAslqFdH2vkf0nUfIas3k29fbwLXOIv9TVyv1YtmHNk14HTE01pTXIKUogLqLwNNTW2E9Fd57YIKw1QCFR4aimgORNKhjuKouL5CNLuaQOIG31GzSYnAk9WMc/dnKOWcQeHXi9ecWh8eMG5kwiPfUhXbp3CxAj+7D7rWMyDF8uVrxvMBhVkCDebfWSOeO2EvC+wnytovfCRgt6dFigaEaJ0ARTpCj1cofgTSuCr+j6kAWKg2qrFgvA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9fhS7QfUhH4AoZ36WNXl8ExkV4odwP47CWmn43y0d4E=;
 b=OzYaxzV2ARWFxDKtYoRt2s+GHW3AqKTgNqCqXcI41MkMM6UmCSUyr9lRckFFNTmyrsIJC5nQ9uFvg1PMWjQZXCPSYtXpK065meNogfy2PW7MjwyWY9qiy5CLknI+crCrngCTAJTVhV8mWXF6y/afkTEplkMT/0GXr6CR3uWgsR3y65bFdHU7pmQFL+53MuIABQwZpHercH8lOqkP3C6pR6Qb3hqqnGpirirNC1P8AYa783TaVvo1uo1AoIUc2lj8GwL3iXGRktkcobCn379brlVoOmtz3qarZPXnwwt+iGo+a3Ev32ZXAHKISFo2jFcIc5Jfp4/Y8pSML4IaoWEkSQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from SEYPR03MB7118.apcprd03.prod.outlook.com (2603:1096:101:d3::12)
 by TYZPR03MB7845.apcprd03.prod.outlook.com (2603:1096:400:44e::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.17; Tue, 14 Jan
 2025 08:16:45 +0000
Received: from SEYPR03MB7118.apcprd03.prod.outlook.com
 ([fe80::b748:89c0:9b9c:64d3]) by SEYPR03MB7118.apcprd03.prod.outlook.com
 ([fe80::b748:89c0:9b9c:64d3%7]) with mapi id 15.20.8335.017; Tue, 14 Jan 2025
 08:16:43 +0000
Message-ID: <e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
Date: Tue, 14 Jan 2025 16:16:39 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
To: Jerome Brunet <jbrunet@baylibre.com>,
 jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
 <1jwmey9451.fsf@starbuckisacylon.baylibre.com>
From: Jiebing Chen <jiebing.chen@amlogic.com>
In-Reply-To: <1jwmey9451.fsf@starbuckisacylon.baylibre.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: SI1PR02CA0011.apcprd02.prod.outlook.com
 (2603:1096:4:1f7::19) To SEYPR03MB7118.apcprd03.prod.outlook.com
 (2603:1096:101:d3::12)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SEYPR03MB7118:EE_|TYZPR03MB7845:EE_
X-MS-Office365-Filtering-Correlation-Id: 8f009f64-0577-4810-009a-08dd3473c7cd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?QWhIM2d5SlB6SDQrbHprVW9qVWNWTTFSMEltOW0rMlE1WER0STRLZ2tsVWlV?=
 =?utf-8?B?YmVLRkRSaXdUKzZydlptTHYvUVB5OTQ3bGYvcG1pbmZaSi8xdWNJc20vbXBz?=
 =?utf-8?B?VVdqTlk3clRvVWxYQWNlODRnZzFFckdUbjMyTUlsZGR6eG05TjBpUUd2dDJz?=
 =?utf-8?B?YXRFaU55VENvVjJBbWpkSUVuWjFINEUzODhwUXlBaUNKUGhSNzgzWnpXT2JS?=
 =?utf-8?B?MW5DcU1LTHhYSDBBcngxZGVIMzBaUkIyWHBnLzhBMndyMG1GbVl0VG9XekVv?=
 =?utf-8?B?TFZQN3AyZDVJb0UxSXd4dzYyTHN2a1dYdDl5a0h2TlhUQ0tEaTBSMGx5UTdN?=
 =?utf-8?B?a1p1WU0rK2NLTmU3R3ZGMW41enlvU1ovanlaWlA1MVVUc3BENW1GdUh6dkQv?=
 =?utf-8?B?emRlM0pqTFJaMDh6dkJEWjRzSmxJcHVtNHBpa01TV2FCUk53cThZZnJDczN6?=
 =?utf-8?B?WVBvc00yelJpY2VMTFpQU1FYaFIwZmVDbkJsY3RHb0Q4Y0pCVWY3NXJNeUpW?=
 =?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aTJiZ2RSQjgyd0NPKy9qaGpFR1JNLzh2ZEFwZm5pUC9K?=
 =?utf-8?B?MUowZFp2a25kVEV2Y3ZiNkd2VWZyOHpGWXJBUmpiVVF4eHZkMm9CbU42MGxK?=
 =?utf-8?B?NUJSMEswemc1RVg0TGh5bmJLbEw5Z2lRUU1BNk9yUzE3eUlNdUdzTWVpUVZS?=
 =?utf-8?B?dlBML0o2djVkYlZtYk9QVTYrS1ZYUnJXUFZZeXRBS2RHeVdIWENGUmlzTzRv?=
 =?utf-8?B?K2E4Q1U4VUNzQTRBL08zcGlqVE5mbkJKSlhuREw2WjM1MFc3QjlUTERMdU9D?=
 =?utf-8?B?T1ZvT3krQ08vMFFVNkpielRrUVZkTk1DU0FSRVk2S3ZQMTYzRGJtekR6UFZV?=
 =?utf-8?B?dTl4d2xqNUc2bzhtcUFZQURLa2R6dkVDZDQvVm43WGM3T3NWbENDTmRFK2tJ?=
 =?utf-8?B?MFdsd1g4eDVxVTUvZkpsR2tNcEpqeXpXNjBDSEQwK0dpd0VydmtpdUVqWE1U?=
 =?utf-8?Q?tP1qu5j9JmF8X?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEYPR03MB7118.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NkdXNGY0SGJ3Vk9KZHFoUFY0cEZjcEtScUlqa2szbk83MDMyQmFudUZ5b21h?=
 =?utf-8?B?U3FtanlkdjBpOU5iOWVFQmdRTlYrNCtGZ2dpcjI0Rm1qMDh4cWFlM2JIQm9o?=
 =?utf-8?B?TzdaWml5eXVtTnk1WklzM0VlclZWN2hTYkFOMEptZnRKSWx2VjRFK3phZ3A5?=
 =?utf-8?B?NmdOVnBPNHNTU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lvbFZCNUN4V1pMOWp3NjFqRnkzVFVXNFRjOWFpWmNQ?=
 =?utf-8?B?Y2IrMjVwcjRSMjI4cDNTNVp1VmNpZ2s5RGRCcW9qVlYrU0FGM1FJMDVkbXFx?=
 =?utf-8?B?V1Fwcnh2ajF6U0pZMlZVcmExOVBSRnlwRWdEQkdZZDZXZnZZZ1NaRXRqdjYr?=
 =?utf-8?B?cWpjUWxXQUJ3WlQyMFZsQmVWUlpBdW5NWnJtRnlKc3JtL1o0Z0p5TXpBUWlt?=
 =?utf-8?B?NFE9PQ==?=
X-OriginatorOrg: amlogic.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8f009f64-0577-4810-009a-08dd3473c7cd
X-MS-Exchange-CrossTenant-AuthSource: SEYPR03MB7118.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 08:16:43.6525
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UtkoJU2t1pckwlg5vHE2chlYgRjnND0SwJvYtudpdkQ8B7d4DIVsMdiyP+tMbKwoYri5ZN8yvCNX04w8QZQ9n8OTaBvGl2MKVIiIatz73Do=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR03MB7845


在 2025/1/13 22:31, Jerome Brunet 写道:
> [ EXTERNAL EMAIL ]
>
> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:
>
>> From: jiebing chen <jiebing.chen@amlogic.com>
>>
>> Add audio support for Amlogic S4.The audio output pad
>> can be freelycombined with the output lane,and the tocodec
>> control logic has been optimized.
> The patch is a mixture of different HW modules.
>
> Each patch should have one clear purpose and, as such, deal with a
> single HW module
>
>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>> ---
>>   sound/soc/meson/Kconfig              |  16 ++
>>   sound/soc/meson/Makefile             |   6 +
>>   sound/soc/meson/s4-pad-out-control.c | 372 ++++++++++++++++++++++++++++++++++
>>   sound/soc/meson/s4-tocodec-control.c | 376 +++++++++++++++++++++++++++++++++++
>>   sound/soc/meson/t9015.c              |   5 +-
>>   5 files changed, 771 insertions(+), 4 deletions(-)
>>
>> diff --git a/sound/soc/meson/Kconfig b/sound/soc/meson/Kconfig
>> index 6458d5dc4902f665211bb9e4ae7d274e4bff2fdc..d01e284642fd987cf4bdf88e5bf5f7c9a241af59 100644
>> --- a/sound/soc/meson/Kconfig
>> +++ b/sound/soc/meson/Kconfig
>> @@ -69,6 +69,8 @@ config SND_MESON_AXG_SOUND_CARD
>>        imply SND_MESON_AXG_SPDIFIN
>>        imply SND_MESON_AXG_PDM
>>        imply SND_MESON_G12A_TOACODEC
>> +     imply SND_SOC_MESON_PAD_OUT
>> +     imply SND_SOC_MESON_TOCODEC_CONTROL
>>        imply SND_MESON_G12A_TOHDMITX if DRM_MESON_DW_HDMI
>>        help
>>          Select Y or M to add support for the AXG SoC sound card
>> @@ -135,4 +137,18 @@ config SND_SOC_MESON_T9015
>>        help
>>          Say Y or M if you want to add support for the internal DAC found
>>          on GXL, G12 and SM1 SoC family.
>> +
>> +config SND_SOC_MESON_PAD_OUT
>> +     tristate "Amlogic PAD OUT"
>> +     select REGMAP_MMIO
>> +     help
>> +       Say Y or M if you want to add support for the S4 Audio Output from
>> +       the data Pad.
>> +
>> +config SND_SOC_MESON_TOCODEC_CONTROL
>> +     tristate "Amlogic TOCODEC CONTROL"
>> +     select REGMAP_MMIO
>> +     help
>> +      Say Y or M if you want to add support for the internal DAC control
>> +      on SM1 SoC family.
>>   endmenu
>> diff --git a/sound/soc/meson/Makefile b/sound/soc/meson/Makefile
>> index 24078e4396b02d545d8ba4bcb1632979001354e3..afbefcb1313670f9b1365e88b8eb1a0badd7dc1e 100644
>> --- a/sound/soc/meson/Makefile
>> +++ b/sound/soc/meson/Makefile
>> @@ -24,8 +24,11 @@ snd-soc-meson-codec-glue-y := meson-codec-glue.o
>>   snd-soc-meson-gx-sound-card-y := gx-card.o
>>   snd-soc-meson-g12a-toacodec-y := g12a-toacodec.o
>>   snd-soc-meson-g12a-tohdmitx-y := g12a-tohdmitx.o
>> +snd-soc-meson-s4-padout-objs := s4-pad-out-control.o
>> +snd-soc-meson-s4-tocodec-control-objs := s4-tocodec-control.o
>>   snd-soc-meson-t9015-y := t9015.o
>>
>> +
>>   obj-$(CONFIG_SND_MESON_AIU) += snd-soc-meson-aiu.o
>>   obj-$(CONFIG_SND_MESON_AXG_FIFO) += snd-soc-meson-axg-fifo.o
>>   obj-$(CONFIG_SND_MESON_AXG_FRDDR) += snd-soc-meson-axg-frddr.o
>> @@ -43,4 +46,7 @@ obj-$(CONFIG_SND_MESON_CODEC_GLUE) += snd-soc-meson-codec-glue.o
>>   obj-$(CONFIG_SND_MESON_GX_SOUND_CARD) += snd-soc-meson-gx-sound-card.o
>>   obj-$(CONFIG_SND_MESON_G12A_TOACODEC) += snd-soc-meson-g12a-toacodec.o
>>   obj-$(CONFIG_SND_MESON_G12A_TOHDMITX) += snd-soc-meson-g12a-tohdmitx.o
>> +obj-$(CONFIG_SND_SOC_MESON_PAD_OUT) += snd-soc-meson-s4-padout.o
>> +obj-$(CONFIG_SND_SOC_MESON_TOCODEC_CONTROL) += snd-soc-meson-s4-tocodec-control.o
>>   obj-$(CONFIG_SND_SOC_MESON_T9015) += snd-soc-meson-t9015.o
>> +
>> diff --git a/sound/soc/meson/s4-pad-out-control.c b/sound/soc/meson/s4-pad-out-control.c
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..a86dcf8a5995926f0ddf8d2911f42006daed0feb
>> --- /dev/null
>> +++ b/sound/soc/meson/s4-pad-out-control.c
>> @@ -0,0 +1,372 @@
>> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
>> +/*
>> + * Copyright (C) 2024 Amlogic, Inc. All rights reserved
>> + */
>> +
>> +#include <linux/module.h>
>> +#include <linux/of_platform.h>
>> +#include <linux/regmap.h>
>> +#include <sound/soc.h>
>> +#include <sound/soc-dai.h>
>> +#include <linux/init.h>
>> +#include <linux/kernel.h>
>> +#include<linux/kstrtox.h>
>> +
>> +#include "axg-tdm.h"
>> +
>> +static const struct regmap_config tdmout_pad_regmap_cfg = {
>> +     .reg_bits       = 32,
>> +     .val_bits       = 32,
>> +     .reg_stride     = 4,
>> +     .max_register   = 0x28,
>> +};
>> +
>> +#define TDM_IFACE 0
>> +#define TDM_A_PAD 0
>> +#define TDM_B_PAD 1
>> +#define TDM_C_PAD 2
>> +
>> +#define EE_AUDIO_DAT_PAD_CTRL6 0x0
>> +#define EE_AUDIO_DAT_PAD_CTRL7 0x4
>> +#define EE_AUDIO_DAT_PAD_CTRL8 0x8
>> +#define EE_AUDIO_DAT_PAD_CTRL9 0xc
>> +#define EE_AUDIO_DAT_PAD_CTRLA 0x10
>> +#define EE_AUDIO_DAT_PAD_CTRLB 0x14
>> +#define EE_AUDIO_DAT_PAD_CTRLC 0x1c
>> +#define EE_AUDIO_DAT_PAD_CTRLD 0x20
>> +#define EE_AUDIO_DAT_PAD_CTRLE 0x24
>> +#define EE_AUDIO_DAT_PAD_CTRLF 0x28
>> +
>> +#define REG_OFFSET 4
>> +
>> +static const char * const s4_tdmout_sel_texts[] = {
>> +     "TDM_D0", "TDM_D1", "TDM_D2", "TDM_D3", "TDM_D4", "TDM_D5", "TDM_D6", "TDM_D7",
>> +     "TDM_D8", "TDM_D9", "TDM_D10", "TDM_D11", "TDM_D12", "TDM_D13", "TDM_D14", "TDM_D15",
>> +     "TDM_D16", "TDM_D17", "TDM_D18", "TDM_D19", "TDM_D20", "TDM_D21", "TDM_D22", "TDM_D23",
>> +     "TDM_D24", "TDM_D25", "TDM_D26", "TDM_D27", "TDM_D28", "TDM_D29", "TDM_D30", "TDM_D31"
>> +};
> This thing does not belong in ASoC. This is clearly yet another layer of
> pinctrl. Please deal with it there.

Thanks for your suggestion, add audio pinctrl driver to control the which tdm_dx pin can map the which tdm lane_x
for example
	tdm_d6_pin {
		mux {
			groups = "tdm_d6";
			function = "tdmoutb_lane0";
		};
	}
tdm_d6 pin map the tdmoutb lane 0, right ?

>> +
>> +static const struct soc_enum tdmout_sel_enum =
>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tdmout_sel_texts),
>> +                     s4_tdmout_sel_texts);
>> +
>> +static struct snd_soc_dai *tdm_get_ahead_be(struct snd_soc_dapm_widget *w)
>> +{
>> +     struct snd_soc_dapm_path *p;
>> +     struct snd_soc_dai *be;
>> +
>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>> +             if (p->source->id == snd_soc_dapm_dai_in)
>> +                     return (struct snd_soc_dai *)p->source->priv;
>> +             be = tdm_get_ahead_be(p->source);
>> +             if (be && be->id == TDM_IFACE)
>> +                     return be;
>> +     }
>> +     return NULL;
>> +}
>> +
>> +#define SND_SOC_DAPM_DEMUX_E(wname, wreg, wshift, winvert, wcontrols, \
>> +     wevent, wflags) \
>> +((struct snd_soc_dapm_widget) { \
>> +     .id = snd_soc_dapm_demux, .name = wname, \
>> +     SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
>> +     .kcontrol_news = wcontrols, .num_kcontrols = 1, \
>> +     .event = wevent, .event_flags = wflags})
>> +
>> +static const struct snd_kcontrol_new tdmout_sel_demux[] = {
>> +     SOC_DAPM_ENUM("TDMOUTA SEL", tdmout_sel_enum),
>> +     SOC_DAPM_ENUM("TDMOUTB SEL", tdmout_sel_enum),
>> +     SOC_DAPM_ENUM("TDMOUTC SEL", tdmout_sel_enum),
>> +};
>> +
>> +static unsigned int aml_simple_strtoull(const char *cp)
>> +{
>> +     unsigned int result = 0;
>> +     unsigned int value = 0;
>> +     unsigned int len =  strlen(cp);
>> +
>> +     while (len != 0) {
>> +             len--;
>> +             value = isdigit(*cp);
>> +             if (value) {
>> +                     value = *cp - '0';
>> +             } else {
>> +                     cp++;
>> +                     continue;
>> +             }
>> +             cp++;
>> +             result = result * 10 + value;
>> +     }
>> +     return result;
>> +}
>> +
>> +static int tdm_out_pad_set(struct snd_soc_dapm_widget *w)
>> +{
>> +     struct snd_soc_dai *be;
>> +     struct axg_tdm_stream *stream;
>> +     struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
>> +     unsigned int tdm_id = TDM_A_PAD;
>> +     const char *dai_widget_name;
>> +     struct snd_soc_dapm_path *p;
>> +     unsigned int lane_num = 0;
>> +     unsigned long pin = 0;
>> +     unsigned int reg, mask, val = 0;
>> +     int lane_cnt;
>> +
>> +     be = tdm_get_ahead_be(w);
>> +     if (!be) {
>> +             dev_err(component->dev, "%s not find the be\n", __func__);
>> +             return -EINVAL;
>> +     }
>> +     stream = snd_soc_dai_dma_data_get_playback(be);
>> +     if (!stream) {
>> +             dev_err(component->dev, "%s not find the stream\n", __func__);
>> +             return -EINVAL;
>> +     }
>> +     lane_cnt = (stream->channels - 1) / stream->iface->slots + 1;
>> +     /*we like to use dai id, but it is fixed val*/
>> +     dai_widget_name = be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
>> +     if (strstr(dai_widget_name, "TDM_A"))
>> +             tdm_id = TDM_A_PAD;
>> +     else if (strstr(dai_widget_name, "TDM_B"))
>> +             tdm_id = TDM_B_PAD;
>> +     else if (strstr(dai_widget_name, "TDM_C"))
>> +             tdm_id = TDM_C_PAD;
>> +     else
>> +             dev_err(component->dev, "%s not find the be dai widget\n", __func__);
>> +     dev_dbg(component->dev, "tdm_id:%d, channel:%d, slot:%d\n",
>> +             tdm_id, stream->channels, stream->iface->slots);
>> +     snd_soc_dapm_widget_for_each_sink_path(w, p) {
>> +             if (p->sink->id == snd_soc_dapm_output) {
>> +                     if (p->connect) {
>> +                             pin = aml_simple_strtoull(p->name);
>> +                             reg = (pin / 4) * REG_OFFSET;
>> +                             /*calculate mask pos */
>> +                             mask = 0x1f << ((pin % 4) * 8);
>> +                             val = tdm_id * 8 + lane_num;
>> +                             snd_soc_component_update_bits(component, reg, mask, val);
>> +                             snd_soc_component_update_bits(component, EE_AUDIO_DAT_PAD_CTRLF,
>> +                                                           0x1 << pin, 0 << pin);
>> +                             lane_num++;
>> +                             if (lane_num > lane_cnt - 1)
>> +                                     break;
>> +                     }
>> +             }
>> +     }
>> +     return 0;
>> +}
>> +
>> +static int tdmout_sel_pad_event(struct snd_soc_dapm_widget *w,
>> +                             struct snd_kcontrol *control,
>> +                             int event)
>> +{
>> +     int ret = 0;
>> +     struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
>> +
>> +     switch (event) {
>> +     case SND_SOC_DAPM_PRE_PMU:
>> +             tdm_out_pad_set(w);
>> +             break;
>> +
>> +     case SND_SOC_DAPM_PRE_PMD:
>> +             break;
>> +
>> +     default:
>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>> +             return -EINVAL;
>> +     }
>> +
>> +     return ret;
>> +}
>> +
>> +static const struct snd_soc_dapm_widget s4_tdmout_pad_dapm_widgets[] = {
>> +     SND_SOC_DAPM_DEMUX_E("TDMA_OUT SEL", SND_SOC_NOPM, 0, 0,
>> +                          &tdmout_sel_demux[TDM_A_PAD], tdmout_sel_pad_event,
>> +                        (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
>> +     SND_SOC_DAPM_DEMUX_E("TDMB_OUT SEL", SND_SOC_NOPM, 0, 0,
>> +                          &tdmout_sel_demux[TDM_B_PAD], tdmout_sel_pad_event,
>> +                        (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
>> +     SND_SOC_DAPM_DEMUX_E("TDMC_OUT SEL", SND_SOC_NOPM, 0, 0,
>> +                          &tdmout_sel_demux[TDM_C_PAD], tdmout_sel_pad_event,
>> +                        (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D0"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D1"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D2"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D3"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D4"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D5"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D6"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D7"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D8"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D9"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D10"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D11"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D12"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D13"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D14"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D15"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D16"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D17"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D18"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D19"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D20"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D21"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D22"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D23"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D24"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D25"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D26"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D27"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D28"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D29"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D30"),
>> +     SND_SOC_DAPM_OUTPUT("TDM_D31"),
>> +};
>> +
>> +static const struct snd_soc_dapm_route s4_tdmout_pad_dapm_routes[] = {
>> +     { "TDM_D0", "TDM_D0", "TDMA_OUT SEL" },
>> +     { "TDM_D1", "TDM_D1", "TDMA_OUT SEL" },
>> +     { "TDM_D2", "TDM_D2", "TDMA_OUT SEL" },
>> +     { "TDM_D3", "TDM_D3", "TDMA_OUT SEL" },
>> +     { "TDM_D4", "TDM_D4", "TDMA_OUT SEL" },
>> +     { "TDM_D5", "TDM_D5", "TDMA_OUT SEL" },
>> +     { "TDM_D6", "TDM_D6", "TDMA_OUT SEL" },
>> +     { "TDM_D7", "TDM_D7", "TDMA_OUT SEL" },
>> +     { "TDM_D8", "TDM_D8", "TDMA_OUT SEL" },
>> +     { "TDM_D9", "TDM_D9", "TDMA_OUT SEL" },
>> +     { "TDM_D10", "TDM_D10", "TDMA_OUT SEL" },
>> +     { "TDM_D11", "TDM_D11", "TDMA_OUT SEL" },
>> +     { "TDM_D12", "TDM_D12", "TDMA_OUT SEL" },
>> +     { "TDM_D13", "TDM_D13", "TDMA_OUT SEL" },
>> +     { "TDM_D14", "TDM_D14", "TDMA_OUT SEL" },
>> +     { "TDM_D15", "TDM_D15", "TDMA_OUT SEL" },
>> +     { "TDM_D16", "TDM_D16", "TDMA_OUT SEL" },
>> +     { "TDM_D17", "TDM_D17", "TDMA_OUT SEL" },
>> +     { "TDM_D18", "TDM_D18", "TDMA_OUT SEL" },
>> +     { "TDM_D19", "TDM_D19", "TDMA_OUT SEL" },
>> +     { "TDM_D20", "TDM_D20", "TDMA_OUT SEL" },
>> +     { "TDM_D21", "TDM_D21", "TDMA_OUT SEL" },
>> +     { "TDM_D22", "TDM_D22", "TDMA_OUT SEL" },
>> +     { "TDM_D23", "TDM_D23", "TDMA_OUT SEL" },
>> +     { "TDM_D24", "TDM_D24", "TDMA_OUT SEL" },
>> +     { "TDM_D25", "TDM_D25", "TDMA_OUT SEL" },
>> +     { "TDM_D26", "TDM_D26", "TDMA_OUT SEL" },
>> +     { "TDM_D27", "TDM_D27", "TDMA_OUT SEL" },
>> +     { "TDM_D28", "TDM_D28", "TDMA_OUT SEL" },
>> +     { "TDM_D29", "TDM_D29", "TDMA_OUT SEL" },
>> +     { "TDM_D30", "TDM_D30", "TDMA_OUT SEL" },
>> +     { "TDM_D31", "TDM_D31", "TDMA_OUT SEL" },
>> +     { "TDM_D0", "TDM_D0", "TDMB_OUT SEL" },
>> +     { "TDM_D1", "TDM_D1", "TDMB_OUT SEL" },
>> +     { "TDM_D2", "TDM_D2", "TDMB_OUT SEL" },
>> +     { "TDM_D3", "TDM_D3", "TDMB_OUT SEL" },
>> +     { "TDM_D4", "TDM_D4", "TDMB_OUT SEL" },
>> +     { "TDM_D5", "TDM_D5", "TDMB_OUT SEL" },
>> +     { "TDM_D6", "TDM_D6", "TDMB_OUT SEL" },
>> +     { "TDM_D7", "TDM_D7", "TDMB_OUT SEL" },
>> +     { "TDM_D8", "TDM_D8", "TDMB_OUT SEL" },
>> +     { "TDM_D9", "TDM_D9", "TDMB_OUT SEL" },
>> +     { "TDM_D10", "TDM_D10", "TDMB_OUT SEL" },
>> +     { "TDM_D11", "TDM_D11", "TDMB_OUT SEL" },
>> +     { "TDM_D12", "TDM_D12", "TDMB_OUT SEL" },
>> +     { "TDM_D13", "TDM_D13", "TDMB_OUT SEL" },
>> +     { "TDM_D14", "TDM_D14", "TDMB_OUT SEL" },
>> +     { "TDM_D15", "TDM_D15", "TDMB_OUT SEL" },
>> +
>> +     { "TDM_D16", "TDM_D16", "TDMB_OUT SEL" },
>> +     { "TDM_D17", "TDM_D17", "TDMB_OUT SEL" },
>> +     { "TDM_D18", "TDM_D18", "TDMB_OUT SEL" },
>> +     { "TDM_D19", "TDM_D19", "TDMB_OUT SEL" },
>> +     { "TDM_D20", "TDM_D20", "TDMB_OUT SEL" },
>> +     { "TDM_D21", "TDM_D21", "TDMB_OUT SEL" },
>> +     { "TDM_D22", "TDM_D22", "TDMB_OUT SEL" },
>> +     { "TDM_D23", "TDM_D23", "TDMB_OUT SEL" },
>> +     { "TDM_D24", "TDM_D24", "TDMB_OUT SEL" },
>> +     { "TDM_D25", "TDM_D25", "TDMB_OUT SEL" },
>> +     { "TDM_D26", "TDM_D26", "TDMB_OUT SEL" },
>> +     { "TDM_D27", "TDM_D27", "TDMB_OUT SEL" },
>> +     { "TDM_D28", "TDM_D28", "TDMB_OUT SEL" },
>> +     { "TDM_D29", "TDM_D29", "TDMB_OUT SEL" },
>> +     { "TDM_D30", "TDM_D30", "TDMB_OUT SEL" },
>> +     { "TDM_D31", "TDM_D31", "TDMB_OUT SEL" },
>> +     { "TDM_D0", "TDM_D0", "TDMC_OUT SEL" },
>> +     { "TDM_D1", "TDM_D1", "TDMC_OUT SEL" },
>> +     { "TDM_D2", "TDM_D2", "TDMC_OUT SEL" },
>> +     { "TDM_D3", "TDM_D3", "TDMC_OUT SEL" },
>> +     { "TDM_D4", "TDM_D4", "TDMC_OUT SEL" },
>> +     { "TDM_D5", "TDM_D5", "TDMC_OUT SEL" },
>> +     { "TDM_D6", "TDM_D6", "TDMC_OUT SEL" },
>> +     { "TDM_D7", "TDM_D7", "TDMC_OUT SEL" },
>> +     { "TDM_D8", "TDM_D8", "TDMC_OUT SEL" },
>> +     { "TDM_D9", "TDM_D9", "TDMC_OUT SEL" },
>> +     { "TDM_D10", "TDM_D10", "TDMC_OUT SEL" },
>> +     { "TDM_D11", "TDM_D11", "TDMC_OUT SEL" },
>> +     { "TDM_D12", "TDM_D12", "TDMC_OUT SEL" },
>> +     { "TDM_D13", "TDM_D13", "TDMC_OUT SEL" },
>> +     { "TDM_D14", "TDM_D14", "TDMC_OUT SEL" },
>> +     { "TDM_D15", "TDM_D15", "TDMC_OUT SEL" },
>> +     { "TDM_D16", "TDM_D16", "TDMC_OUT SEL" },
>> +     { "TDM_D17", "TDM_D17", "TDMC_OUT SEL" },
>> +     { "TDM_D18", "TDM_D18", "TDMC_OUT SEL" },
>> +     { "TDM_D19", "TDM_D19", "TDMC_OUT SEL" },
>> +     { "TDM_D20", "TDM_D20", "TDMC_OUT SEL" },
>> +     { "TDM_D21", "TDM_D21", "TDMC_OUT SEL" },
>> +     { "TDM_D22", "TDM_D22", "TDMC_OUT SEL" },
>> +     { "TDM_D23", "TDM_D23", "TDMC_OUT SEL" },
>> +     { "TDM_D24", "TDM_D24", "TDMC_OUT SEL" },
>> +     { "TDM_D25", "TDM_D25", "TDMC_OUT SEL" },
>> +     { "TDM_D26", "TDM_D26", "TDMC_OUT SEL" },
>> +     { "TDM_D27", "TDM_D27", "TDMC_OUT SEL" },
>> +     { "TDM_D28", "TDM_D28", "TDMC_OUT SEL" },
>> +     { "TDM_D29", "TDM_D29", "TDMC_OUT SEL" },
>> +     { "TDM_D30", "TDM_D30", "TDMC_OUT SEL" },
>> +     { "TDM_D31", "TDM_D31", "TDMC_OUT SEL" },
>> +};
>> +
>> +static const struct snd_soc_component_driver s4_tdmout_pad_component_drv = {
>> +     .dapm_widgets           = s4_tdmout_pad_dapm_widgets,
>> +     .num_dapm_widgets       = ARRAY_SIZE(s4_tdmout_pad_dapm_widgets),
>> +     .dapm_routes            = s4_tdmout_pad_dapm_routes,
>> +     .num_dapm_routes        = ARRAY_SIZE(s4_tdmout_pad_dapm_routes),
>> +
>> +};
>> +
>> +static const struct of_device_id s4_tdmout_pad_of_match[] = {
>> +     {
>> +             .compatible = "amlogic,s4-tdmout-pad",
>> +     }, {}
>> +};
>> +
>> +MODULE_DEVICE_TABLE(of, s4_tdmout_pad_of_match);
>> +
>> +static int tdm_pad_out_probe(struct platform_device *pdev)
>> +{
>> +     struct device *dev = &pdev->dev;
>> +     struct regmap *map;
>> +     void __iomem *regs;
>> +
>> +     regs = devm_platform_ioremap_resource(pdev, 0);
>> +     if (IS_ERR(regs))
>> +             return PTR_ERR(regs);
>> +
>> +     map = devm_regmap_init_mmio(dev, regs, &tdmout_pad_regmap_cfg);
>> +     if (IS_ERR(map))
>> +             return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap\n");
>> +
>> +     return devm_snd_soc_register_component(dev, &s4_tdmout_pad_component_drv,
>> +                                            NULL, 0);
>> +}
>> +
>> +static struct platform_driver tdmout_pad_pdrv = {
>> +     .probe = tdm_pad_out_probe,
>> +     .driver = {
>> +             .name = "s4-pad-out",
>> +             .of_match_table = s4_tdmout_pad_of_match,
>> +     },
>> +};
>> +
>> +module_platform_driver(tdmout_pad_pdrv);
>> +
>> +MODULE_DESCRIPTION("Amlogic TDM PAD DRIVER");
>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>> +MODULE_LICENSE("GPL");
>> diff --git a/sound/soc/meson/s4-tocodec-control.c b/sound/soc/meson/s4-tocodec-control.c
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..e5d824fae0eba545d38dc36e2566e7cee590e7f5
>> --- /dev/null
>> +++ b/sound/soc/meson/s4-tocodec-control.c
> There is already a to-acodec driver a not reason has been provided as to why a
> completly new driver is required.
>
> Please have look at the existing driver and do try to use it.
> If you need to do things so differently, clear justification are necessary.

for g12a-toacodec.c, we find the tocodec clock source can't get 
the clock id from the tdm Be device,

and set it by the kcontrol from user,  For different soc chips, The 
kcontrol value maybe different, The kcontrol configuration doesn't look 
very friendly for user

so we use dapm route path to manage it, 
fe(fddr)->be(tdm)->(tocodec)->(codec),  and use the aux-devs to 
register,  and sound card only include the

sound-dai = <&tdmif_a>

codec-0 {
                 sound-dai = <&acodec>;
  };

and not include

codec-1 {
                 sound-dai = <&toacodec>;
  };

when tdm work, only connect the tocodec path

  "TDM_A Playback" ->"TOACODEC TDMA"->"TOACODEC INPUT SRC"

iterate it find the be device ,and get the struct axg_tdm_stream, so we 
can get the tdm clock id

Take into account behavioral differences, we add new tocodec driver for s4

>> @@ -0,0 +1,376 @@
>> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
>> +/*
>> + * Copyright (C) 2023 Amlogic, Inc. All rights reserved
>> + */
>> +
>> +#include <linux/module.h>
>> +#include <linux/of_platform.h>
>> +#include <linux/regmap.h>
>> +#include <sound/soc.h>
>> +#include <sound/soc-dai.h>
>> +#include <linux/init.h>
>> +#include <linux/kernel.h>
>> +#include<linux/kstrtox.h>
>> +#include <linux/clk-provider.h>
>> +#include <linux/reset.h>
>> +#include "axg-tdm.h"
>> +
>> +#define TOACODEC_CTRL0                       0x0
>> +
>> +#define CTRL0_ENABLE_SHIFT           31
>> +#define CTRL0_BCLK_ENABLE_SHIFT              30
>> +#define CTRL0_MCLK_ENABLE_SHIFT              29
>> +#define CTRL0_BLK_CAP_INV_SHIFT              9
>> +
>> +#define TDM_IFACE 0
>> +#define TDM_A_PAD 0
>> +#define TDM_B_PAD 1
>> +#define TDM_C_PAD 2
>> +
>> +struct toacodec {
>> +     struct regmap_field *field_dat_sel;
>> +     struct regmap_field *field_lrclk_sel;
>> +     struct regmap_field *field_bclk_sel;
>> +     struct regmap_field *field_mclk_sel;
>> +};
>> +
>> +struct toacodec_match_data {
>> +     const struct snd_soc_component_driver *component_drv;
>> +     const struct reg_field field_dat_sel;
>> +     const struct reg_field field_lrclk_sel;
>> +     const struct reg_field field_bclk_sel;
>> +     const struct reg_field field_mclk_sel;
>> +};
>> +
>> +static const struct regmap_config tocodec_regmap_cfg = {
>> +     .reg_bits       = 32,
>> +     .val_bits       = 32,
>> +     .reg_stride     = 4,
>> +     .max_register   = 0x1,
>> +};
>> +
>> +#define S4_LANE_OFFSET 8
>> +
>> +static const char * const s4_tocodec_lane_sel_texts[] = {
>> +     "Lane0", "Lane1", "Lane2", "Lane3", "Lane4", "Lane5", "Lane6", "Lane7"
>> +};
>> +
>> +static const struct soc_enum s4_tocodec_lane_sel_enum =
>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_lane_sel_texts),
>> +                     s4_tocodec_lane_sel_texts);
>> +
>> +static const struct snd_kcontrol_new s4_tocodec_lane_sel =
>> +     SOC_DAPM_ENUM("TOCODEC LANE SEL", s4_tocodec_lane_sel_enum);
>> +
>> +static const char * const s4_tocodec_src_sel_texts[] = {
>> +     "TDMA", "TDMB", "TDMC"
>> +};
>> +
>> +static const struct soc_enum s4_tocodec_src_sel_enum =
>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_src_sel_texts),
>> +                     s4_tocodec_src_sel_texts);
>> +
>> +static const struct snd_kcontrol_new s4_tocodec_src_sel =
>> +     SOC_DAPM_ENUM("TOCODEC SEL", s4_tocodec_src_sel_enum);
>> +
>> +static const struct snd_kcontrol_new s4_toacodec_out_enable =
>> +     SOC_DAPM_SINGLE_AUTODISABLE("Switch", TOACODEC_CTRL0,
>> +                                 CTRL0_ENABLE_SHIFT, 1, 0);
>> +
>> +static struct snd_soc_dai *tocodec_tdm_get_ahead_be(struct snd_soc_dapm_widget *w)
>> +{
>> +     struct snd_soc_dapm_path *p;
>> +     struct snd_soc_dai *be;
>> +
>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>> +             if (!p->connect)
>> +                     continue;
>> +             if (p->source->id == snd_soc_dapm_dai_in)
>> +                     return (struct snd_soc_dai *)p->source->priv;
>> +             be = tocodec_tdm_get_ahead_be(p->source);
>> +             if (be && be->id == TDM_IFACE)
>> +                     return be;
>> +     }
>> +     return NULL;
>> +}
>> +
>> +static unsigned int aml_simple_strtoull(const char *cp)
>> +{
>> +     unsigned int result = 0;
>> +     unsigned int value = 0;
>> +     unsigned int len = strlen(cp);
>> +
>> +     while (len != 0) {
>> +             len--;
>> +             value = isdigit(*cp);
>> +             if (value) {
>> +                     value = *cp - '0';
>> +             } else {
>> +                     cp++;
>> +                     continue;
>> +             }
>> +             cp++;
>> +             result = result * 10 + value;
>> +     }
>> +     return result;
>> +}
>> +
>> +static int aml_get_clk_id(const char *name)
>> +{
>> +     int clk_id = 0;
>> +
>> +     if (strstr(name, "mst_a"))
>> +             clk_id = 0;
>> +     else if (strstr(name, "mst_b"))
>> +             clk_id = 1;
>> +     else if (strstr(name, "mst_c"))
>> +             clk_id = 2;
>> +     else if (strstr(name, "mst_d"))
>> +             clk_id = 3;
>> +     else if (strstr(name, "mst_e"))
>> +             clk_id = 4;
>> +     else if (strstr(name, "mst_f"))
>> +             clk_id = 5;
>> +
>> +     return clk_id;
>> +}
>> +
>> +static int aml_tocodec_sel_set(struct snd_soc_dapm_widget *w)
>> +{
>> +     struct snd_soc_dai *be;
>> +     struct axg_tdm_stream *stream;
>> +     struct axg_tdm_iface *iface;
>> +     struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
>> +     struct toacodec *priv = snd_soc_component_get_drvdata(component);
>> +     unsigned int tdm_id = TDM_A_PAD;
>> +     const char *dai_widget_name;
>> +     struct snd_soc_dapm_path *p;
>> +     unsigned int lane = 0;
>> +     unsigned int val = 0;
>> +     struct clk *sclk, *mclk;
>> +     char *clk_name;
>> +     int mclk_id, sclk_id;
>> +
>> +     be = tocodec_tdm_get_ahead_be(w);
>> +     if (!be) {
>> +             dev_err(component->dev, "%s not find the be\n", __func__);
>> +             return -EINVAL;
>> +     }
>> +     stream = snd_soc_dai_dma_data_get_playback(be);
>> +     if (!stream) {
>> +             dev_err(component->dev, "%s not find the stream\n", __func__);
>> +             return -EINVAL;
>> +     }
>> +     /*we like to use dai id, but it is fixed val*/
>> +     dai_widget_name = be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
>> +     if (strstr(dai_widget_name, "TDM_A"))
>> +             tdm_id = TDM_A_PAD;
>> +     else if (strstr(dai_widget_name, "TDM_B"))
>> +             tdm_id = TDM_B_PAD;
>> +     else if (strstr(dai_widget_name, "TDM_C"))
>> +             tdm_id = TDM_C_PAD;
>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>> +             if (p->connect && p->name) {
>> +                     lane = aml_simple_strtoull(p->name);
>> +                     val = lane + tdm_id * S4_LANE_OFFSET;
>> +                     regmap_field_write(priv->field_dat_sel, val);
>> +             }
>> +     }
>> +     iface = stream->iface;
>> +     mclk = iface->mclk;
>> +     sclk = iface->sclk;
>> +     mclk_id = aml_get_clk_id(__clk_get_name(mclk));
>> +     sclk_id = aml_get_clk_id(__clk_get_name(sclk));
>> +     regmap_field_write(priv->field_mclk_sel, mclk_id);
>> +     regmap_field_write(priv->field_bclk_sel, sclk_id);
>> +     regmap_field_write(priv->field_lrclk_sel, sclk_id);
>> +
>> +     return 0;
>> +}
>> +
>> +static int tocodec_sel_event(struct snd_soc_dapm_widget *w,
>> +                          struct snd_kcontrol *control,
>> +                          int event)
>> +{
>> +     struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
>> +     int ret = 0;
>> +
>> +     switch (event) {
>> +     case SND_SOC_DAPM_PRE_PMU:
>> +             ret = aml_tocodec_sel_set(w);
>> +             break;
>> +
>> +     case SND_SOC_DAPM_PRE_PMD:
>> +             break;
>> +
>> +     default:
>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>> +             return -EINVAL;
>> +     }
>> +
>> +     return ret;
>> +}
>> +
>> +static int tocodec_clk_enable(struct snd_soc_dapm_widget *w,
>> +                           struct snd_kcontrol *control,
>> +                           int event)
>> +{
>> +     int ret = 0;
>> +     unsigned int mask = 0, val = 0;
>> +     struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
>> +
>> +     snd_soc_component_update_bits(component, TOACODEC_CTRL0,
>> +                                   1 << CTRL0_BLK_CAP_INV_SHIFT, 1 << CTRL0_BLK_CAP_INV_SHIFT);
>> +     switch (event) {
>> +     case SND_SOC_DAPM_PRE_PMU:
>> +             mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
>> +             val = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
>> +             snd_soc_component_update_bits(component, TOACODEC_CTRL0, mask, val);
>> +             break;
>> +     case SND_SOC_DAPM_PRE_PMD:
>> +             mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
>> +             val = 0 << CTRL0_MCLK_ENABLE_SHIFT | 0 << CTRL0_BCLK_ENABLE_SHIFT;
>> +             snd_soc_component_update_bits(component, TOACODEC_CTRL0, mask, val);
>> +             break;
>> +     default:
>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>> +             return -EINVAL;
>> +     }
>> +
>> +     return ret;
>> +}
>> +
>> +static const struct snd_soc_dapm_widget s4_toacodec_widgets[] = {
>> +     SND_SOC_DAPM_MUX_E("Lane SRC", SND_SOC_NOPM, 0, 0,
>> +                        &s4_tocodec_lane_sel, tocodec_sel_event,
>> +                        (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
>> +     SND_SOC_DAPM_MUX("INPUT SRC", SND_SOC_NOPM, 0, 0, &s4_tocodec_src_sel),
>> +     SND_SOC_DAPM_SWITCH_E("OUT EN", SND_SOC_NOPM, 0, 0,
>> +                           &s4_toacodec_out_enable, tocodec_clk_enable,
>> +                             (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
>> +     SND_SOC_DAPM_AIF_IN("TDMA", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +     SND_SOC_DAPM_AIF_IN("TDMB", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +     SND_SOC_DAPM_AIF_IN("TDMC", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +     SND_SOC_DAPM_OUT_DRV("Lane0", SND_SOC_NOPM, 0, 0, NULL, 0),
>> +     SND_SOC_DAPM_OUT_DRV("Lane1", SND_SOC_NOPM, 0, 0, NULL, 0),
>> +     SND_SOC_DAPM_OUT_DRV("Lane2", SND_SOC_NOPM, 0, 0, NULL, 0),
>> +     SND_SOC_DAPM_OUT_DRV("Lane3", SND_SOC_NOPM, 0, 0, NULL, 0),
>> +     SND_SOC_DAPM_OUT_DRV("Lane4", SND_SOC_NOPM, 0, 0, NULL, 0),
>> +     SND_SOC_DAPM_OUT_DRV("Lane5", SND_SOC_NOPM, 0, 0, NULL, 0),
>> +     SND_SOC_DAPM_OUT_DRV("Lane6", SND_SOC_NOPM, 0, 0, NULL, 0),
>> +     SND_SOC_DAPM_OUT_DRV("Lane7", SND_SOC_NOPM, 0, 0, NULL, 0),
>> +     SND_SOC_DAPM_OUTPUT("TDM_TO_ACODEC"),
>> +};
>> +
>> +static const struct snd_soc_dapm_route s4_tocodec_dapm_routes[] = {
>> +     { "INPUT SRC", "TDMA", "TDMA"},
>> +     { "INPUT SRC", "TDMB", "TDMB"},
>> +     { "INPUT SRC", "TDMC", "TDMC"},
>> +     { "Lane0", NULL, "INPUT SRC" },
>> +     { "Lane1", NULL, "INPUT SRC"},
>> +     { "Lane2", NULL, "INPUT SRC"},
>> +     { "Lane3", NULL, "INPUT SRC"},
>> +     { "Lane4", NULL, "INPUT SRC"},
>> +     { "Lane5", NULL, "INPUT SRC"},
>> +     { "Lane6", NULL, "INPUT SRC"},
>> +     { "Lane7", NULL, "INPUT SRC"},
>> +     { "Lane SRC", "Lane0", "Lane0"},
>> +     { "Lane SRC", "Lane1", "Lane1"},
>> +     { "Lane SRC", "Lane2", "Lane2"},
>> +     { "Lane SRC", "Lane3", "Lane3"},
>> +     { "Lane SRC", "Lane4", "Lane4"},
>> +     { "Lane SRC", "Lane5", "Lane5"},
>> +     { "Lane SRC", "Lane6", "Lane6"},
>> +     { "Lane SRC", "Lane7", "Lane7"},
>> +     { "OUT EN", "Switch", "Lane SRC"},
>> +     { "TDM_TO_ACODEC", NULL, "OUT EN"},
>> +
>> +};
>> +
>> +static const struct snd_soc_component_driver s4_tocodec_component_drv = {
>> +     .dapm_widgets           = s4_toacodec_widgets,
>> +     .num_dapm_widgets       = ARRAY_SIZE(s4_toacodec_widgets),
>> +     .dapm_routes            = s4_tocodec_dapm_routes,
>> +     .num_dapm_routes        = ARRAY_SIZE(s4_tocodec_dapm_routes),
>> +};
>> +
>> +static const struct toacodec_match_data s4_toacodec_match_data = {
>> +     .component_drv  = &s4_tocodec_component_drv,
>> +     .field_dat_sel  = REG_FIELD(TOACODEC_CTRL0, 16, 20),
>> +     .field_lrclk_sel = REG_FIELD(TOACODEC_CTRL0, 12, 14),
>> +     .field_bclk_sel = REG_FIELD(TOACODEC_CTRL0, 4, 6),
>> +     .field_mclk_sel = REG_FIELD(TOACODEC_CTRL0, 0, 2),
>> +};
>> +
>> +static const struct of_device_id s4_tocodec_of_match[] = {
>> +     {
>> +             .compatible = "amlogic,s4-tocodec",
>> +             .data = &s4_toacodec_match_data,
>> +     }, {}
>> +};
>> +
>> +MODULE_DEVICE_TABLE(of, s4_tocodec_of_match);
>> +
>> +static int tocodec_probe(struct platform_device *pdev)
>> +{
>> +     const struct toacodec_match_data *data;
>> +     struct device *dev = &pdev->dev;
>> +     struct toacodec *priv;
>> +     void __iomem *regs;
>> +     struct regmap *map;
>> +     int ret;
>> +
>> +     data = device_get_match_data(dev);
>> +     if (!data)
>> +             return dev_err_probe(dev, -ENODEV, "failed to match device\n");
>> +     priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>> +     if (!priv)
>> +             return -ENOMEM;
>> +
>> +     platform_set_drvdata(pdev, priv);
>> +
>> +     ret = device_reset(dev);
>> +     if (ret)
>> +             return ret;
>> +
>> +     regs = devm_platform_ioremap_resource(pdev, 0);
>> +     if (IS_ERR(regs))
>> +             return PTR_ERR(regs);
>> +
>> +     map = devm_regmap_init_mmio(dev, regs, &tocodec_regmap_cfg);
>> +     if (IS_ERR(map))
>> +             return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap\n");
>> +
>> +     priv->field_dat_sel = devm_regmap_field_alloc(dev, map, data->field_dat_sel);
>> +     if (IS_ERR(priv->field_dat_sel))
>> +             return PTR_ERR(priv->field_dat_sel);
>> +
>> +     priv->field_lrclk_sel = devm_regmap_field_alloc(dev, map, data->field_lrclk_sel);
>> +     if (IS_ERR(priv->field_lrclk_sel))
>> +             return PTR_ERR(priv->field_lrclk_sel);
>> +
>> +     priv->field_bclk_sel = devm_regmap_field_alloc(dev, map, data->field_bclk_sel);
>> +     if (IS_ERR(priv->field_bclk_sel))
>> +             return PTR_ERR(priv->field_bclk_sel);
>> +
>> +     priv->field_mclk_sel = devm_regmap_field_alloc(dev, map, data->field_mclk_sel);
>> +     if (IS_ERR(priv->field_mclk_sel))
>> +             return PTR_ERR(priv->field_mclk_sel);
>> +
>> +     return devm_snd_soc_register_component(dev,
>> +                     data->component_drv, NULL, 0);
>> +}
>> +
>> +static struct platform_driver tocodec_pdrv = {
>> +     .probe = tocodec_probe,
>> +     .driver = {
>> +             .name = "s4-tocodec",
>> +             .of_match_table = s4_tocodec_of_match,
>> +     },
>> +};
>> +
>> +module_platform_driver(tocodec_pdrv);
>> +
>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>> +MODULE_LICENSE("GPL");
>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>> index 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648 100644
>> --- a/sound/soc/meson/t9015.c
>> +++ b/sound/soc/meson/t9015.c
>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
>>                .channels_min = 1,
>>                .channels_max = 2,
>>                .rates = SNDRV_PCM_RATE_8000_96000,
>> -             .formats = (SNDRV_PCM_FMTBIT_S8 |
>> -                         SNDRV_PCM_FMTBIT_S16_LE |
>> -                         SNDRV_PCM_FMTBIT_S20_LE |
>> -                         SNDRV_PCM_FMTBIT_S24_LE),
>> +             .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE),
> Again, mixed up changes with zero justification.
>
> This drops S8 and S16 format support for the existing SoCs (such as GXL)
> which is known to work and add S32 support on an HW documented as 24bits
> only. Can you explain ?
>
>>        },
>>        .ops = &t9015_dai_ops,
>>   };
> --
> Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from SEYPR02CU001.outbound.protection.outlook.com (mail-koreacentralazon11023073.outbound.protection.outlook.com [40.107.44.73])
	(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 49030284A40;
	Tue, 14 Jan 2025 08:52:39 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.44.73
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736844763; cv=fail; b=JNM3gxu7SfTVk0ZS6LPcY9GA2c3Z+P/Yp7HLuHnY0ELvmXrZG858KsBGEyMTJ0JuwzdwUo2WOipPk+UDc6W/YUR5aNY5xcwhBp0FOrL+shKk02Ur3zEOx1r60DQRTf2mvl8DlentjwemG48zxjcBSMVyXVkqJ3FypUlsTytLGMg=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736844763; c=relaxed/simple;
	bh=JGu9Ayj/6MxxWG51SNI6k+ShdZn7JGgcbNQy/Dk13y8=;
	h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=RFy9wyPOgB/itIZEYTUmNfPtp/3ZcGuiyLaF0nbbGOHopOWJqrb46Id0TMNrvIMRubUNG3/803LXkp+4yUNFxEMd+uf+gGG3ZMHw+n1ezDclhfiQX4gxTloHicCVFhsRLsGjsY+R8wWd0lcUnlsG8k5JBTJjs2GMjo1pLLUyC+E=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=OohKvgBq; arc=fail smtp.client-ip=40.107.44.73
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="OohKvgBq"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=QD4chn2jPUSKoQrJ/fSJIKBqDEd4KNeRLnhVx3mVEOovgI6ODsUExXffzKYgvRlG4aQXy6A8Q8ZQccD4lcmJX0AeJIZmKwNaZOPXP6H4mYkw4VF0Ncb/FxIQOxMJDLJtczH6h24btjRN11uMrddgid/Tcw2HizWWsz+Kzvt0ZVena0LkT5wfQ2rq05DBhkNVrNy/VpJreEyltebmy5ZPJVHsH6j7SC8XcT3QMmWBFIZG39OJ/kz0EV9qVNfr0UH9ILK/vgT2p/z0Bf9JIN8f4SE4cWUik4WsCvp7JnUvrt+Axr836w8RmT/aHzUg0ah+iik2FcDBmtOPstaqr5gRyQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=94p/n80x6x87J5UX2shNYwfA6bADIvVuPHagiLjvDRM=;
 b=PE+RaB3TnzU7tp0xfU3ptBEQeAcgPla8isYahni+SCIsuka6rkKfzfcOwdNu3hV3N6aA+og8QzRP0orfwSzqwKc2Bgm+CND8ylUL8AkZ3XZzpwgb8NjpG3HoMcDTgcT4I9jaRljeY9RktkjQcs0XQWlF2iNnUK3L7AZger+GRUNQ6J/T/+9hlOglB23JsDY6M3QZ5OZcBQMOUyu3SxYLKyDpKmd3ykxaM6cc0i/3PvEcOAzVx9tGQkog/7LdxM7K5nc4mO8yTjT4nVI3s7bm6cxRsCc709Rpaq+Yj4GL7ehXk9oWOaVWXjZViG0uZTOZUjaW97uCCfoFfL85KHU90g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=94p/n80x6x87J5UX2shNYwfA6bADIvVuPHagiLjvDRM=;
 b=OohKvgBql5aUqI67nFaf4BwHAQrq5PfZ29JPviGOaPc4pt3m6aqgRqWYzCJRXBrEOEqX8IUP2GRTvdtL5LFKdKnw4vYTuAZC2KPqTAW/xWdgnytdfq519i0u9WtQr1nBh81uDFG7YAWqx32Kub3sBQGxiQyWQe5qtG8Ow3LdnQCwhPPmIhYEq922f3CX+D1luC+mmNu01oowGC2340eMV/ilpjpryqQRPFOEswud0Fq49hhULbwkWk013AXx6G+sgvV76282si1jSm1tHTuzf6hFG/jKW4Kwnja7Pl2WM4din4nLJoIT/QacTK9qyhW7qYzSIAiLaMaYC9HE6Enkng==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from SEYPR03MB7118.apcprd03.prod.outlook.com (2603:1096:101:d3::12)
 by TYZPR03MB8092.apcprd03.prod.outlook.com (2603:1096:400:464::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Tue, 14 Jan
 2025 08:52:34 +0000
Received: from SEYPR03MB7118.apcprd03.prod.outlook.com
 ([fe80::b748:89c0:9b9c:64d3]) by SEYPR03MB7118.apcprd03.prod.outlook.com
 ([fe80::b748:89c0:9b9c:64d3%7]) with mapi id 15.20.8335.017; Tue, 14 Jan 2025
 08:52:34 +0000
Message-ID: <813e2564-8c4c-4adb-8184-ab88156e3e4c@amlogic.com>
Date: Tue, 14 Jan 2025 16:52:30 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
To: Jerome Brunet <jbrunet@baylibre.com>,
 jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
 <1jldve939f.fsf@starbuckisacylon.baylibre.com>
From: Jiebing Chen <jiebing.chen@amlogic.com>
In-Reply-To: <1jldve939f.fsf@starbuckisacylon.baylibre.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: KL1PR0401CA0034.apcprd04.prod.outlook.com
 (2603:1096:820:e::21) To SEYPR03MB7118.apcprd03.prod.outlook.com
 (2603:1096:101:d3::12)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SEYPR03MB7118:EE_|TYZPR03MB8092:EE_
X-MS-Office365-Filtering-Correlation-Id: c38576cd-fbb0-4827-b8d2-08dd3478c9da
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?N1NubEtFW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gxdUdHQ2Jkb3ZWK3g2N3Ez?=
 =?utf-8?B?QTJHcFB0eXcvUnhDcmpwaEV3NDRyZDVOK0hKMGRvUFJGcEJOeG1OVVFLcWJk?=
 =?utf-8?B?UnZnNmp3SXFFTnAySEcxb3M3YUJqZHUrYXAzV01FMUtUcFNwdGc4VjVZQWhD?=
 =?utf-8?Q?Tn7j4xFMA6qBc?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEYPR03MB7118.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SHdKYUl5MTRBRUZDNG9KdmJ2RFRnTEF2MEtZeVZlcEdLQ0lqS1lxQlhxai9K?=
 =?utf-8?B?NjVodWlMSHpNTGpCOFZ1Y3VZOWNHNXpaWE83Qml3N3JIcHY4YnVrNzdOMEk2?=
 =?utf-8?B?SDJ5azVhNGphTlhteUs0d0FVYmxPVy8wd0pNV281RzZwQ0xMREc0RVVHV3Vv?=
 =?utf-8?B?ZGpHdVYzTmVnSXp6b0RjRmlBbFpvWkVLWWRiTlRoNEtUZjduTndUckhaSHRI?=
 =?utf-8?B?SEJKVHZjdWFxd0RKV0lRRnI3RkRNL1RWY09WUkVyNEQ4SytwMXBpa20wZGdr?=
 =?utf-8?B?bmpva2x5NzloZFVON0NYSWRHM0N0THMzM2RqcVcvekNtWVRNZnRabG0vSUpz?=
 =?utf-8?B?by8rMGVPeVcrL2hDK2xaU2pBVmtvTzA3L2h3MkoxOUhYWDRmUWlHS2pzMlV5?=
 =?utf-8?B?TWVQUU0rZk1NQXF3Qmhvb0tWVE41MGlpRzBreG5LMmhMY0UrSEJzalVUMkhw?=
 =?utf-8?B?eURKSTFPUndDdFN3UE05YTk5citHTDNGcEYvemx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exchange-CrossTenant-AuthSource: SEYPR03MB7118.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 08:52:34.6281
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zzZ3PYkQCLQ8lA/RGi6BKUNiNkuER4Y3bXCumz/TztOt0CLUAYR4s1/IpT5nTubPeYrIdcvG6cERUdgCX7+AiY1YXiEz0/GP6J0YO6U/gkg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR03MB8092


在 2025/1/13 22:50, Jerome Brunet 写道:
> [ EXTERNAL EMAIL ]
>
> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:
>
>> From: jiebing chen <jiebing.chen@amlogic.com>
>>
>> Add basic audio driver support for the Amlogic S4 based Amlogic
>> AQ222 board.
>>
>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>> ---
>>   .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts     | 226 ++++++++++++
>>   arch/arm64/boot/dts/amlogic/meson-s4.dtsi          | 385 ++++++++++++++++++++-
>>   2 files changed, 610 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>> index 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c5528b43422b705b20130 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>> @@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
>>               regulator-always-on;
>>        };
>>
>> +     vcc5v_reg: regulator-vcc-5v {
>> +             compatible = "regulator-fixed";
>> +             vin-supply = <&main_12v>;
>> +             regulator-name = "VCC5V";
>> +             regulator-min-microvolt = <5000000>;
>> +             regulator-max-microvolt = <5000000>;
>> +             gpio = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
>> +             startup-delay-us = <7000>;
>> +             enable-active-high;
>> +             regulator-boot-on;
>> +             regulator-always-on;
>> +     };
>> +
>>        /* SY8120B1ABC DC/DC Regulator. */
>>        vddcpu: regulator-vddcpu {
>>                compatible = "pwm-regulator";
>> @@ -129,6 +142,219 @@ vddcpu: regulator-vddcpu {
>>                                <699000 98>,
>>                                <689000 100>;
>>        };
>> +     dmics: audio-codec-1 {
>> +             compatible = "dmic-codec";
>> +             #sound-dai-cells = <0>;
>> +             num-channels = <2>;
>> +             wakeup-delay-ms = <50>;
>> +             sound-name-prefix = "MIC";
>> +     };
>> +
>> +     dioo2133: audio-amplifier-0 {
>> +             compatible = "simple-audio-amplifier";
>> +             enable-gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
>> +             VCC-supply = <&vcc5v_reg>;
>> +             #sound-dai-cells = <0>;
>> +             sound-name-prefix = "10U2";
>> +     };
>> +
>> +     spdif_dir: audio-spdif-in {
>> +             compatible = "linux,spdif-dir";
>> +             #sound-dai-cells = <0>;
>> +             sound-name-prefix = "DIR";
>> +     };
>> +
>> +     spdif_dit: audio-spdif-out {
>> +             compatible = "linux,spdif-dit";
>> +             #sound-dai-cells = <0>;
>> +             sound-name-prefix = "DIT";
>> +     };
>> +
>> +     sound {
>> +             compatible = "amlogic,axg-sound-card";
>> +             model = "aq222";
>> +             audio-widgets = "Line", "Lineout";
>> +             audio-aux-devs = <&tdmout_a>, <&tdmout_b>, <&tdmout_c>,
>> +                              <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
>> +                              <&tdmin_lb>, <&dioo2133>, <&tdmout_pad>, <&toacodec>;
>> +             audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
>> +                             "TDMOUT_A IN 1", "FRDDR_B OUT 0",
>> +                             "TDMOUT_A IN 2", "FRDDR_C OUT 0",
>> +                             "TDM_A Playback", "TDMOUT_A OUT",
>> +                             "TDMA_OUT SEL",   "TDM_A Playback",
>> +                             "TDMOUT_B IN 0", "FRDDR_A OUT 1",
>> +                             "TDMOUT_B IN 1", "FRDDR_B OUT 1",
>> +                             "TDMOUT_B IN 2", "FRDDR_C OUT 1",
>> +                             "TDM_B Playback", "TDMOUT_B OUT",
>> +                             "TDMB_OUT SEL",   "TDM_B Playback",
>> +                             "TDMOUT_C IN 0", "FRDDR_A OUT 2",
>> +                             "TDMOUT_C IN 1", "FRDDR_B OUT 2",
>> +                             "TDMOUT_C IN 2", "FRDDR_C OUT 2",
>> +                             "TDM_C Playback", "TDMOUT_C OUT",
>> +                             "TDMC_OUT SEL",   "TDM_C Playback",
>> +                             "TOACODEC TDMA", "TDM_A Playback",
>> +                             "TOACODEC TDMB", "TDM_B Playback",
>> +                             "TOACODEC TDMC", "TDM_C Playback",
>> +                             "SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
>> +                             "SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
>> +                             "SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
>> +                             "SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
>> +                             "SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
>> +                             "SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
>> +                             "TDMIN_A IN 0", "TDM_A Capture",
>> +                             "TDMIN_A IN 1", "TDM_B Capture",
>> +                             "TDMIN_A IN 2", "TDM_C Capture",
>> +                             "TDMIN_A IN 3", "TDM_A Loopback",
>> +                             "TDMIN_A IN 4", "TDM_B Loopback",
>> +                             "TDMIN_A IN 5", "TDM_C Loopback",
>> +                             "TDMIN_B IN 0", "TDM_A Capture",
>> +                             "TDMIN_B IN 1", "TDM_B Capture",
>> +                             "TDMIN_B IN 2", "TDM_C Capture",
>> +                             "TDMIN_B IN 3", "TDM_A Loopback",
>> +                             "TDMIN_B IN 4", "TDM_B Loopback",
>> +                             "TDMIN_B IN 5", "TDM_C Loopback",
>> +                             "TDMIN_C IN 0", "TDM_A Capture",
>> +                             "TDMIN_C IN 1", "TDM_B Capture",
>> +                             "TDMIN_C IN 2", "TDM_C Capture",
>> +                             "TDMIN_C IN 3", "TDM_A Loopback",
>> +                             "TDMIN_C IN 4", "TDM_B Loopback",
>> +                             "TDMIN_C IN 5", "TDM_C Loopback",
>> +                             "TDMIN_LB IN 3", "TDM_A Capture",
>> +                             "TDMIN_LB IN 4", "TDM_B Capture",
>> +                             "TDMIN_LB IN 5", "TDM_C Capture",
>> +                             "TDMIN_LB IN 0", "TDM_A Loopback",
>> +                             "TDMIN_LB IN 1", "TDM_B Loopback",
>> +                             "TDMIN_LB IN 2", "TDM_C Loopback",
>> +                             "TODDR_A IN 0", "TDMIN_A OUT",
>> +                             "TODDR_B IN 0", "TDMIN_A OUT",
>> +                             "TODDR_C IN 0", "TDMIN_A OUT",
>> +                             "TODDR_A IN 1", "TDMIN_B OUT",
>> +                             "TODDR_B IN 1", "TDMIN_B OUT",
>> +                             "TODDR_C IN 1", "TDMIN_B OUT",
>> +                             "TODDR_A IN 2", "TDMIN_C OUT",
>> +                             "TODDR_B IN 2", "TDMIN_C OUT",
>> +                             "TODDR_C IN 2", "TDMIN_C OUT",
>> +                             "TODDR_A IN 3", "SPDIFIN Capture",
>> +                             "TODDR_B IN 3", "SPDIFIN Capture",
>> +                             "TODDR_C IN 3", "SPDIFIN Capture",
>> +                             "TODDR_A IN 6", "TDMIN_LB OUT",
>> +                             "TODDR_B IN 6", "TDMIN_LB OUT",
>> +                             "TODDR_C IN 6", "TDMIN_LB OUT",
>> +                             "10U2 INL", "ACODEC LOLP",
>> +                             "10U2 INR", "ACODEC LORP",
>> +                             "Lineout", "10U2 OUTL",
>> +                             "Lineout", "10U2 OUTR";
>> +             assigned-clocks = <&clkc_pll CLKID_HIFI_PLL>,
>> +                               <&clkc_pll CLKID_MPLL2>,
>> +                               <&clkc_pll CLKID_MPLL0>,
>> +                               <&clkc_pll CLKID_MPLL1>;
>> +             assigned-clock-rates = <491520000>,
>> +                                    <294912000>,
>> +                                    <270950400>,
>> +                                    <393216000>;
> Why do you need 4 base rates ? Which rate family does each provide ?

hifipll 49152000, mpll2 294912000 mpll0 270950400, mpll1 393216000, the 
accuracy of hifipll

is relatively high, for tdm/pdm/spdif 16/48/96/192k we can use it. if 
the tdm and spdif work on

the same time, for example ,tdm 48k. spdif 44.1k, we can't use the same 
pll, so spdif need use the mpll 0

other pll , only set a default value, at the latest chip, we remove all 
mpll for hardware, only two hifipll

>> +
>> +             dai-link-0 {
>> +                     sound-dai = <&frddr_a>;
>> +             };
>> +
>> +             dai-link-1 {
>> +                     sound-dai = <&frddr_b>;
>> +             };
>> +
>> +             dai-link-2 {
>> +                     sound-dai = <&frddr_c>;
>> +             };
>> +
>> +             dai-link-3 {
>> +                     sound-dai = <&toddr_a>;
>> +             };
>> +
>> +             dai-link-4 {
>> +                     sound-dai = <&toddr_b>;
>> +             };
>> +
>> +             dai-link-5 {
>> +                     sound-dai = <&toddr_c>;
>> +             };
>> +
>> +             /* Connected to the WIFI/BT chip */
>> +             dai-link-6 {
>> +                     sound-dai = <&tdmif_a>;
>> +                     dai-format = "dsp_a";
>> +                     dai-tdm-slot-tx-mask-0 = <1 1>;
>> +                     mclk-fs = <256>;
>> +                     codec-0 {
>> +                             sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
>> +                     };
>> +             };
>> +
>> +             /* Connected to the onboard AD82584F DAC */
>> +             dai-link-7 {
>> +                     sound-dai = <&tdmif_b>;
>> +                     dai-format = "i2s";
>> +                     dai-tdm-slot-tx-mask-0 = <1 1>;
>> +                     mclk-fs = <256>;
>> +
>> +                     codec-0 {
>> +                             sound-dai = <&acodec>;
>> +                     };
>> +
>> +                     codec-1 {
>> +                             sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
>> +                     };
>> +             };
>> +
>> +             /* 8ch HDMI interface */
>> +             dai-link-8 {
>> +                     sound-dai = <&tdmif_c>;
>> +                     dai-format = "i2s";
>> +                     dai-tdm-slot-tx-mask-0 = <1 1>;
>> +                     dai-tdm-slot-tx-mask-1 = <1 1>;
>> +                     dai-tdm-slot-tx-mask-2 = <1 1>;
>> +                     dai-tdm-slot-tx-mask-3 = <1 1>;
>> +                     mclk-fs = <256>;
>> +
>> +                     codec-0 {
>> +                             sound-dai = <&acodec>;
>> +                     };
>> +
>> +                     codec-1 {
>> +                             sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
>> +                     };
>> +             };
>> +
>> +             /* spdif hdmi and coax output */
>> +             dai-link-9 {
>> +                     sound-dai = <&spdifout_a>;
>> +
>> +                     codec-0 {
>> +                             sound-dai = <&spdif_dit>;
>> +                     };
>> +
>> +                     codec-1 {
>> +                             sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>;
>> +                     };
>> +             };
>> +
>> +             /* spdif hdmi interface */
>> +             dai-link-10 {
>> +                     sound-dai = <&spdifout_b>;
>> +
>> +                     codec {
>> +                             sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>;
>> +                     };
>> +             };
>> +
>> +             /* spdif coax input */
>> +             dai-link-11 {
>> +                     sound-dai = <&spdifin>;
>> +
>> +                     codec {
>> +                             sound-dai = <&spdif_dir>;
>> +                     };
>> +             };
>> +     };
>> +
>>   };
>>
>>   &pwm_ef {
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>> index 957577d986c0675a503115e1ccbc4387c2051620..87a00ace23131e31822bb43fbe956b8abcbaef40 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>> @@ -11,7 +11,11 @@
>>   #include <dt-bindings/clock/amlogic,s4-peripherals-clkc.h>
>>   #include <dt-bindings/power/meson-s4-power.h>
>>   #include <dt-bindings/reset/amlogic,meson-s4-reset.h>
>> -
>> +#include <dt-bindings/clock/axg-audio-clkc.h>
>> +#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
>> +#include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>
>> +#include <dt-bindings/sound/meson-g12a-toacodec.h>
>> +#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
>>   / {
>>        cpus {
>>                #address-cells = <2>;
>> @@ -46,6 +50,42 @@ cpu3: cpu@3 {
>>                };
>>        };
>>
>> +     tdmif_a: audio-controller-0 {
>> +             compatible = "amlogic,axg-tdm-iface";
>> +             #sound-dai-cells = <0>;
>> +             sound-name-prefix = "TDM_A";
>> +             clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
>> +                      <&clkc_audio AUD_CLKID_MST_A_SCLK>,
>> +                      <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
>> +             clock-names = "mclk", "sclk", "lrclk";
>> +             assigned-clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK_SEL>;
>> +             assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
> Based on clock provider used, I doubt this is of any use.

if not set the mclk parent. we dump clk_summary, the default parent is 
mpll 0

we tend  to use hifipll

>
>> +     };
>> +
>> +     tdmif_b: audio-controller-1 {
>> +             compatible = "amlogic,axg-tdm-iface";
>> +             #sound-dai-cells = <0>;
>> +             sound-name-prefix = "TDM_B";
>> +             clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
>> +                      <&clkc_audio AUD_CLKID_MST_B_SCLK>,
>> +                      <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
>> +             clock-names = "mclk", "sclk", "lrclk";
>> +             assigned-clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK_SEL>;
>> +             assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
>> +     };
>> +
>> +     tdmif_c: audio-controller-2 {
>> +             compatible = "amlogic,axg-tdm-iface";
>> +             #sound-dai-cells = <0>;
>> +             sound-name-prefix = "TDM_C";
>> +             clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK>,
>> +                      <&clkc_audio AUD_CLKID_MST_C_SCLK>,
>> +                      <&clkc_audio AUD_CLKID_MST_C_LRCLK>;
>> +             clock-names = "mclk", "sclk", "lrclk";
>> +             assigned-clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK_SEL>;
>> +             assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
>> +     };
>> +
>>        timer {
>>                compatible = "arm,armv8-timer";
>>                interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
>> @@ -850,3 +890,346 @@ emmc: mmc@fe08c000 {
>>                };
>>        };
>>   };
>> +
>> +&apb4 {
>> +     audio: bus@330000 {
>> +             compatible = "simple-bus";
>> +             reg = <0x0 0x330000 0x0 0x1000>;
>> +             #address-cells = <2>;
>> +             #size-cells = <2>;
>> +             ranges = <0x0 0x0 0x0 0x330000 0x0 0x1000>;
>> +
>> +             clkc_audio: clock-controller@0 {
>> +                     compatible = "amlogic,sm1-audio-clkc";
> I suspect the DT folks would like having SoC specific compatible in
> addition to the fall back. In that case, I think that would be wise. I
> doubt the compatibility will hold in the long run.
>
> Same goes for the other HW components.

you are right, for s4 , some clock is different, we will add the 
"amlogic,s4-audio-clkc"

this is a base clk for tdm

>
>> +                     reg = <0x0 0x0 0x0 0xb4>;
>> +                     #clock-cells = <1>;
>> +                     #reset-cells = <1>;
>> +                     power-domains = <&pwrc PWRC_S4_AUDIO_ID>;
>> +                     clocks = <&clkc_periphs CLKID_AUDIO>,
>> +                              <&clkc_pll CLKID_MPLL0>,
>> +                              <&clkc_pll CLKID_MPLL1>,
>> +                              <&clkc_pll CLKID_MPLL2>,
>> +                              <&clkc_pll CLKID_MPLL3>,
>> +                              <&clkc_pll CLKID_HIFI_PLL>,
>> +                              <&clkc_pll CLKID_FCLK_DIV3>,
>> +                              <&clkc_pll CLKID_FCLK_DIV4>,
>> +                              <&clkc_pll CLKID_FCLK_DIV5>;
>> +                     clock-names = "pclk",
>> +                                   "mst_in0",
>> +                                   "mst_in1",
>> +                                   "mst_in2",
>> +                                   "mst_in3",
>> +                                   "mst_in4",
>> +                                   "mst_in5",
>> +                                   "mst_in6",
>> +                                   "mst_in7";
>> +
>> +                     resets = <&reset RESET_AUDIO>;
>> +             };
>> +
>> +             toddr_a: audio-controller@100 {
>> +                     compatible = "amlogic,sm1-toddr",
>> +                                  "amlogic,axg-toddr";
>> +                     reg = <0x0 0x100 0x0 0x2c>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "TODDR_A";
>> +                     interrupts = <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TODDR_A>;
>> +                     resets = <&arb AXG_ARB_TODDR_A>,
>> +                              <&clkc_audio AUD_RESET_TODDR_A>;
>> +                     reset-names = "arb", "rst";
>> +                     amlogic,fifo-depth = <8192>;
>> +             };
>> +
>> +             toddr_b: audio-controller@140 {
>> +                     compatible = "amlogic,sm1-toddr",
>> +                                  "amlogic,axg-toddr";
>> +                     reg = <0x0 0x140 0x0 0x2c>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "TODDR_B";
>> +                     interrupts = <GIC_SPI 33 IRQ_TYPE_EDGE_RISING>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TODDR_B>;
>> +                     resets = <&arb AXG_ARB_TODDR_B>,
>> +                              <&clkc_audio AUD_RESET_TODDR_B>;
>> +                     reset-names = "arb", "rst";
>> +                     amlogic,fifo-depth = <256>;
>> +             };
>> +
>> +             toddr_c: audio-controller@180 {
>> +                     compatible = "amlogic,sm1-toddr",
>> +                                  "amlogic,axg-toddr";
>> +                     reg = <0x0 0x180 0x0 0x2c>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "TODDR_C";
>> +                     interrupts = <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TODDR_C>;
>> +                     resets = <&arb AXG_ARB_TODDR_C>,
>> +                              <&clkc_audio AUD_RESET_TODDR_C>;
>> +                     reset-names = "arb", "rst";
>> +                     amlogic,fifo-depth = <256>;
>> +             };
>> +
>> +             frddr_a: audio-controller@1c0 {
>> +                     compatible = "amlogic,sm1-frddr",
>> +                                  "amlogic,axg-frddr";
>> +                     reg = <0x0 0x1c0 0x0 0x2c>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "FRDDR_A";
>> +                     interrupts = <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>;
>> +                     clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
>> +                     resets = <&arb AXG_ARB_FRDDR_A>,
>> +                              <&clkc_audio AUD_RESET_FRDDR_A>;
>> +                     reset-names = "arb", "rst";
>> +                     amlogic,fifo-depth = <512>;
>> +             };
>> +
>> +             frddr_b: audio-controller@200 {
>> +                     compatible = "amlogic,sm1-frddr",
>> +                                  "amlogic,axg-frddr";
>> +                     reg = <0x0 0x200 0x0 0x2c>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "FRDDR_B";
>> +                     interrupts = <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>;
>> +                     clocks = <&clkc_audio AUD_CLKID_FRDDR_B>;
>> +                     resets = <&arb AXG_ARB_FRDDR_B>,
>> +                              <&clkc_audio AUD_RESET_FRDDR_B>;
>> +                     reset-names = "arb", "rst";
>> +                     amlogic,fifo-depth = <256>;
>> +             };
>> +
>> +             frddr_c: audio-controller@240 {
>> +                     compatible = "amlogic,sm1-frddr",
>> +                                  "amlogic,axg-frddr";
>> +                     reg = <0x0 0x240 0x0 0x2c>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "FRDDR_C";
>> +                     interrupts = <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>;
>> +                     clocks = <&clkc_audio AUD_CLKID_FRDDR_C>;
>> +                     resets = <&arb AXG_ARB_FRDDR_C>,
>> +                              <&clkc_audio AUD_RESET_FRDDR_C>;
>> +                     reset-names = "arb", "rst";
>> +                     amlogic,fifo-depth = <256>;
>> +             };
>> +
>> +             arb: reset-controller@280 {
>> +                     compatible = "amlogic,meson-sm1-audio-arb";
>> +                     reg = <0x0 0x280 0x0 0x4>;
>> +                     #reset-cells = <1>;
>> +                     clocks = <&clkc_audio AUD_CLKID_DDR_ARB>;
>> +             };
>> +
>> +             tdmin_a: audio-controller@300 {
>> +                     compatible = "amlogic,sm1-tdmin",
>> +                                  "amlogic,axg-tdmin";
>> +                     reg = <0x0 0x300 0x0 0x40>;
>> +                     sound-name-prefix = "TDMIN_A";
>> +                     resets = <&clkc_audio AUD_RESET_TDMIN_A>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TDMIN_A>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_SCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_SCLK_SEL>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>;
>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>> +                                   "lrclk", "lrclk_sel";
>> +             };
>> +
>> +             tdmin_b: audio-controller@340 {
>> +                     compatible = "amlogic,sm1-tdmin",
>> +                                  "amlogic,axg-tdmin";
>> +                     reg = <0x0 0x340 0x0 0x40>;
>> +                     sound-name-prefix = "TDMIN_B";
>> +                     resets = <&clkc_audio AUD_RESET_TDMIN_B>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TDMIN_B>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_SCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_SCLK_SEL>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>;
>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>> +                                   "lrclk", "lrclk_sel";
>> +             };
>> +
>> +             tdmin_c: audio-controller@380 {
>> +                     compatible = "amlogic,sm1-tdmin",
>> +                                  "amlogic,axg-tdmin";
>> +                     reg = <0x0 0x380 0x0 0x40>;
>> +                     sound-name-prefix = "TDMIN_C";
>> +                     resets = <&clkc_audio AUD_RESET_TDMIN_C>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TDMIN_C>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_SCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_SCLK_SEL>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>;
>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>> +                                   "lrclk", "lrclk_sel";
>> +             };
>> +
>> +             tdmin_lb: audio-controller@3c0 {
>> +                     compatible = "amlogic,sm1-tdmin",
>> +                                  "amlogic,axg-tdmin";
>> +                     reg = <0x0 0x3c0 0x0 0x40>;
>> +                     sound-name-prefix = "TDMIN_LB";
>> +                     resets = <&clkc_audio AUD_RESET_TDMIN_LB>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TDMIN_LB>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK_SEL>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>;
>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>> +                                   "lrclk", "lrclk_sel";
>> +             };
>> +
>> +             spdifin: audio-controller@400 {
>> +                     compatible = "amlogic,g12a-spdifin",
>> +                                  "amlogic,axg-spdifin";
>> +                     reg = <0x0 0x400 0x0 0x30>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "SPDIFIN";
>> +                     interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
>> +                     clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
>> +                     <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
>> +                     clock-names = "pclk", "refclk";
>> +                     resets = <&clkc_audio AUD_RESET_SPDIFIN>;
>> +             };
>> +
>> +             spdifout_a: audio-controller@480 {
>> +                     compatible = "amlogic,g12a-spdifout",
>> +                                  "amlogic,axg-spdifout";
>> +                     reg = <0x0 0x480 0x0 0x50>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "SPDIFOUT_A";
>> +                     clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
>> +                     <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
>> +                     clock-names = "pclk", "mclk";
>> +                     resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
>> +             };
>> +
>> +             tdmout_a: audio-controller@500 {
>> +                     compatible = "amlogic,sm1-tdmout";
>> +                     reg = <0x0 0x500 0x0 0x40>;
>> +                     sound-name-prefix = "TDMOUT_A";
>> +                     resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>> +                                   "lrclk", "lrclk_sel";
>> +             };
>> +
>> +             tdmout_b: audio-controller@540 {
>> +                     compatible = "amlogic,sm1-tdmout";
>> +                     reg = <0x0 0x540 0x0 0x40>;
>> +                     sound-name-prefix = "TDMOUT_B";
>> +                     resets = <&clkc_audio AUD_RESET_TDMOUT_B>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TDMOUT_B>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK_SEL>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>;
>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>> +                                   "lrclk", "lrclk_sel";
>> +             };
>> +
>> +             tdmout_c: audio-controller@580 {
>> +                     compatible = "amlogic,sm1-tdmout";
>> +                     reg = <0x0 0x580 0x0 0x40>;
>> +                     sound-name-prefix = "TDMOUT_C";
>> +                     resets = <&clkc_audio AUD_RESET_TDMOUT_C>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TDMOUT_C>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK_SEL>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>,
>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>;
>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>> +                                   "lrclk", "lrclk_sel";
>> +             };
>> +
>> +             spdifout_b: audio-controller@680 {
>> +                     compatible = "amlogic,g12a-spdifout",
>> +                                  "amlogic,axg-spdifout";
>> +                     reg = <0x0 0x680 0x0 0x50>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "SPDIFOUT_B";
>> +                     clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
>> +                              <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
>> +                     clock-names = "pclk", "mclk";
>> +                     resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
>> +             };
>> +
>> +             toacodec: audio-controller@740 {
>> +                     compatible = "amlogic,s4-tocodec";
>> +                     reg = <0x0 0x740 0x0 0x4>;
>> +                     sound-name-prefix = "TOACODEC";
>> +                     resets = <&clkc_audio AUD_RESET_TOACODEC>;
>> +             };
>> +
>> +             tohdmitx: audio-controller@744 {
>> +                     compatible = "amlogic,sm1-tohdmitx",
>> +                                  "amlogic,g12a-tohdmitx";
>> +                     reg = <0x0 0x744 0x0 0x4>;
>> +                     #sound-dai-cells = <1>;
>> +                     sound-name-prefix = "TOHDMITX";
>> +                     resets = <&clkc_audio AUD_RESET_TOHDMITX>;
>> +             };
>> +
>> +             toddr_d: audio-controller@840 {
>> +                     compatible = "amlogic,sm1-toddr",
>> +                                  "amlogic,axg-toddr";
>> +                     reg = <0x0 0x840 0x0 0x2c>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "TODDR_D";
>> +                     interrupts = <GIC_SPI 45 IRQ_TYPE_EDGE_RISING>;
>> +                     clocks = <&clkc_audio AUD_CLKID_TODDR_D>;
>> +                     resets = <&arb AXG_ARB_TODDR_D>,
>> +                              <&clkc_audio AUD_RESET_TODDR_D>;
>> +                     reset-names = "arb", "rst";
>> +                     amlogic,fifo-depth = <256>;
>> +             };
>> +
>> +             frddr_d: audio-controller@880 {
>> +                      compatible = "amlogic,sm1-frddr",
>> +                                   "amlogic,axg-frddr";
>> +                     reg = <0x0 0x880 0x0 0x2c>;
>> +                     #sound-dai-cells = <0>;
>> +                     sound-name-prefix = "FRDDR_D";
>> +                     interrupts = <GIC_SPI 46 IRQ_TYPE_EDGE_RISING>;
>> +                     clocks = <&clkc_audio AUD_CLKID_FRDDR_D>;
>> +                     resets = <&arb AXG_ARB_FRDDR_D>,
>> +                              <&clkc_audio AUD_RESET_FRDDR_D>;
>> +                     reset-names = "arb", "rst";
>> +                     amlogic,fifo-depth = <256>;
>> +             };
>> +
>> +             tdmout_pad: audio-controller@E58 {
>> +                     compatible = "amlogic,s4-tdmout-pad";
>> +                     reg = <0x0 0xe58 0x0 0x28>;
>> +             };
>> +     };
>> +
>> +     pdm: audio-controller@331000 {
>> +             compatible = "amlogic,sm1-pdm",
>> +                          "amlogic,axg-pdm";
>> +             reg = <0x0 0x331000 0x0 0x34>;
>> +             #sound-dai-cells = <0>;
>> +             sound-name-prefix = "PDM";
>> +             clocks = <&clkc_audio AUD_CLKID_PDM>,
>> +                      <&clkc_audio AUD_CLKID_PDM_DCLK>,
>> +                      <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
>> +             clock-names = "pclk", "dclk", "sysclk";
>> +             resets = <&clkc_audio AUD_RESET_PDM>;
>> +             assigned-clocks = <&clkc_audio AUD_CLKID_PDM_DCLK_SEL>,
>> +                               <&clkc_audio AUD_CLKID_PDM_SYSCLK_SEL>;
>> +             assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>,<&clkc_pll CLKID_HIFI_PLL>;
>> +     };
>> +      acodec: audio-controller@1A000 {
>> +             compatible = "amlogic,t9015";
>> +             reg = <0x0 0x1A000 0x0 0x14>;
>> +             #sound-dai-cells = <0>;
>> +             sound-name-prefix = "ACODEC";
>> +             clocks = <&clkc_periphs CLKID_ACODEC>;
>> +             clock-names = "pclk";
>> +             resets = <&reset RESET_ACODEC>;
>> +     };
>> +
>> +};
> --
> Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10])
	(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 F28541CA84;
	Tue, 14 Jan 2025 09:10:39 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736845842; cv=none; b=UhWsGQEpFJYcDJnDIwI9lsIpcUBdemhdOYKNLqaS5Rgw62Y/SRMWeWf42H9NhdtvzIwJ83K0q+vZioOGn5Pr9NlRNi4qROLQhE1AkZywL2s/pGB9hHiKHh0+vM28KJzwv5hjwTsZja/eD1RbFJsdWoJoCnQun1J/aN1S/xMZaDo=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736845842; c=relaxed/simple;
	bh=KWR1i4NTTXotSiVPXRJjXMkD1sNo2WV+XgKVBQLu3mQ=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=kHuify4Dye4uZqFHFnLkxiLYQz+v4EyHRpSClk4M9MWstrD9/JmV87UBK0WHl2WAT5NkmI10EnlXseY8mblDSuVmBUzpr5vU3bSO5LqjiDJkYRef9gzBWl9c6+RInwb9hp4LmRO+3KUctQJEkwf3kJDJUB1Imvz0cRiGAq0R594=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Ke6SM0YU; arc=none smtp.client-ip=192.198.163.10
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ke6SM0YU"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1736845840; x=1768381840;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=KWR1i4NTTXotSiVPXRJjXMkD1sNo2WV+XgKVBQLu3mQ=;
  b=Ke6SM0YUtmRNVrHM3v4U/uA/S7UuIyg0w13xi15YyixnLBxBJ3Prq+54
   oUViWLHWvcbs1PGdrLNLosw0R/KIFBTc07SAG68iHReOpTdt6fOfjyLZG
   PwAICIIhnPomsaxWsJtXNhQtD8Mv2scNE0q+Qf3KPWYWVtUZKd7EwwmRy
   WoxkzGKZ/TazzsqgHZFS99T1mKV9ZIFs5as2jHxNURyM/U4XKYuHGRc1I
   rJWVRJoJlsDF29DKw9xGqzMKPA798vCopX5ZbvqNxSRzaU3emqKT6ZMLF
   ffFmFx4T3uKj91R+MpjIXAWMIWvBZ3ya2sc4wSI8Rk1OULihW5UBPScmf
   A==;
X-CSE-ConnectionGUID: sP4GudlyRXayr4Z45opC3Q==
X-CSE-MsgGUID: kUcraufnTgCTlmjfo/AcYg==
X-IronPort-AV: E=McAfee;i="6700,10204,11314"; a="48540883"
X-IronPort-AV: E=Sophos;i="6.12,310,1728975600"; 
   d="scan'208";a="48540883"
Received: from fmviesa006.fm.intel.com ([10.60.135.146])
  by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2025 01:10:38 -0800
X-CSE-ConnectionGUID: PdmIumZiS9W+o8d+jtbXRw==
X-CSE-MsgGUID: DFjBuiTqSAm7ZBTfTTupAA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.12,313,1728975600"; 
   d="scan'208";a="104572870"
Received: from lkp-server01.sh.intel.com (HELO d63d4d77d921) ([10.239.97.150])
  by fmviesa006.fm.intel.com with ESMTP; 14 Jan 2025 01:10:34 -0800
Received: from kbuild by d63d4d77d921 with local (Exim 4.96)
	(envelope-from <lkp@intel.com>)
	id 1tXcwS-000OJf-0i;
	Tue, 14 Jan 2025 09:10:32 +0000
Date: Tue, 14 Jan 2025 17:09:37 +0800
From: kernel test robot <lkp@intel.com>
To: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-sound@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org,
	jiebing chen <jiebing.chen@amlogic.com>
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
Message-ID: <202501141658.tM15P1iG-lkp@intel.com>
References: <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>

Hi jiebing,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 6ecd20965bdc21b265a0671ccf36d9ad8043f5ab]

url:    https://github.com/intel-lab-lkp/linux/commits/jiebing-chen-via-B4-Relay/ASoC-dt-bindings-Add-Amlogic-S4-audio/20250113-143911
base:   6ecd20965bdc21b265a0671ccf36d9ad8043f5ab
patch link:    https://lore.kernel.org/r/20250113-audio_drvier-v1-2-8c14770f38a0%40amlogic.com
patch subject: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20250114/202501141658.tM15P1iG-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250114/202501141658.tM15P1iG-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501141658.tM15P1iG-lkp@intel.com/

All warnings (new ones prefixed by >>):

   sound/soc/meson/s4-tocodec-control.c: In function 'aml_tocodec_sel_set':
>> sound/soc/meson/s4-tocodec-control.c:151:15: warning: unused variable 'clk_name' [-Wunused-variable]
     151 |         char *clk_name;
         |               ^~~~~~~~


vim +/clk_name +151 sound/soc/meson/s4-tocodec-control.c

   137	
   138	static int aml_tocodec_sel_set(struct snd_soc_dapm_widget *w)
   139	{
   140		struct snd_soc_dai *be;
   141		struct axg_tdm_stream *stream;
   142		struct axg_tdm_iface *iface;
   143		struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
   144		struct toacodec *priv = snd_soc_component_get_drvdata(component);
   145		unsigned int tdm_id = TDM_A_PAD;
   146		const char *dai_widget_name;
   147		struct snd_soc_dapm_path *p;
   148		unsigned int lane = 0;
   149		unsigned int val = 0;
   150		struct clk *sclk, *mclk;
 > 151		char *clk_name;
   152		int mclk_id, sclk_id;
   153	
   154		be = tocodec_tdm_get_ahead_be(w);
   155		if (!be) {
   156			dev_err(component->dev, "%s not find the be\n", __func__);
   157			return -EINVAL;
   158		}
   159		stream = snd_soc_dai_dma_data_get_playback(be);
   160		if (!stream) {
   161			dev_err(component->dev, "%s not find the stream\n", __func__);
   162			return -EINVAL;
   163		}
   164		/*we like to use dai id, but it is fixed val*/
   165		dai_widget_name = be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
   166		if (strstr(dai_widget_name, "TDM_A"))
   167			tdm_id = TDM_A_PAD;
   168		else if (strstr(dai_widget_name, "TDM_B"))
   169			tdm_id = TDM_B_PAD;
   170		else if (strstr(dai_widget_name, "TDM_C"))
   171			tdm_id = TDM_C_PAD;
   172		snd_soc_dapm_widget_for_each_source_path(w, p) {
   173			if (p->connect && p->name) {
   174				lane = aml_simple_strtoull(p->name);
   175				val = lane + tdm_id * S4_LANE_OFFSET;
   176				regmap_field_write(priv->field_dat_sel, val);
   177			}
   178		}
   179		iface = stream->iface;
   180		mclk = iface->mclk;
   181		sclk = iface->sclk;
   182		mclk_id = aml_get_clk_id(__clk_get_name(mclk));
   183		sclk_id = aml_get_clk_id(__clk_get_name(sclk));
   184		regmap_field_write(priv->field_mclk_sel, mclk_id);
   185		regmap_field_write(priv->field_bclk_sel, sclk_id);
   186		regmap_field_write(priv->field_lrclk_sel, sclk_id);
   187	
   188		return 0;
   189	}
   190	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49])
	(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 33B4D20F972
	for <linux-kernel@vger.kernel.org>; Tue, 14 Jan 2025 11:16:43 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736853406; cv=none; b=YiaZjbCZ2/hzBiAibVHISSXW4XOaONUE+KYiWf5Dv+G+WD2GMQGLg9tUspPDmxGJC9xTG/dAj/7EuOLcUQ3m9aT9SUS7K75HRY264R5VJaTImglA+mfFxTe+U05BFRXPx2lHnlSnQFaD9fe9FHnYyvsd99KphYYwOfBKSAmKLAM=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736853406; c=relaxed/simple;
	bh=f/Q5bbmQbCwCXGHQpsH8BhDbwJi60zbtAPlyUjQ7OZ8=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=PFFCrg5zYjZHUIO4mSp0rlIUrDZnDxwkkkZG2MLbDx6Fka1vQBNHOgXoNiP7dgUR7l4jPmhMJsEF3oanWZHNngCtl4VHfQZKRQgmgYuyz/ecEUGaqmgNPk4ysfSGaTYQUEtHVfofHQaPcRTPgXAQXUlkROf9mQwKfUxgjCle9tk=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=qqjohwK/; arc=none smtp.client-ip=209.85.128.49
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="qqjohwK/"
Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-43626213fffso38610515e9.1
        for <linux-kernel@vger.kernel.org>; Tue, 14 Jan 2025 03:16:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736853401; x=1737458201; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=4rWpW7afdP6kA7HxL0T8y7xuvgGWUAI5NAoNUPzS1Gw=;
        b=qqjohwK/WSISx06xsYJ/0cr04PMyluouG1UywqJSEmz5iRh5Ovmzm1gdfF7yTy9CeO
         0//N718i/Uihz9fhofZMaoroe0xbPyQDu1WdRN1PF8zdvDSaLgw19lbULtKtYPbXI6XV
         Q/l1NmpnjXwOPqMItsMQvi+9HweTTxIgLMdc7XWWlf1GoXRxgy6JkTISowpT43xTf+/k
         JSRw1TiR1SpVif6N+MH2aiFoDLcX7qwDg/SaC/idqHHR/WsIHdel8nbzOeMiV3Uu4CpX
         zFCZ+bT9ZPUv/ribMbCxkh9AfgJMs3pr2SQH0G4fM/7fJj/U82SlYCSk4PbMZ5ykGlSI
         TU2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1736853401; x=1737458201;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=4rWpW7afdP6kA7HxL0T8y7xuvgGWUAI5NAoNUPzS1Gw=;
        b=wbJnlBJET3Bzm6IAeWUpmKiqMOu6XstRBwxkbDZd5gv6D4FcLMlm5uKUd0OguXkVYB
         b9KmOJhMpK4bb1RlPVjil7bQIL9/GAw47OSZea2/SYDflkanYWruR2z/Bdwsr4FqWhzj
         CUbl77RZPXjqyMHpd8yrp0O1BfKNNGEVJYTi6nMIOJH0DKI6jfkz9ZPSrUBX6bDBcZuY
         rhEsM55Jgtel4XftebkI52TNF/DGpofuTFUhVuwHU1fqCmWJR3POXVpyYIVTP94JrkFV
         tOIrVctFMsdx5wWhcCrPInAB5XO0IARnqzBIC68wzeOcpowCdHw1SE9oG8LavMoEs+1M
         38Yw==
X-Forwarded-Encrypted: i=1; AJvYcCURvc0UZfbHWo7Wi0g7DABpvlqgw4UZShaoki+brje4l6I4mAw3GjzQIBnzVk9AbkhyOKqErtHSAnkcfZo=@vger.kernel.org
X-Gm-Message-State: AOJu0YwrHRKcybBQzxp3CwCyO4/04Z4GBaqCI8OkZ1g7afCLVlVeVpqp
	e87jp+Rrn0mMAbnoyho0OACTjrSBfOVKsohKzcVC4VLEux+YsTF33RJULG9j7mo=
X-Gm-Gg: ASbGncs2ijE1SvDXjTw3gZliMTQAFH5V/cbCNHUjXUGIqD6bz2R+IcDHdwXo6tgXZtY
	qCoBWva0of0jb0tw+Q6z93vOVy1xKBB/A+jrkTTu1M9+c9l4F+YJhwhIMA1A6482aa3jbCcXkKW
	w1lnZLJSnLujC7OTg7BxKXreridN5BfpAkyHVIra3oYszttUw0fd/O808vgfUlLV7JDJRnRcs6p
	mYO/IqaTEg5dQUxAfhanS15vWmLjHznklqAcwr9uygc6oWOFdplCROU
X-Google-Smtp-Source: AGHT+IHLRn1recYcjel2xFHuhyArfGR+H7/7Uz8y4LDnPl/zwW3c00VR6BRi94sqmifx2Saq6CpNfw==
X-Received: by 2002:a05:600c:3b86:b0:434:f3d8:62db with SMTP id 5b1f17b1804b1-436e9d6963amr164049635e9.2.1736853401362;
        Tue, 14 Jan 2025 03:16:41 -0800 (PST)
Received: from localhost ([2a01:e0a:3c5:5fb1:317c:3d93:b7d4:96cd])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2e89dfesm207607585e9.32.2025.01.14.03.16.40
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 14 Jan 2025 03:16:40 -0800 (PST)
From: Jerome Brunet <jbrunet@baylibre.com>
To: Jiebing Chen <jiebing.chen@amlogic.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
  Liam Girdwood <lgirdwood@gmail.com>,  Mark Brown <broonie@kernel.org>,
  Rob Herring <robh@kernel.org>,  Krzysztof Kozlowski <krzk+dt@kernel.org>,
  Conor Dooley <conor+dt@kernel.org>,  Jaroslav Kysela <perex@perex.cz>,
  Takashi Iwai <tiwai@suse.com>,  Neil Armstrong
 <neil.armstrong@linaro.org>,  Kevin Hilman <khilman@baylibre.com>,  Martin
 Blumenstingl <martin.blumenstingl@googlemail.com>,
  linux-sound@vger.kernel.org,  devicetree@vger.kernel.org,
  linux-kernel@vger.kernel.org,  linux-arm-kernel@lists.infradead.org,
  linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
In-Reply-To: <813e2564-8c4c-4adb-8184-ab88156e3e4c@amlogic.com> (Jiebing
	Chen's message of "Tue, 14 Jan 2025 16:52:30 +0800")
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
	<20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
	<1jldve939f.fsf@starbuckisacylon.baylibre.com>
	<813e2564-8c4c-4adb-8184-ab88156e3e4c@amlogic.com>
User-Agent: mu4e 1.12.7; emacs 29.4
Date: Tue, 14 Jan 2025 12:16:40 +0100
Message-ID: <1jmsft7ihz.fsf@starbuckisacylon.baylibre.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue 14 Jan 2025 at 16:52, Jiebing Chen <jiebing.chen@amlogic.com> wrote:

> =E5=9C=A8 2025/1/13 22:50, Jerome Brunet =E5=86=99=E9=81=93:
>> [ EXTERNAL EMAIL ]
>>
>> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay <devnull+jiebing.=
chen.amlogic.com@kernel.org> wrote:
>>
>>> From: jiebing chen <jiebing.chen@amlogic.com>
>>>
>>> Add basic audio driver support for the Amlogic S4 based Amlogic
>>> AQ222 board.
>>>
>>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>>> ---
>>>   .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts     | 226 ++++++++++++
>>>   arch/arm64/boot/dts/amlogic/meson-s4.dtsi          | 385 ++++++++++++=
++++++++-
>>>   2 files changed, 610 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts b/ar=
ch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>> index 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c552=
8b43422b705b20130 100644
>>> --- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>> @@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
>>>               regulator-always-on;
>>>        };
>>>
>>> +     vcc5v_reg: regulator-vcc-5v {
>>> +             compatible =3D "regulator-fixed";
>>> +             vin-supply =3D <&main_12v>;
>>> +             regulator-name =3D "VCC5V";
>>> +             regulator-min-microvolt =3D <5000000>;
>>> +             regulator-max-microvolt =3D <5000000>;
>>> +             gpio =3D <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
>>> +             startup-delay-us =3D <7000>;
>>> +             enable-active-high;
>>> +             regulator-boot-on;
>>> +             regulator-always-on;
>>> +     };
>>> +
>>>        /* SY8120B1ABC DC/DC Regulator. */
>>>        vddcpu: regulator-vddcpu {
>>>                compatible =3D "pwm-regulator";
>>> @@ -129,6 +142,219 @@ vddcpu: regulator-vddcpu {
>>>                                <699000 98>,
>>>                                <689000 100>;
>>>        };
>>> +     dmics: audio-codec-1 {
>>> +             compatible =3D "dmic-codec";
>>> +             #sound-dai-cells =3D <0>;
>>> +             num-channels =3D <2>;
>>> +             wakeup-delay-ms =3D <50>;
>>> +             sound-name-prefix =3D "MIC";
>>> +     };
>>> +
>>> +     dioo2133: audio-amplifier-0 {
>>> +             compatible =3D "simple-audio-amplifier";
>>> +             enable-gpios =3D <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
>>> +             VCC-supply =3D <&vcc5v_reg>;
>>> +             #sound-dai-cells =3D <0>;
>>> +             sound-name-prefix =3D "10U2";
>>> +     };
>>> +
>>> +     spdif_dir: audio-spdif-in {
>>> +             compatible =3D "linux,spdif-dir";
>>> +             #sound-dai-cells =3D <0>;
>>> +             sound-name-prefix =3D "DIR";
>>> +     };
>>> +
>>> +     spdif_dit: audio-spdif-out {
>>> +             compatible =3D "linux,spdif-dit";
>>> +             #sound-dai-cells =3D <0>;
>>> +             sound-name-prefix =3D "DIT";
>>> +     };
>>> +
>>> +     sound {
>>> +             compatible =3D "amlogic,axg-sound-card";
>>> +             model =3D "aq222";
>>> +             audio-widgets =3D "Line", "Lineout";
>>> +             audio-aux-devs =3D <&tdmout_a>, <&tdmout_b>, <&tdmout_c>,
>>> +                              <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
>>> +                              <&tdmin_lb>, <&dioo2133>, <&tdmout_pad>,=
 <&toacodec>;
>>> +             audio-routing =3D "TDMOUT_A IN 0", "FRDDR_A OUT 0",
>>> +                             "TDMOUT_A IN 1", "FRDDR_B OUT 0",
>>> +                             "TDMOUT_A IN 2", "FRDDR_C OUT 0",
>>> +                             "TDM_A Playback", "TDMOUT_A OUT",
>>> +                             "TDMA_OUT SEL",   "TDM_A Playback",
>>> +                             "TDMOUT_B IN 0", "FRDDR_A OUT 1",
>>> +                             "TDMOUT_B IN 1", "FRDDR_B OUT 1",
>>> +                             "TDMOUT_B IN 2", "FRDDR_C OUT 1",
>>> +                             "TDM_B Playback", "TDMOUT_B OUT",
>>> +                             "TDMB_OUT SEL",   "TDM_B Playback",
>>> +                             "TDMOUT_C IN 0", "FRDDR_A OUT 2",
>>> +                             "TDMOUT_C IN 1", "FRDDR_B OUT 2",
>>> +                             "TDMOUT_C IN 2", "FRDDR_C OUT 2",
>>> +                             "TDM_C Playback", "TDMOUT_C OUT",
>>> +                             "TDMC_OUT SEL",   "TDM_C Playback",
>>> +                             "TOACODEC TDMA", "TDM_A Playback",
>>> +                             "TOACODEC TDMB", "TDM_B Playback",
>>> +                             "TOACODEC TDMC", "TDM_C Playback",
>>> +                             "SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
>>> +                             "SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
>>> +                             "SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
>>> +                             "SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
>>> +                             "SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
>>> +                             "SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
>>> +                             "TDMIN_A IN 0", "TDM_A Capture",
>>> +                             "TDMIN_A IN 1", "TDM_B Capture",
>>> +                             "TDMIN_A IN 2", "TDM_C Capture",
>>> +                             "TDMIN_A IN 3", "TDM_A Loopback",
>>> +                             "TDMIN_A IN 4", "TDM_B Loopback",
>>> +                             "TDMIN_A IN 5", "TDM_C Loopback",
>>> +                             "TDMIN_B IN 0", "TDM_A Capture",
>>> +                             "TDMIN_B IN 1", "TDM_B Capture",
>>> +                             "TDMIN_B IN 2", "TDM_C Capture",
>>> +                             "TDMIN_B IN 3", "TDM_A Loopback",
>>> +                             "TDMIN_B IN 4", "TDM_B Loopback",
>>> +                             "TDMIN_B IN 5", "TDM_C Loopback",
>>> +                             "TDMIN_C IN 0", "TDM_A Capture",
>>> +                             "TDMIN_C IN 1", "TDM_B Capture",
>>> +                             "TDMIN_C IN 2", "TDM_C Capture",
>>> +                             "TDMIN_C IN 3", "TDM_A Loopback",
>>> +                             "TDMIN_C IN 4", "TDM_B Loopback",
>>> +                             "TDMIN_C IN 5", "TDM_C Loopback",
>>> +                             "TDMIN_LB IN 3", "TDM_A Capture",
>>> +                             "TDMIN_LB IN 4", "TDM_B Capture",
>>> +                             "TDMIN_LB IN 5", "TDM_C Capture",
>>> +                             "TDMIN_LB IN 0", "TDM_A Loopback",
>>> +                             "TDMIN_LB IN 1", "TDM_B Loopback",
>>> +                             "TDMIN_LB IN 2", "TDM_C Loopback",
>>> +                             "TODDR_A IN 0", "TDMIN_A OUT",
>>> +                             "TODDR_B IN 0", "TDMIN_A OUT",
>>> +                             "TODDR_C IN 0", "TDMIN_A OUT",
>>> +                             "TODDR_A IN 1", "TDMIN_B OUT",
>>> +                             "TODDR_B IN 1", "TDMIN_B OUT",
>>> +                             "TODDR_C IN 1", "TDMIN_B OUT",
>>> +                             "TODDR_A IN 2", "TDMIN_C OUT",
>>> +                             "TODDR_B IN 2", "TDMIN_C OUT",
>>> +                             "TODDR_C IN 2", "TDMIN_C OUT",
>>> +                             "TODDR_A IN 3", "SPDIFIN Capture",
>>> +                             "TODDR_B IN 3", "SPDIFIN Capture",
>>> +                             "TODDR_C IN 3", "SPDIFIN Capture",
>>> +                             "TODDR_A IN 6", "TDMIN_LB OUT",
>>> +                             "TODDR_B IN 6", "TDMIN_LB OUT",
>>> +                             "TODDR_C IN 6", "TDMIN_LB OUT",
>>> +                             "10U2 INL", "ACODEC LOLP",
>>> +                             "10U2 INR", "ACODEC LORP",
>>> +                             "Lineout", "10U2 OUTL",
>>> +                             "Lineout", "10U2 OUTR";
>>> +             assigned-clocks =3D <&clkc_pll CLKID_HIFI_PLL>,
>>> +                               <&clkc_pll CLKID_MPLL2>,
>>> +                               <&clkc_pll CLKID_MPLL0>,
>>> +                               <&clkc_pll CLKID_MPLL1>;
>>> +             assigned-clock-rates =3D <491520000>,
>>> +                                    <294912000>,
>>> +                                    <270950400>,
>>> +                                    <393216000>;
>> Why do you need 4 base rates ? Which rate family does each provide ?
>
> hifipll 49152000, mpll2 294912000 mpll0 270950400, mpll1 393216000, the
> accuracy of hifipll
>
> is relatively high, for tdm/pdm/spdif 16/48/96/192k we can use it. if the
> tdm and spdif work on

It is fine to use the HiFi. I'm glad this clock finally got fixed

>
> the same time, for example ,tdm 48k. spdif 44.1k, we can't use the same
> pll, so spdif need use the mpll 0
>
> other pll , only set a default value, at the latest chip, we remove all
> mpll for hardware, only two hifipll

I'm not sure you understand how this works.
There is 3 families of audio rate: 48kHz, 44.1kHz and 32kHz

Each family needs a PLL assigned, so you need 3, not 4, unless there is
another specific rate family you want to support. If that's the case,
document it.

Setting the rate of the PLL should follow this principle:
* Family rate
  - multiplied by (32 x 24): to accomodate different sample sizes
  - multiplied by 2 until you reach the maximum rate of selected PLLs
    This allows to support rates such 192k or even 768k

491520000 is not dividable by 3, it won't allow 24 bits words. It is a
poor choice.

Have a look at the s400 for an example using the HiFi PLL. The axg was
restricted to a 68 PLL multiplier but the S4 is not so you should be
able to use a higher base rate (4 718 592 000 Hz), providing better
accuracy in the end

>
>>> +
>>> +             dai-link-0 {
>>> +                     sound-dai =3D <&frddr_a>;
>>> +             };
>>> +
>>> +             dai-link-1 {
>>> +                     sound-dai =3D <&frddr_b>;
>>> +             };
>>> +
>>> +             dai-link-2 {
>>> +                     sound-dai =3D <&frddr_c>;
>>> +             };
>>> +
>>> +             dai-link-3 {
>>> +                     sound-dai =3D <&toddr_a>;
>>> +             };
>>> +
>>> +             dai-link-4 {
>>> +                     sound-dai =3D <&toddr_b>;
>>> +             };
>>> +
>>> +             dai-link-5 {
>>> +                     sound-dai =3D <&toddr_c>;
>>> +             };
>>> +
>>> +             /* Connected to the WIFI/BT chip */
>>> +             dai-link-6 {
>>> +                     sound-dai =3D <&tdmif_a>;
>>> +                     dai-format =3D "dsp_a";
>>> +                     dai-tdm-slot-tx-mask-0 =3D <1 1>;
>>> +                     mclk-fs =3D <256>;
>>> +                     codec-0 {
>>> +                             sound-dai =3D <&tohdmitx TOHDMITX_I2S_IN_=
A>;
>>> +                     };
>>> +             };
>>> +
>>> +             /* Connected to the onboard AD82584F DAC */
>>> +             dai-link-7 {
>>> +                     sound-dai =3D <&tdmif_b>;
>>> +                     dai-format =3D "i2s";
>>> +                     dai-tdm-slot-tx-mask-0 =3D <1 1>;
>>> +                     mclk-fs =3D <256>;
>>> +
>>> +                     codec-0 {
>>> +                             sound-dai =3D <&acodec>;
>>> +                     };
>>> +
>>> +                     codec-1 {
>>> +                             sound-dai =3D <&tohdmitx TOHDMITX_I2S_IN_=
B>;
>>> +                     };
>>> +             };
>>> +
>>> +             /* 8ch HDMI interface */
>>> +             dai-link-8 {
>>> +                     sound-dai =3D <&tdmif_c>;
>>> +                     dai-format =3D "i2s";
>>> +                     dai-tdm-slot-tx-mask-0 =3D <1 1>;
>>> +                     dai-tdm-slot-tx-mask-1 =3D <1 1>;
>>> +                     dai-tdm-slot-tx-mask-2 =3D <1 1>;
>>> +                     dai-tdm-slot-tx-mask-3 =3D <1 1>;
>>> +                     mclk-fs =3D <256>;
>>> +
>>> +                     codec-0 {
>>> +                             sound-dai =3D <&acodec>;
>>> +                     };
>>> +
>>> +                     codec-1 {
>>> +                             sound-dai =3D <&tohdmitx TOHDMITX_I2S_IN_=
C>;
>>> +                     };
>>> +             };
>>> +
>>> +             /* spdif hdmi and coax output */
>>> +             dai-link-9 {
>>> +                     sound-dai =3D <&spdifout_a>;
>>> +
>>> +                     codec-0 {
>>> +                             sound-dai =3D <&spdif_dit>;
>>> +                     };
>>> +
>>> +                     codec-1 {
>>> +                             sound-dai =3D <&tohdmitx TOHDMITX_SPDIF_I=
N_A>;
>>> +                     };
>>> +             };
>>> +
>>> +             /* spdif hdmi interface */
>>> +             dai-link-10 {
>>> +                     sound-dai =3D <&spdifout_b>;
>>> +
>>> +                     codec {
>>> +                             sound-dai =3D <&tohdmitx TOHDMITX_SPDIF_I=
N_B>;
>>> +                     };
>>> +             };
>>> +
>>> +             /* spdif coax input */
>>> +             dai-link-11 {
>>> +                     sound-dai =3D <&spdifin>;
>>> +
>>> +                     codec {
>>> +                             sound-dai =3D <&spdif_dir>;
>>> +                     };
>>> +             };
>>> +     };
>>> +
>>>   };
>>>
>>>   &pwm_ef {
>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boo=
t/dts/amlogic/meson-s4.dtsi
>>> index 957577d986c0675a503115e1ccbc4387c2051620..87a00ace23131e31822bb43=
fbe956b8abcbaef40 100644
>>> --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>>> @@ -11,7 +11,11 @@
>>>   #include <dt-bindings/clock/amlogic,s4-peripherals-clkc.h>
>>>   #include <dt-bindings/power/meson-s4-power.h>
>>>   #include <dt-bindings/reset/amlogic,meson-s4-reset.h>
>>> -
>>> +#include <dt-bindings/clock/axg-audio-clkc.h>
>>> +#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
>>> +#include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>
>>> +#include <dt-bindings/sound/meson-g12a-toacodec.h>
>>> +#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
>>>   / {
>>>        cpus {
>>>                #address-cells =3D <2>;
>>> @@ -46,6 +50,42 @@ cpu3: cpu@3 {
>>>                };
>>>        };
>>>
>>> +     tdmif_a: audio-controller-0 {
>>> +             compatible =3D "amlogic,axg-tdm-iface";
>>> +             #sound-dai-cells =3D <0>;
>>> +             sound-name-prefix =3D "TDM_A";
>>> +             clocks =3D <&clkc_audio AUD_CLKID_MST_A_MCLK>,
>>> +                      <&clkc_audio AUD_CLKID_MST_A_SCLK>,
>>> +                      <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
>>> +             clock-names =3D "mclk", "sclk", "lrclk";
>>> +             assigned-clocks =3D <&clkc_audio AUD_CLKID_MST_A_MCLK_SEL=
>;
>>> +             assigned-clock-parents =3D <&clkc_pll CLKID_HIFI_PLL>;
>> Based on clock provider used, I doubt this is of any use.
>
> if not set the mclk parent. we dump clk_summary, the default parent is mp=
ll
> 0
>
> we tend=C2=A0 to use hifipll

Have you really tested this ? Master clocks do reparent to the appropriate =
PLL
depending on the rate required, this is how it has always worked.

>>
>>> +     };
>>> +
>>> +     tdmif_b: audio-controller-1 {
>>> +             compatible =3D "amlogic,axg-tdm-iface";
>>> +             #sound-dai-cells =3D <0>;
>>> +             sound-name-prefix =3D "TDM_B";
>>> +             clocks =3D <&clkc_audio AUD_CLKID_MST_B_MCLK>,
>>> +                      <&clkc_audio AUD_CLKID_MST_B_SCLK>,
>>> +                      <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
>>> +             clock-names =3D "mclk", "sclk", "lrclk";
>>> +             assigned-clocks =3D <&clkc_audio AUD_CLKID_MST_B_MCLK_SEL=
>;
>>> +             assigned-clock-parents =3D <&clkc_pll CLKID_HIFI_PLL>;
>>> +     };
>>> +
>>> +     tdmif_c: audio-controller-2 {
>>> +             compatible =3D "amlogic,axg-tdm-iface";
>>> +             #sound-dai-cells =3D <0>;
>>> +             sound-name-prefix =3D "TDM_C";
>>> +             clocks =3D <&clkc_audio AUD_CLKID_MST_C_MCLK>,
>>> +                      <&clkc_audio AUD_CLKID_MST_C_SCLK>,
>>> +                      <&clkc_audio AUD_CLKID_MST_C_LRCLK>;
>>> +             clock-names =3D "mclk", "sclk", "lrclk";
>>> +             assigned-clocks =3D <&clkc_audio AUD_CLKID_MST_C_MCLK_SEL=
>;
>>> +             assigned-clock-parents =3D <&clkc_pll CLKID_HIFI_PLL>;
>>> +     };
>>> +
>>>        timer {
>>>                compatible =3D "arm,armv8-timer";
>>>                interrupts =3D <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ=
_TYPE_LEVEL_LOW)>,
>>> @@ -850,3 +890,346 @@ emmc: mmc@fe08c000 {
>>>                };
>>>        };
>>>   };
>>> +
>>> +&apb4 {
>>> +     audio: bus@330000 {
>>> +             compatible =3D "simple-bus";
>>> +             reg =3D <0x0 0x330000 0x0 0x1000>;
>>> +             #address-cells =3D <2>;
>>> +             #size-cells =3D <2>;
>>> +             ranges =3D <0x0 0x0 0x0 0x330000 0x0 0x1000>;
>>> +
>>> +             clkc_audio: clock-controller@0 {
>>> +                     compatible =3D "amlogic,sm1-audio-clkc";
>> I suspect the DT folks would like having SoC specific compatible in
>> addition to the fall back. In that case, I think that would be wise. I
>> doubt the compatibility will hold in the long run.
>>
>> Same goes for the other HW components.
>
> you are right, for s4 , some clock is different, we will add the
> "amlogic,s4-audio-clkc"
>
> this is a base clk for tdm
>
>>
>>> +                     reg =3D <0x0 0x0 0x0 0xb4>;
>>> +                     #clock-cells =3D <1>;
>>> +                     #reset-cells =3D <1>;
>>> +                     power-domains =3D <&pwrc PWRC_S4_AUDIO_ID>;
>>> +                     clocks =3D <&clkc_periphs CLKID_AUDIO>,
>>> +                              <&clkc_pll CLKID_MPLL0>,
>>> +                              <&clkc_pll CLKID_MPLL1>,
>>> +                              <&clkc_pll CLKID_MPLL2>,
>>> +                              <&clkc_pll CLKID_MPLL3>,
>>> +                              <&clkc_pll CLKID_HIFI_PLL>,
>>> +                              <&clkc_pll CLKID_FCLK_DIV3>,
>>> +                              <&clkc_pll CLKID_FCLK_DIV4>,
>>> +                              <&clkc_pll CLKID_FCLK_DIV5>;
>>> +                     clock-names =3D "pclk",
>>> +                                   "mst_in0",
>>> +                                   "mst_in1",
>>> +                                   "mst_in2",
>>> +                                   "mst_in3",
>>> +                                   "mst_in4",
>>> +                                   "mst_in5",
>>> +                                   "mst_in6",
>>> +                                   "mst_in7";
>>> +
>>> +                     resets =3D <&reset RESET_AUDIO>;
>>> +             };
>>> +
>>> +             toddr_a: audio-controller@100 {
>>> +                     compatible =3D "amlogic,sm1-toddr",
>>> +                                  "amlogic,axg-toddr";
>>> +                     reg =3D <0x0 0x100 0x0 0x2c>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "TODDR_A";
>>> +                     interrupts =3D <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TODDR_A>;
>>> +                     resets =3D <&arb AXG_ARB_TODDR_A>,
>>> +                              <&clkc_audio AUD_RESET_TODDR_A>;
>>> +                     reset-names =3D "arb", "rst";
>>> +                     amlogic,fifo-depth =3D <8192>;
>>> +             };
>>> +
>>> +             toddr_b: audio-controller@140 {
>>> +                     compatible =3D "amlogic,sm1-toddr",
>>> +                                  "amlogic,axg-toddr";
>>> +                     reg =3D <0x0 0x140 0x0 0x2c>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "TODDR_B";
>>> +                     interrupts =3D <GIC_SPI 33 IRQ_TYPE_EDGE_RISING>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TODDR_B>;
>>> +                     resets =3D <&arb AXG_ARB_TODDR_B>,
>>> +                              <&clkc_audio AUD_RESET_TODDR_B>;
>>> +                     reset-names =3D "arb", "rst";
>>> +                     amlogic,fifo-depth =3D <256>;
>>> +             };
>>> +
>>> +             toddr_c: audio-controller@180 {
>>> +                     compatible =3D "amlogic,sm1-toddr",
>>> +                                  "amlogic,axg-toddr";
>>> +                     reg =3D <0x0 0x180 0x0 0x2c>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "TODDR_C";
>>> +                     interrupts =3D <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TODDR_C>;
>>> +                     resets =3D <&arb AXG_ARB_TODDR_C>,
>>> +                              <&clkc_audio AUD_RESET_TODDR_C>;
>>> +                     reset-names =3D "arb", "rst";
>>> +                     amlogic,fifo-depth =3D <256>;
>>> +             };
>>> +
>>> +             frddr_a: audio-controller@1c0 {
>>> +                     compatible =3D "amlogic,sm1-frddr",
>>> +                                  "amlogic,axg-frddr";
>>> +                     reg =3D <0x0 0x1c0 0x0 0x2c>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "FRDDR_A";
>>> +                     interrupts =3D <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_FRDDR_A>;
>>> +                     resets =3D <&arb AXG_ARB_FRDDR_A>,
>>> +                              <&clkc_audio AUD_RESET_FRDDR_A>;
>>> +                     reset-names =3D "arb", "rst";
>>> +                     amlogic,fifo-depth =3D <512>;
>>> +             };
>>> +
>>> +             frddr_b: audio-controller@200 {
>>> +                     compatible =3D "amlogic,sm1-frddr",
>>> +                                  "amlogic,axg-frddr";
>>> +                     reg =3D <0x0 0x200 0x0 0x2c>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "FRDDR_B";
>>> +                     interrupts =3D <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_FRDDR_B>;
>>> +                     resets =3D <&arb AXG_ARB_FRDDR_B>,
>>> +                              <&clkc_audio AUD_RESET_FRDDR_B>;
>>> +                     reset-names =3D "arb", "rst";
>>> +                     amlogic,fifo-depth =3D <256>;
>>> +             };
>>> +
>>> +             frddr_c: audio-controller@240 {
>>> +                     compatible =3D "amlogic,sm1-frddr",
>>> +                                  "amlogic,axg-frddr";
>>> +                     reg =3D <0x0 0x240 0x0 0x2c>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "FRDDR_C";
>>> +                     interrupts =3D <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_FRDDR_C>;
>>> +                     resets =3D <&arb AXG_ARB_FRDDR_C>,
>>> +                              <&clkc_audio AUD_RESET_FRDDR_C>;
>>> +                     reset-names =3D "arb", "rst";
>>> +                     amlogic,fifo-depth =3D <256>;
>>> +             };
>>> +
>>> +             arb: reset-controller@280 {
>>> +                     compatible =3D "amlogic,meson-sm1-audio-arb";
>>> +                     reg =3D <0x0 0x280 0x0 0x4>;
>>> +                     #reset-cells =3D <1>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_DDR_ARB>;
>>> +             };
>>> +
>>> +             tdmin_a: audio-controller@300 {
>>> +                     compatible =3D "amlogic,sm1-tdmin",
>>> +                                  "amlogic,axg-tdmin";
>>> +                     reg =3D <0x0 0x300 0x0 0x40>;
>>> +                     sound-name-prefix =3D "TDMIN_A";
>>> +                     resets =3D <&clkc_audio AUD_RESET_TDMIN_A>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TDMIN_A>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_SCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_SCLK_SEL>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>;
>>> +                     clock-names =3D "pclk", "sclk", "sclk_sel",
>>> +                                   "lrclk", "lrclk_sel";
>>> +             };
>>> +
>>> +             tdmin_b: audio-controller@340 {
>>> +                     compatible =3D "amlogic,sm1-tdmin",
>>> +                                  "amlogic,axg-tdmin";
>>> +                     reg =3D <0x0 0x340 0x0 0x40>;
>>> +                     sound-name-prefix =3D "TDMIN_B";
>>> +                     resets =3D <&clkc_audio AUD_RESET_TDMIN_B>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TDMIN_B>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_SCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_SCLK_SEL>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>;
>>> +                     clock-names =3D "pclk", "sclk", "sclk_sel",
>>> +                                   "lrclk", "lrclk_sel";
>>> +             };
>>> +
>>> +             tdmin_c: audio-controller@380 {
>>> +                     compatible =3D "amlogic,sm1-tdmin",
>>> +                                  "amlogic,axg-tdmin";
>>> +                     reg =3D <0x0 0x380 0x0 0x40>;
>>> +                     sound-name-prefix =3D "TDMIN_C";
>>> +                     resets =3D <&clkc_audio AUD_RESET_TDMIN_C>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TDMIN_C>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_SCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_SCLK_SEL>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>;
>>> +                     clock-names =3D "pclk", "sclk", "sclk_sel",
>>> +                                   "lrclk", "lrclk_sel";
>>> +             };
>>> +
>>> +             tdmin_lb: audio-controller@3c0 {
>>> +                     compatible =3D "amlogic,sm1-tdmin",
>>> +                                  "amlogic,axg-tdmin";
>>> +                     reg =3D <0x0 0x3c0 0x0 0x40>;
>>> +                     sound-name-prefix =3D "TDMIN_LB";
>>> +                     resets =3D <&clkc_audio AUD_RESET_TDMIN_LB>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TDMIN_LB>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK_SEL=
>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>;
>>> +                     clock-names =3D "pclk", "sclk", "sclk_sel",
>>> +                                   "lrclk", "lrclk_sel";
>>> +             };
>>> +
>>> +             spdifin: audio-controller@400 {
>>> +                     compatible =3D "amlogic,g12a-spdifin",
>>> +                                  "amlogic,axg-spdifin";
>>> +                     reg =3D <0x0 0x400 0x0 0x30>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "SPDIFIN";
>>> +                     interrupts =3D <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_SPDIFIN>,
>>> +                     <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
>>> +                     clock-names =3D "pclk", "refclk";
>>> +                     resets =3D <&clkc_audio AUD_RESET_SPDIFIN>;
>>> +             };
>>> +
>>> +             spdifout_a: audio-controller@480 {
>>> +                     compatible =3D "amlogic,g12a-spdifout",
>>> +                                  "amlogic,axg-spdifout";
>>> +                     reg =3D <0x0 0x480 0x0 0x50>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "SPDIFOUT_A";
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_SPDIFOUT>,
>>> +                     <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
>>> +                     clock-names =3D "pclk", "mclk";
>>> +                     resets =3D <&clkc_audio AUD_RESET_SPDIFOUT>;
>>> +             };
>>> +
>>> +             tdmout_a: audio-controller@500 {
>>> +                     compatible =3D "amlogic,sm1-tdmout";
>>> +                     reg =3D <0x0 0x500 0x0 0x40>;
>>> +                     sound-name-prefix =3D "TDMOUT_A";
>>> +                     resets =3D <&clkc_audio AUD_RESET_TDMOUT_A>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TDMOUT_A>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL=
>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
>>> +                     clock-names =3D "pclk", "sclk", "sclk_sel",
>>> +                                   "lrclk", "lrclk_sel";
>>> +             };
>>> +
>>> +             tdmout_b: audio-controller@540 {
>>> +                     compatible =3D "amlogic,sm1-tdmout";
>>> +                     reg =3D <0x0 0x540 0x0 0x40>;
>>> +                     sound-name-prefix =3D "TDMOUT_B";
>>> +                     resets =3D <&clkc_audio AUD_RESET_TDMOUT_B>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TDMOUT_B>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK_SEL=
>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>;
>>> +                     clock-names =3D "pclk", "sclk", "sclk_sel",
>>> +                                   "lrclk", "lrclk_sel";
>>> +             };
>>> +
>>> +             tdmout_c: audio-controller@580 {
>>> +                     compatible =3D "amlogic,sm1-tdmout";
>>> +                     reg =3D <0x0 0x580 0x0 0x40>;
>>> +                     sound-name-prefix =3D "TDMOUT_C";
>>> +                     resets =3D <&clkc_audio AUD_RESET_TDMOUT_C>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TDMOUT_C>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK_SEL=
>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>,
>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>;
>>> +                     clock-names =3D "pclk", "sclk", "sclk_sel",
>>> +                                   "lrclk", "lrclk_sel";
>>> +             };
>>> +
>>> +             spdifout_b: audio-controller@680 {
>>> +                     compatible =3D "amlogic,g12a-spdifout",
>>> +                                  "amlogic,axg-spdifout";
>>> +                     reg =3D <0x0 0x680 0x0 0x50>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "SPDIFOUT_B";
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
>>> +                              <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
>>> +                     clock-names =3D "pclk", "mclk";
>>> +                     resets =3D <&clkc_audio AUD_RESET_SPDIFOUT_B>;
>>> +             };
>>> +
>>> +             toacodec: audio-controller@740 {
>>> +                     compatible =3D "amlogic,s4-tocodec";
>>> +                     reg =3D <0x0 0x740 0x0 0x4>;
>>> +                     sound-name-prefix =3D "TOACODEC";
>>> +                     resets =3D <&clkc_audio AUD_RESET_TOACODEC>;
>>> +             };
>>> +
>>> +             tohdmitx: audio-controller@744 {
>>> +                     compatible =3D "amlogic,sm1-tohdmitx",
>>> +                                  "amlogic,g12a-tohdmitx";
>>> +                     reg =3D <0x0 0x744 0x0 0x4>;
>>> +                     #sound-dai-cells =3D <1>;
>>> +                     sound-name-prefix =3D "TOHDMITX";
>>> +                     resets =3D <&clkc_audio AUD_RESET_TOHDMITX>;
>>> +             };
>>> +
>>> +             toddr_d: audio-controller@840 {
>>> +                     compatible =3D "amlogic,sm1-toddr",
>>> +                                  "amlogic,axg-toddr";
>>> +                     reg =3D <0x0 0x840 0x0 0x2c>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "TODDR_D";
>>> +                     interrupts =3D <GIC_SPI 45 IRQ_TYPE_EDGE_RISING>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_TODDR_D>;
>>> +                     resets =3D <&arb AXG_ARB_TODDR_D>,
>>> +                              <&clkc_audio AUD_RESET_TODDR_D>;
>>> +                     reset-names =3D "arb", "rst";
>>> +                     amlogic,fifo-depth =3D <256>;
>>> +             };
>>> +
>>> +             frddr_d: audio-controller@880 {
>>> +                      compatible =3D "amlogic,sm1-frddr",
>>> +                                   "amlogic,axg-frddr";
>>> +                     reg =3D <0x0 0x880 0x0 0x2c>;
>>> +                     #sound-dai-cells =3D <0>;
>>> +                     sound-name-prefix =3D "FRDDR_D";
>>> +                     interrupts =3D <GIC_SPI 46 IRQ_TYPE_EDGE_RISING>;
>>> +                     clocks =3D <&clkc_audio AUD_CLKID_FRDDR_D>;
>>> +                     resets =3D <&arb AXG_ARB_FRDDR_D>,
>>> +                              <&clkc_audio AUD_RESET_FRDDR_D>;
>>> +                     reset-names =3D "arb", "rst";
>>> +                     amlogic,fifo-depth =3D <256>;
>>> +             };
>>> +
>>> +             tdmout_pad: audio-controller@E58 {
>>> +                     compatible =3D "amlogic,s4-tdmout-pad";
>>> +                     reg =3D <0x0 0xe58 0x0 0x28>;
>>> +             };
>>> +     };
>>> +
>>> +     pdm: audio-controller@331000 {
>>> +             compatible =3D "amlogic,sm1-pdm",
>>> +                          "amlogic,axg-pdm";
>>> +             reg =3D <0x0 0x331000 0x0 0x34>;
>>> +             #sound-dai-cells =3D <0>;
>>> +             sound-name-prefix =3D "PDM";
>>> +             clocks =3D <&clkc_audio AUD_CLKID_PDM>,
>>> +                      <&clkc_audio AUD_CLKID_PDM_DCLK>,
>>> +                      <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
>>> +             clock-names =3D "pclk", "dclk", "sysclk";
>>> +             resets =3D <&clkc_audio AUD_RESET_PDM>;
>>> +             assigned-clocks =3D <&clkc_audio AUD_CLKID_PDM_DCLK_SEL>,
>>> +                               <&clkc_audio AUD_CLKID_PDM_SYSCLK_SEL>;
>>> +             assigned-clock-parents =3D <&clkc_pll CLKID_HIFI_PLL>,<&c=
lkc_pll CLKID_HIFI_PLL>;
>>> +     };
>>> +      acodec: audio-controller@1A000 {
>>> +             compatible =3D "amlogic,t9015";
>>> +             reg =3D <0x0 0x1A000 0x0 0x14>;
>>> +             #sound-dai-cells =3D <0>;
>>> +             sound-name-prefix =3D "ACODEC";
>>> +             clocks =3D <&clkc_periphs CLKID_ACODEC>;
>>> +             clock-names =3D "pclk";
>>> +             resets =3D <&reset RESET_ACODEC>;
>>> +     };
>>> +
>>> +};
>> --
>> Jerome

--=20
Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2136.outbound.protection.outlook.com [40.107.117.136])
	(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 F29B220F960;
	Tue, 14 Jan 2025 11:20:08 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.136
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736853612; cv=fail; b=ZunP+UhrrKSyBn0RTg6VdcY/GqWZ9V2SzIA1CIMccya97mxd6gYI8C4dDWNPos/OZVos2txyikET+oDQuAQ7JVT6nJdOhGMppCEngOwK624aBUZGqohcSt/+l/KPGv/KJ6gPfgSe09gQIgSUb3uFkopBgpyA+z4uGYy3UxD98q4=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736853612; c=relaxed/simple;
	bh=7xsKtczv0mMfTTJaCl7CA6rAywyEcFOMSv6MrRmQDzI=;
	h=Message-ID:Date:Subject:From:To:Cc:References:In-Reply-To:
	 Content-Type:MIME-Version; b=fCYcwn/eJWQ5AbWkUnCOisBEMPg4ClHU4OVvFE0oXj6fKp0piONMOp8/VFo/ARdaUg3NI8HXON43/UInP16u0aZ/hNIPBbYV8CacMJrlAqQNkUmaRwEjpQCZoOPjGNVk2GGYMkd+hYe2sNQMVRPFt0lzgggSUSxtZXvxC4X55aA=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=szqd4TM0; arc=fail smtp.client-ip=40.107.117.136
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="szqd4TM0"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Suc5pRj6JSMR2NdGhd0zYx2bE/S1dgT2eEGhdpg0ykZjt+kmemFnEDCaZhaTEMNYBFqJbEX0LqCfJtPovDRFwQpzeHA0XvfliZFjyPNof+thljJ1CgQmt2stXvpYyFt38+QCpWuCzQLHzXNPyESb70paBxr0n8RgloE+w48M0zTRng0EPt/dcHfZ2dObPgFGK1tXdQtWcFY3iRwcdmnpqyFT182V7MkZtLd8jq+nqtYwys1DcnmbsZlKwGvqX//B7gqg66xIvKgKH+umSTWqjwt7856C+gqRTFCYSEipmdRLplBagvNLk67IlEkIkDH2RB1FeOxmzzXKFtqo6QJTOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iR9PSIEClXFUh4k4bLWtR7fynvIZyNVokgCkYDn6+jo=;
 b=BzT3U9+h5TzYUM6xsbODh1nKcARDpzt1Iy0WhjQ76Fz2zRpkSyG7FmcQYxYG4JSuiSVGeS6CPab3f6fH+0FHK8yGuaPXsDG2OWCjB7r4uVg4yK7SYKq9XwTPS4IESjgjjwUfDoUzG/2Rz/410/WYiDjaLTZ4pvA02zlhlDuy4ZRaRi8kRhel+keX4cCEyQTGvKmfrmY2fc38ZtyLXd++MwTf3SRfXRhib5vgf/SehHHL4YFcy3MeggbcYyEU0hgysllgM5wVUY/vNAzcaG2eWYOpQyl3hSBgGjLYkdd0VYGlBaE1EDYNgiTuh0UfSwSoPv5hbkZP9YLRqaA4jZjSkA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iR9PSIEClXFUh4k4bLWtR7fynvIZyNVokgCkYDn6+jo=;
 b=szqd4TM01YQdSfdsI5hxbQDx0cwezeEGfGMJKXLfAZoYalNTlAkApFfHOmMYWYNkdl6s/1EfC+Xj+mZL68zUc5YXlTGJdl8DvhBClC2mlW2qEByfCGKVqgO05qAYfi0C8tCqu/Lwymp0zl/GKuYiC+i1Yp5Rg2F/I2GKvekcELZuwBw6zfRL1uxaQRDjcBhvh2b2YYs0shR5+mBRs6XzIIuB/VOpw0EjAq6zzAGijqSNTwbansYThFR8lWS8yuCKRljQYHxBjTwvVk+olHK9YLHxrL7XqJzyYcyutkOjiNXbIA/M4om3hELbKiH9zmXvop8prpgWK9Hjnmblsey5dQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by KL1PR03MB8495.apcprd03.prod.outlook.com (2603:1096:820:12f::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Tue, 14 Jan
 2025 11:20:05 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8335.017; Tue, 14 Jan 2025
 11:20:05 +0000
Message-ID: <e69cd38e-898c-4cbc-a327-14148a71c764@amlogic.com>
Date: Tue, 14 Jan 2025 19:20:00 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
From: Jiebing Chen <jiebing.chen@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>,
 jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
 <1jwmey9451.fsf@starbuckisacylon.baylibre.com>
 <e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
In-Reply-To: <e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: KL1P15301CA0059.APCP153.PROD.OUTLOOK.COM
 (2603:1096:820:3d::20) To PUZPR03MB7135.apcprd03.prod.outlook.com
 (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|KL1PR03MB8495:EE_
X-MS-Office365-Filtering-Correlation-Id: c062279e-8cee-4264-445a-08dd348d655a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?NkRwd1JROUJNcnp1MVphQ3V6UkVwVDBreWRhc1J2aHhWUW5nVlg3Rllmbk1w?=
 =?utf-8?B?NTd0R3ZNWmpLWEUxblFmdWVqN1lhU0tLWGQ3SVBGMTh1elVRUklvcFV6Tk9M?=
 =?utf-8?B?K1JlZUlWNjE2a0kyWVdVV1FiS05uZHVOczB0VTM0ZlhhUU9HOTlWQ2dIZXhX?=
 =?utf-8?B?V0VtYXY4TTN0NFdTNTdzQ0c0OHVkQVQ4SkNMT2pINFZCTTNFWGV4azYrSVVH?=
 =?utf-8?B?ZEZMN3BTbXRQL1lKcHRDSm9hNzVTWEhpRkhPekRZMm03UU5ObVhVZ09zQk1L?=
 =?utf-8?B?cnVmaXFNVnRsTVk2WVJ4N0wrQndTbEoyMVIwSjhhb0tLZWpDbFNzR2c3ajk0?=
 =?utf-8?B?SUp6Wk4waEljZGc3NTNXZjFQSzBxNCtYSTRJM2NuVE0xcXNObTdXMTBBSTF0?=
 =?utf-8?B?MFJYN01XT0NlZHd1aVgxSkJ6dTViWm1NQ0Y5YU81SHhQVGtpM2E5VkdqNERC?=
 =?utf-8?B?Ym1wSGZKUkI3YWEyTDdCdktSd3IzdlRDZ3hTUlFlL2pNSkVFOTU5Sy9mVzZz?=
 =?utf-8?B?eDh2NitmZ0szdjVWUkV5b3JQVEhGUTBCVS9COThwc29FNDhCaWNBY3NjWWFi?=
 =?utf-8?B?RnBFaXQ5bWtmQUtrL2VGYkozMFJpM2FXMFRMZGMzWG50UDk4Mk1NSG1lSlV3?=
 =?utf-8?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nB0VzFrNy8zZms1MzNkTGV2L0JhSlBGWE9WaTg0WHpOKzU5Q3Jw?=
 =?utf-8?B?eWFBNjBmWERtS29wY1hNM3hIbUZaeWZWWEVwNnlxWU9adXZZeVlPTG56ZUc3?=
 =?utf-8?B?UjZhdklwMFBqeXp2S3FuMkg4bU9FZGV6NzhFc00rZEIzcW0wQy9idlRoejhP?=
 =?utf-8?B?aDlqZk9jUGxIY1hvd0kyWkxuRzduc1lPUngxRDhzVmZ2NTdtUHJEaFp6Y3VS?=
 =?utf-8?B?SUlsTnZML1lJTnN4czdUQmlTQVRrOGltVlJCSVRSUmJXOUQ3N1VnZXlrY0tV?=
 =?utf-8?B?dnhNRlNNUmVpTTEwN2Z1VjhIcno3a3NzbDNsYTZmSTdiWlZ6aWNmeU00eU51?=
 =?utf-8?Q?Vx3dHYBWftg8Y?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR03MB7135.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(1800799024)(376014);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NHlWNjJUVzlSL0JHYlZCSlhhREhTSHV5SC9GUVRyb1hWaEJjNlNLeWJBVHZv?=
 =?utf-8?B?eEVHMEFpTVBGTW04RFJZdHZPOERHTmUrSnV1YWpTUUVESDE2MCtmOWJDR0xz?=
 =?utf-8?B?UEg4MXQ0ODkrQVMrZUNNZkQ2cjl4VzJCa2lDU24wZlF3UnE5TXlnckYxMXJF?=
 =?utf-8?B?TXFmMFQzK1dYMDBJMG1sQ2xTejBKVkhvd0NhcUxHdWhGR2Q0MFV0ejNSWjhr?=
 =?utf-8?B?Sll4d2Y5T1poajBBRjg3VmtsTDQycEdpcXV3YWxPdXp0Q2Q5MDdRamhGMWRD?=
 =?utf-8?B?cllyel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b3BYWjhG?=
 =?utf-8?B?cFZtNGt0TUtYSHgwTXJJenk5TGp5TEU5VjNKdU9VNUhuTXZHZmxBQXkzem9k?=
 =?utf-8?B?TVl5dkNjQkFWTEZyK1A1Mms3MzBRdCsxNjRQLytmNTBTZ1pDd2g4T2NQOW1G?=
 =?utf-8?B?Tmc9PQ==?=
X-OriginatorOrg: amlogic.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c062279e-8cee-4264-445a-08dd348d655a
X-MS-Exchange-CrossTenant-AuthSource: PUZPR03MB7135.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 11:20:05.4274
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: dL5+G0MVjtANcHts3+9mavQSKzLoEmFTmfYmnzfK+VuIenEw69ccPLYctoLnRIcnq0EH8U/YnyqlIScAEsWjjMRdW2mue1piyg7p2o5JGl0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR03MB8495


在 2025/1/14 16:16, Jiebing Chen 写道:
>
> 在 2025/1/13 22:31, Jerome Brunet 写道:
>> [ EXTERNAL EMAIL ]
>>
>> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay 
>> <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:
>>
>>> From: jiebing chen <jiebing.chen@amlogic.com>
>>>
>>> Add audio support for Amlogic S4.The audio output pad
>>> can be freelycombined with the output lane,and the tocodec
>>> control logic has been optimized.
>> The patch is a mixture of different HW modules.
>>
>> Each patch should have one clear purpose and, as such, deal with a
>> single HW module
>>
>>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>>> ---
>>>   sound/soc/meson/Kconfig              |  16 ++
>>>   sound/soc/meson/Makefile             |   6 +
>>>   sound/soc/meson/s4-pad-out-control.c | 372 
>>> ++++++++++++++++++++++++++++++++++
>>>   sound/soc/meson/s4-tocodec-control.c | 376 
>>> +++++++++++++++++++++++++++++++++++
>>>   sound/soc/meson/t9015.c              |   5 +-
>>>   5 files changed, 771 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/sound/soc/meson/Kconfig b/sound/soc/meson/Kconfig
>>> index 
>>> 6458d5dc4902f665211bb9e4ae7d274e4bff2fdc..d01e284642fd987cf4bdf88e5bf5f7c9a241af59 
>>> 100644
>>> --- a/sound/soc/meson/Kconfig
>>> +++ b/sound/soc/meson/Kconfig
>>> @@ -69,6 +69,8 @@ config SND_MESON_AXG_SOUND_CARD
>>>        imply SND_MESON_AXG_SPDIFIN
>>>        imply SND_MESON_AXG_PDM
>>>        imply SND_MESON_G12A_TOACODEC
>>> +     imply SND_SOC_MESON_PAD_OUT
>>> +     imply SND_SOC_MESON_TOCODEC_CONTROL
>>>        imply SND_MESON_G12A_TOHDMITX if DRM_MESON_DW_HDMI
>>>        help
>>>          Select Y or M to add support for the AXG SoC sound card
>>> @@ -135,4 +137,18 @@ config SND_SOC_MESON_T9015
>>>        help
>>>          Say Y or M if you want to add support for the internal DAC 
>>> found
>>>          on GXL, G12 and SM1 SoC family.
>>> +
>>> +config SND_SOC_MESON_PAD_OUT
>>> +     tristate "Amlogic PAD OUT"
>>> +     select REGMAP_MMIO
>>> +     help
>>> +       Say Y or M if you want to add support for the S4 Audio 
>>> Output from
>>> +       the data Pad.
>>> +
>>> +config SND_SOC_MESON_TOCODEC_CONTROL
>>> +     tristate "Amlogic TOCODEC CONTROL"
>>> +     select REGMAP_MMIO
>>> +     help
>>> +      Say Y or M if you want to add support for the internal DAC 
>>> control
>>> +      on SM1 SoC family.
>>>   endmenu
>>> diff --git a/sound/soc/meson/Makefile b/sound/soc/meson/Makefile
>>> index 
>>> 24078e4396b02d545d8ba4bcb1632979001354e3..afbefcb1313670f9b1365e88b8eb1a0badd7dc1e 
>>> 100644
>>> --- a/sound/soc/meson/Makefile
>>> +++ b/sound/soc/meson/Makefile
>>> @@ -24,8 +24,11 @@ snd-soc-meson-codec-glue-y := meson-codec-glue.o
>>>   snd-soc-meson-gx-sound-card-y := gx-card.o
>>>   snd-soc-meson-g12a-toacodec-y := g12a-toacodec.o
>>>   snd-soc-meson-g12a-tohdmitx-y := g12a-tohdmitx.o
>>> +snd-soc-meson-s4-padout-objs := s4-pad-out-control.o
>>> +snd-soc-meson-s4-tocodec-control-objs := s4-tocodec-control.o
>>>   snd-soc-meson-t9015-y := t9015.o
>>>
>>> +
>>>   obj-$(CONFIG_SND_MESON_AIU) += snd-soc-meson-aiu.o
>>>   obj-$(CONFIG_SND_MESON_AXG_FIFO) += snd-soc-meson-axg-fifo.o
>>>   obj-$(CONFIG_SND_MESON_AXG_FRDDR) += snd-soc-meson-axg-frddr.o
>>> @@ -43,4 +46,7 @@ obj-$(CONFIG_SND_MESON_CODEC_GLUE) += 
>>> snd-soc-meson-codec-glue.o
>>>   obj-$(CONFIG_SND_MESON_GX_SOUND_CARD) += 
>>> snd-soc-meson-gx-sound-card.o
>>>   obj-$(CONFIG_SND_MESON_G12A_TOACODEC) += 
>>> snd-soc-meson-g12a-toacodec.o
>>>   obj-$(CONFIG_SND_MESON_G12A_TOHDMITX) += 
>>> snd-soc-meson-g12a-tohdmitx.o
>>> +obj-$(CONFIG_SND_SOC_MESON_PAD_OUT) += snd-soc-meson-s4-padout.o
>>> +obj-$(CONFIG_SND_SOC_MESON_TOCODEC_CONTROL) += 
>>> snd-soc-meson-s4-tocodec-control.o
>>>   obj-$(CONFIG_SND_SOC_MESON_T9015) += snd-soc-meson-t9015.o
>>> +
>>> diff --git a/sound/soc/meson/s4-pad-out-control.c 
>>> b/sound/soc/meson/s4-pad-out-control.c
>>> new file mode 100644
>>> index 
>>> 0000000000000000000000000000000000000000..a86dcf8a5995926f0ddf8d2911f42006daed0feb
>>> --- /dev/null
>>> +++ b/sound/soc/meson/s4-pad-out-control.c
>>> @@ -0,0 +1,372 @@
>>> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
>>> +/*
>>> + * Copyright (C) 2024 Amlogic, Inc. All rights reserved
>>> + */
>>> +
>>> +#include <linux/module.h>
>>> +#include <linux/of_platform.h>
>>> +#include <linux/regmap.h>
>>> +#include <sound/soc.h>
>>> +#include <sound/soc-dai.h>
>>> +#include <linux/init.h>
>>> +#include <linux/kernel.h>
>>> +#include<linux/kstrtox.h>
>>> +
>>> +#include "axg-tdm.h"
>>> +
>>> +static const struct regmap_config tdmout_pad_regmap_cfg = {
>>> +     .reg_bits       = 32,
>>> +     .val_bits       = 32,
>>> +     .reg_stride     = 4,
>>> +     .max_register   = 0x28,
>>> +};
>>> +
>>> +#define TDM_IFACE 0
>>> +#define TDM_A_PAD 0
>>> +#define TDM_B_PAD 1
>>> +#define TDM_C_PAD 2
>>> +
>>> +#define EE_AUDIO_DAT_PAD_CTRL6 0x0
>>> +#define EE_AUDIO_DAT_PAD_CTRL7 0x4
>>> +#define EE_AUDIO_DAT_PAD_CTRL8 0x8
>>> +#define EE_AUDIO_DAT_PAD_CTRL9 0xc
>>> +#define EE_AUDIO_DAT_PAD_CTRLA 0x10
>>> +#define EE_AUDIO_DAT_PAD_CTRLB 0x14
>>> +#define EE_AUDIO_DAT_PAD_CTRLC 0x1c
>>> +#define EE_AUDIO_DAT_PAD_CTRLD 0x20
>>> +#define EE_AUDIO_DAT_PAD_CTRLE 0x24
>>> +#define EE_AUDIO_DAT_PAD_CTRLF 0x28
>>> +
>>> +#define REG_OFFSET 4
>>> +
>>> +static const char * const s4_tdmout_sel_texts[] = {
>>> +     "TDM_D0", "TDM_D1", "TDM_D2", "TDM_D3", "TDM_D4", "TDM_D5", 
>>> "TDM_D6", "TDM_D7",
>>> +     "TDM_D8", "TDM_D9", "TDM_D10", "TDM_D11", "TDM_D12", 
>>> "TDM_D13", "TDM_D14", "TDM_D15",
>>> +     "TDM_D16", "TDM_D17", "TDM_D18", "TDM_D19", "TDM_D20", 
>>> "TDM_D21", "TDM_D22", "TDM_D23",
>>> +     "TDM_D24", "TDM_D25", "TDM_D26", "TDM_D27", "TDM_D28", 
>>> "TDM_D29", "TDM_D30", "TDM_D31"
>>> +};
>> This thing does not belong in ASoC. This is clearly yet another layer of
>> pinctrl. Please deal with it there.
>
> Thanks for your suggestion, add audio pinctrl driver to control the 
> which tdm_dx pin can map the which tdm lane_x
> for example
>     tdm_d6_pin {
>         mux {
>             groups = "tdm_d6";
>             function = "tdmoutb_lane0";
>         };
>     }
> tdm_d6 pin map the tdmoutb lane 0, right ?
>
>>> +
>>> +static const struct soc_enum tdmout_sel_enum =
>>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tdmout_sel_texts),
>>> +                     s4_tdmout_sel_texts);
>>> +
>>> +static struct snd_soc_dai *tdm_get_ahead_be(struct 
>>> snd_soc_dapm_widget *w)
>>> +{
>>> +     struct snd_soc_dapm_path *p;
>>> +     struct snd_soc_dai *be;
>>> +
>>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>>> +             if (p->source->id == snd_soc_dapm_dai_in)
>>> +                     return (struct snd_soc_dai *)p->source->priv;
>>> +             be = tdm_get_ahead_be(p->source);
>>> +             if (be && be->id == TDM_IFACE)
>>> +                     return be;
>>> +     }
>>> +     return NULL;
>>> +}
>>> +
>>> +#define SND_SOC_DAPM_DEMUX_E(wname, wreg, wshift, winvert, 
>>> wcontrols, \
>>> +     wevent, wflags) \
>>> +((struct snd_soc_dapm_widget) { \
>>> +     .id = snd_soc_dapm_demux, .name = wname, \
>>> +     SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
>>> +     .kcontrol_news = wcontrols, .num_kcontrols = 1, \
>>> +     .event = wevent, .event_flags = wflags})
>>> +
>>> +static const struct snd_kcontrol_new tdmout_sel_demux[] = {
>>> +     SOC_DAPM_ENUM("TDMOUTA SEL", tdmout_sel_enum),
>>> +     SOC_DAPM_ENUM("TDMOUTB SEL", tdmout_sel_enum),
>>> +     SOC_DAPM_ENUM("TDMOUTC SEL", tdmout_sel_enum),
>>> +};
>>> +
>>> +static unsigned int aml_simple_strtoull(const char *cp)
>>> +{
>>> +     unsigned int result = 0;
>>> +     unsigned int value = 0;
>>> +     unsigned int len =  strlen(cp);
>>> +
>>> +     while (len != 0) {
>>> +             len--;
>>> +             value = isdigit(*cp);
>>> +             if (value) {
>>> +                     value = *cp - '0';
>>> +             } else {
>>> +                     cp++;
>>> +                     continue;
>>> +             }
>>> +             cp++;
>>> +             result = result * 10 + value;
>>> +     }
>>> +     return result;
>>> +}
>>> +
>>> +static int tdm_out_pad_set(struct snd_soc_dapm_widget *w)
>>> +{
>>> +     struct snd_soc_dai *be;
>>> +     struct axg_tdm_stream *stream;
>>> +     struct snd_soc_component *component = 
>>> snd_soc_dapm_to_component(w->dapm);
>>> +     unsigned int tdm_id = TDM_A_PAD;
>>> +     const char *dai_widget_name;
>>> +     struct snd_soc_dapm_path *p;
>>> +     unsigned int lane_num = 0;
>>> +     unsigned long pin = 0;
>>> +     unsigned int reg, mask, val = 0;
>>> +     int lane_cnt;
>>> +
>>> +     be = tdm_get_ahead_be(w);
>>> +     if (!be) {
>>> +             dev_err(component->dev, "%s not find the be\n", 
>>> __func__);
>>> +             return -EINVAL;
>>> +     }
>>> +     stream = snd_soc_dai_dma_data_get_playback(be);
>>> +     if (!stream) {
>>> +             dev_err(component->dev, "%s not find the stream\n", 
>>> __func__);
>>> +             return -EINVAL;
>>> +     }
>>> +     lane_cnt = (stream->channels - 1) / stream->iface->slots + 1;
>>> +     /*we like to use dai id, but it is fixed val*/
>>> +     dai_widget_name = 
>>> be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
>>> +     if (strstr(dai_widget_name, "TDM_A"))
>>> +             tdm_id = TDM_A_PAD;
>>> +     else if (strstr(dai_widget_name, "TDM_B"))
>>> +             tdm_id = TDM_B_PAD;
>>> +     else if (strstr(dai_widget_name, "TDM_C"))
>>> +             tdm_id = TDM_C_PAD;
>>> +     else
>>> +             dev_err(component->dev, "%s not find the be dai 
>>> widget\n", __func__);
>>> +     dev_dbg(component->dev, "tdm_id:%d, channel:%d, slot:%d\n",
>>> +             tdm_id, stream->channels, stream->iface->slots);
>>> +     snd_soc_dapm_widget_for_each_sink_path(w, p) {
>>> +             if (p->sink->id == snd_soc_dapm_output) {
>>> +                     if (p->connect) {
>>> +                             pin = aml_simple_strtoull(p->name);
>>> +                             reg = (pin / 4) * REG_OFFSET;
>>> +                             /*calculate mask pos */
>>> +                             mask = 0x1f << ((pin % 4) * 8);
>>> +                             val = tdm_id * 8 + lane_num;
>>> + snd_soc_component_update_bits(component, reg, mask, val);
>>> + snd_soc_component_update_bits(component, EE_AUDIO_DAT_PAD_CTRLF,
>>> + 0x1 << pin, 0 << pin);
>>> +                             lane_num++;
>>> +                             if (lane_num > lane_cnt - 1)
>>> +                                     break;
>>> +                     }
>>> +             }
>>> +     }
>>> +     return 0;
>>> +}
>>> +
>>> +static int tdmout_sel_pad_event(struct snd_soc_dapm_widget *w,
>>> +                             struct snd_kcontrol *control,
>>> +                             int event)
>>> +{
>>> +     int ret = 0;
>>> +     struct snd_soc_component *component = 
>>> snd_soc_dapm_to_component(w->dapm);
>>> +
>>> +     switch (event) {
>>> +     case SND_SOC_DAPM_PRE_PMU:
>>> +             tdm_out_pad_set(w);
>>> +             break;
>>> +
>>> +     case SND_SOC_DAPM_PRE_PMD:
>>> +             break;
>>> +
>>> +     default:
>>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>>> +             return -EINVAL;
>>> +     }
>>> +
>>> +     return ret;
>>> +}
>>> +
>>> +static const struct snd_soc_dapm_widget 
>>> s4_tdmout_pad_dapm_widgets[] = {
>>> +     SND_SOC_DAPM_DEMUX_E("TDMA_OUT SEL", SND_SOC_NOPM, 0, 0,
>>> +                          &tdmout_sel_demux[TDM_A_PAD], 
>>> tdmout_sel_pad_event,
>>> +                        (SND_SOC_DAPM_PRE_PMU | 
>>> SND_SOC_DAPM_PRE_PMD)),
>>> +     SND_SOC_DAPM_DEMUX_E("TDMB_OUT SEL", SND_SOC_NOPM, 0, 0,
>>> +                          &tdmout_sel_demux[TDM_B_PAD], 
>>> tdmout_sel_pad_event,
>>> +                        (SND_SOC_DAPM_PRE_PMU | 
>>> SND_SOC_DAPM_PRE_PMD)),
>>> +     SND_SOC_DAPM_DEMUX_E("TDMC_OUT SEL", SND_SOC_NOPM, 0, 0,
>>> +                          &tdmout_sel_demux[TDM_C_PAD], 
>>> tdmout_sel_pad_event,
>>> +                        (SND_SOC_DAPM_PRE_PMU | 
>>> SND_SOC_DAPM_PRE_PMD)),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D0"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D1"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D2"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D3"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D4"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D5"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D6"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D7"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D8"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D9"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D10"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D11"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D12"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D13"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D14"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D15"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D16"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D17"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D18"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D19"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D20"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D21"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D22"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D23"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D24"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D25"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D26"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D27"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D28"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D29"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D30"),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_D31"),
>>> +};
>>> +
>>> +static const struct snd_soc_dapm_route s4_tdmout_pad_dapm_routes[] = {
>>> +     { "TDM_D0", "TDM_D0", "TDMA_OUT SEL" },
>>> +     { "TDM_D1", "TDM_D1", "TDMA_OUT SEL" },
>>> +     { "TDM_D2", "TDM_D2", "TDMA_OUT SEL" },
>>> +     { "TDM_D3", "TDM_D3", "TDMA_OUT SEL" },
>>> +     { "TDM_D4", "TDM_D4", "TDMA_OUT SEL" },
>>> +     { "TDM_D5", "TDM_D5", "TDMA_OUT SEL" },
>>> +     { "TDM_D6", "TDM_D6", "TDMA_OUT SEL" },
>>> +     { "TDM_D7", "TDM_D7", "TDMA_OUT SEL" },
>>> +     { "TDM_D8", "TDM_D8", "TDMA_OUT SEL" },
>>> +     { "TDM_D9", "TDM_D9", "TDMA_OUT SEL" },
>>> +     { "TDM_D10", "TDM_D10", "TDMA_OUT SEL" },
>>> +     { "TDM_D11", "TDM_D11", "TDMA_OUT SEL" },
>>> +     { "TDM_D12", "TDM_D12", "TDMA_OUT SEL" },
>>> +     { "TDM_D13", "TDM_D13", "TDMA_OUT SEL" },
>>> +     { "TDM_D14", "TDM_D14", "TDMA_OUT SEL" },
>>> +     { "TDM_D15", "TDM_D15", "TDMA_OUT SEL" },
>>> +     { "TDM_D16", "TDM_D16", "TDMA_OUT SEL" },
>>> +     { "TDM_D17", "TDM_D17", "TDMA_OUT SEL" },
>>> +     { "TDM_D18", "TDM_D18", "TDMA_OUT SEL" },
>>> +     { "TDM_D19", "TDM_D19", "TDMA_OUT SEL" },
>>> +     { "TDM_D20", "TDM_D20", "TDMA_OUT SEL" },
>>> +     { "TDM_D21", "TDM_D21", "TDMA_OUT SEL" },
>>> +     { "TDM_D22", "TDM_D22", "TDMA_OUT SEL" },
>>> +     { "TDM_D23", "TDM_D23", "TDMA_OUT SEL" },
>>> +     { "TDM_D24", "TDM_D24", "TDMA_OUT SEL" },
>>> +     { "TDM_D25", "TDM_D25", "TDMA_OUT SEL" },
>>> +     { "TDM_D26", "TDM_D26", "TDMA_OUT SEL" },
>>> +     { "TDM_D27", "TDM_D27", "TDMA_OUT SEL" },
>>> +     { "TDM_D28", "TDM_D28", "TDMA_OUT SEL" },
>>> +     { "TDM_D29", "TDM_D29", "TDMA_OUT SEL" },
>>> +     { "TDM_D30", "TDM_D30", "TDMA_OUT SEL" },
>>> +     { "TDM_D31", "TDM_D31", "TDMA_OUT SEL" },
>>> +     { "TDM_D0", "TDM_D0", "TDMB_OUT SEL" },
>>> +     { "TDM_D1", "TDM_D1", "TDMB_OUT SEL" },
>>> +     { "TDM_D2", "TDM_D2", "TDMB_OUT SEL" },
>>> +     { "TDM_D3", "TDM_D3", "TDMB_OUT SEL" },
>>> +     { "TDM_D4", "TDM_D4", "TDMB_OUT SEL" },
>>> +     { "TDM_D5", "TDM_D5", "TDMB_OUT SEL" },
>>> +     { "TDM_D6", "TDM_D6", "TDMB_OUT SEL" },
>>> +     { "TDM_D7", "TDM_D7", "TDMB_OUT SEL" },
>>> +     { "TDM_D8", "TDM_D8", "TDMB_OUT SEL" },
>>> +     { "TDM_D9", "TDM_D9", "TDMB_OUT SEL" },
>>> +     { "TDM_D10", "TDM_D10", "TDMB_OUT SEL" },
>>> +     { "TDM_D11", "TDM_D11", "TDMB_OUT SEL" },
>>> +     { "TDM_D12", "TDM_D12", "TDMB_OUT SEL" },
>>> +     { "TDM_D13", "TDM_D13", "TDMB_OUT SEL" },
>>> +     { "TDM_D14", "TDM_D14", "TDMB_OUT SEL" },
>>> +     { "TDM_D15", "TDM_D15", "TDMB_OUT SEL" },
>>> +
>>> +     { "TDM_D16", "TDM_D16", "TDMB_OUT SEL" },
>>> +     { "TDM_D17", "TDM_D17", "TDMB_OUT SEL" },
>>> +     { "TDM_D18", "TDM_D18", "TDMB_OUT SEL" },
>>> +     { "TDM_D19", "TDM_D19", "TDMB_OUT SEL" },
>>> +     { "TDM_D20", "TDM_D20", "TDMB_OUT SEL" },
>>> +     { "TDM_D21", "TDM_D21", "TDMB_OUT SEL" },
>>> +     { "TDM_D22", "TDM_D22", "TDMB_OUT SEL" },
>>> +     { "TDM_D23", "TDM_D23", "TDMB_OUT SEL" },
>>> +     { "TDM_D24", "TDM_D24", "TDMB_OUT SEL" },
>>> +     { "TDM_D25", "TDM_D25", "TDMB_OUT SEL" },
>>> +     { "TDM_D26", "TDM_D26", "TDMB_OUT SEL" },
>>> +     { "TDM_D27", "TDM_D27", "TDMB_OUT SEL" },
>>> +     { "TDM_D28", "TDM_D28", "TDMB_OUT SEL" },
>>> +     { "TDM_D29", "TDM_D29", "TDMB_OUT SEL" },
>>> +     { "TDM_D30", "TDM_D30", "TDMB_OUT SEL" },
>>> +     { "TDM_D31", "TDM_D31", "TDMB_OUT SEL" },
>>> +     { "TDM_D0", "TDM_D0", "TDMC_OUT SEL" },
>>> +     { "TDM_D1", "TDM_D1", "TDMC_OUT SEL" },
>>> +     { "TDM_D2", "TDM_D2", "TDMC_OUT SEL" },
>>> +     { "TDM_D3", "TDM_D3", "TDMC_OUT SEL" },
>>> +     { "TDM_D4", "TDM_D4", "TDMC_OUT SEL" },
>>> +     { "TDM_D5", "TDM_D5", "TDMC_OUT SEL" },
>>> +     { "TDM_D6", "TDM_D6", "TDMC_OUT SEL" },
>>> +     { "TDM_D7", "TDM_D7", "TDMC_OUT SEL" },
>>> +     { "TDM_D8", "TDM_D8", "TDMC_OUT SEL" },
>>> +     { "TDM_D9", "TDM_D9", "TDMC_OUT SEL" },
>>> +     { "TDM_D10", "TDM_D10", "TDMC_OUT SEL" },
>>> +     { "TDM_D11", "TDM_D11", "TDMC_OUT SEL" },
>>> +     { "TDM_D12", "TDM_D12", "TDMC_OUT SEL" },
>>> +     { "TDM_D13", "TDM_D13", "TDMC_OUT SEL" },
>>> +     { "TDM_D14", "TDM_D14", "TDMC_OUT SEL" },
>>> +     { "TDM_D15", "TDM_D15", "TDMC_OUT SEL" },
>>> +     { "TDM_D16", "TDM_D16", "TDMC_OUT SEL" },
>>> +     { "TDM_D17", "TDM_D17", "TDMC_OUT SEL" },
>>> +     { "TDM_D18", "TDM_D18", "TDMC_OUT SEL" },
>>> +     { "TDM_D19", "TDM_D19", "TDMC_OUT SEL" },
>>> +     { "TDM_D20", "TDM_D20", "TDMC_OUT SEL" },
>>> +     { "TDM_D21", "TDM_D21", "TDMC_OUT SEL" },
>>> +     { "TDM_D22", "TDM_D22", "TDMC_OUT SEL" },
>>> +     { "TDM_D23", "TDM_D23", "TDMC_OUT SEL" },
>>> +     { "TDM_D24", "TDM_D24", "TDMC_OUT SEL" },
>>> +     { "TDM_D25", "TDM_D25", "TDMC_OUT SEL" },
>>> +     { "TDM_D26", "TDM_D26", "TDMC_OUT SEL" },
>>> +     { "TDM_D27", "TDM_D27", "TDMC_OUT SEL" },
>>> +     { "TDM_D28", "TDM_D28", "TDMC_OUT SEL" },
>>> +     { "TDM_D29", "TDM_D29", "TDMC_OUT SEL" },
>>> +     { "TDM_D30", "TDM_D30", "TDMC_OUT SEL" },
>>> +     { "TDM_D31", "TDM_D31", "TDMC_OUT SEL" },
>>> +};
>>> +
>>> +static const struct snd_soc_component_driver 
>>> s4_tdmout_pad_component_drv = {
>>> +     .dapm_widgets           = s4_tdmout_pad_dapm_widgets,
>>> +     .num_dapm_widgets       = ARRAY_SIZE(s4_tdmout_pad_dapm_widgets),
>>> +     .dapm_routes            = s4_tdmout_pad_dapm_routes,
>>> +     .num_dapm_routes        = ARRAY_SIZE(s4_tdmout_pad_dapm_routes),
>>> +
>>> +};
>>> +
>>> +static const struct of_device_id s4_tdmout_pad_of_match[] = {
>>> +     {
>>> +             .compatible = "amlogic,s4-tdmout-pad",
>>> +     }, {}
>>> +};
>>> +
>>> +MODULE_DEVICE_TABLE(of, s4_tdmout_pad_of_match);
>>> +
>>> +static int tdm_pad_out_probe(struct platform_device *pdev)
>>> +{
>>> +     struct device *dev = &pdev->dev;
>>> +     struct regmap *map;
>>> +     void __iomem *regs;
>>> +
>>> +     regs = devm_platform_ioremap_resource(pdev, 0);
>>> +     if (IS_ERR(regs))
>>> +             return PTR_ERR(regs);
>>> +
>>> +     map = devm_regmap_init_mmio(dev, regs, &tdmout_pad_regmap_cfg);
>>> +     if (IS_ERR(map))
>>> +             return dev_err_probe(dev, PTR_ERR(map), "failed to 
>>> init regmap\n");
>>> +
>>> +     return devm_snd_soc_register_component(dev, 
>>> &s4_tdmout_pad_component_drv,
>>> +                                            NULL, 0);
>>> +}
>>> +
>>> +static struct platform_driver tdmout_pad_pdrv = {
>>> +     .probe = tdm_pad_out_probe,
>>> +     .driver = {
>>> +             .name = "s4-pad-out",
>>> +             .of_match_table = s4_tdmout_pad_of_match,
>>> +     },
>>> +};
>>> +
>>> +module_platform_driver(tdmout_pad_pdrv);
>>> +
>>> +MODULE_DESCRIPTION("Amlogic TDM PAD DRIVER");
>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>> +MODULE_LICENSE("GPL");
>>> diff --git a/sound/soc/meson/s4-tocodec-control.c 
>>> b/sound/soc/meson/s4-tocodec-control.c
>>> new file mode 100644
>>> index 
>>> 0000000000000000000000000000000000000000..e5d824fae0eba545d38dc36e2566e7cee590e7f5
>>> --- /dev/null
>>> +++ b/sound/soc/meson/s4-tocodec-control.c
>> There is already a to-acodec driver a not reason has been provided as 
>> to why a
>> completly new driver is required.
>>
>> Please have look at the existing driver and do try to use it.
>> If you need to do things so differently, clear justification are 
>> necessary.
>
> for g12a-toacodec.c, we find the tocodec clock source can't get 
> the clock id from the tdm Be device,
>
> and set it by the kcontrol from user,  For different soc chips, The 
> kcontrol value maybe different, The kcontrol configuration doesn't 
> look very friendly for user
>
> so we use dapm route path to manage it, 
> fe(fddr)->be(tdm)->(tocodec)->(codec),  and use the aux-devs to 
> register,  and sound card only include the
>
> sound-dai = <&tdmif_a>
>
> codec-0 {
>                 sound-dai = <&acodec>;
>  };
>
> and not include
>
> codec-1 {
>                 sound-dai = <&toacodec>;
>  };
>
> when tdm work, only connect the tocodec path
>
>  "TDM_A Playback" ->"TOACODEC TDMA"->"TOACODEC INPUT SRC"
>
> iterate it find the be device ,and get the struct axg_tdm_stream, so 
> we can get the tdm clock id
>
> Take into account behavioral differences, we add new tocodec driver 
> for s4
>
>>> @@ -0,0 +1,376 @@
>>> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
>>> +/*
>>> + * Copyright (C) 2023 Amlogic, Inc. All rights reserved
>>> + */
>>> +
>>> +#include <linux/module.h>
>>> +#include <linux/of_platform.h>
>>> +#include <linux/regmap.h>
>>> +#include <sound/soc.h>
>>> +#include <sound/soc-dai.h>
>>> +#include <linux/init.h>
>>> +#include <linux/kernel.h>
>>> +#include<linux/kstrtox.h>
>>> +#include <linux/clk-provider.h>
>>> +#include <linux/reset.h>
>>> +#include "axg-tdm.h"
>>> +
>>> +#define TOACODEC_CTRL0                       0x0
>>> +
>>> +#define CTRL0_ENABLE_SHIFT           31
>>> +#define CTRL0_BCLK_ENABLE_SHIFT              30
>>> +#define CTRL0_MCLK_ENABLE_SHIFT              29
>>> +#define CTRL0_BLK_CAP_INV_SHIFT              9
>>> +
>>> +#define TDM_IFACE 0
>>> +#define TDM_A_PAD 0
>>> +#define TDM_B_PAD 1
>>> +#define TDM_C_PAD 2
>>> +
>>> +struct toacodec {
>>> +     struct regmap_field *field_dat_sel;
>>> +     struct regmap_field *field_lrclk_sel;
>>> +     struct regmap_field *field_bclk_sel;
>>> +     struct regmap_field *field_mclk_sel;
>>> +};
>>> +
>>> +struct toacodec_match_data {
>>> +     const struct snd_soc_component_driver *component_drv;
>>> +     const struct reg_field field_dat_sel;
>>> +     const struct reg_field field_lrclk_sel;
>>> +     const struct reg_field field_bclk_sel;
>>> +     const struct reg_field field_mclk_sel;
>>> +};
>>> +
>>> +static const struct regmap_config tocodec_regmap_cfg = {
>>> +     .reg_bits       = 32,
>>> +     .val_bits       = 32,
>>> +     .reg_stride     = 4,
>>> +     .max_register   = 0x1,
>>> +};
>>> +
>>> +#define S4_LANE_OFFSET 8
>>> +
>>> +static const char * const s4_tocodec_lane_sel_texts[] = {
>>> +     "Lane0", "Lane1", "Lane2", "Lane3", "Lane4", "Lane5", "Lane6", 
>>> "Lane7"
>>> +};
>>> +
>>> +static const struct soc_enum s4_tocodec_lane_sel_enum =
>>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, 
>>> ARRAY_SIZE(s4_tocodec_lane_sel_texts),
>>> +                     s4_tocodec_lane_sel_texts);
>>> +
>>> +static const struct snd_kcontrol_new s4_tocodec_lane_sel =
>>> +     SOC_DAPM_ENUM("TOCODEC LANE SEL", s4_tocodec_lane_sel_enum);
>>> +
>>> +static const char * const s4_tocodec_src_sel_texts[] = {
>>> +     "TDMA", "TDMB", "TDMC"
>>> +};
>>> +
>>> +static const struct soc_enum s4_tocodec_src_sel_enum =
>>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, 
>>> ARRAY_SIZE(s4_tocodec_src_sel_texts),
>>> +                     s4_tocodec_src_sel_texts);
>>> +
>>> +static const struct snd_kcontrol_new s4_tocodec_src_sel =
>>> +     SOC_DAPM_ENUM("TOCODEC SEL", s4_tocodec_src_sel_enum);
>>> +
>>> +static const struct snd_kcontrol_new s4_toacodec_out_enable =
>>> +     SOC_DAPM_SINGLE_AUTODISABLE("Switch", TOACODEC_CTRL0,
>>> +                                 CTRL0_ENABLE_SHIFT, 1, 0);
>>> +
>>> +static struct snd_soc_dai *tocodec_tdm_get_ahead_be(struct 
>>> snd_soc_dapm_widget *w)
>>> +{
>>> +     struct snd_soc_dapm_path *p;
>>> +     struct snd_soc_dai *be;
>>> +
>>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>>> +             if (!p->connect)
>>> +                     continue;
>>> +             if (p->source->id == snd_soc_dapm_dai_in)
>>> +                     return (struct snd_soc_dai *)p->source->priv;
>>> +             be = tocodec_tdm_get_ahead_be(p->source);
>>> +             if (be && be->id == TDM_IFACE)
>>> +                     return be;
>>> +     }
>>> +     return NULL;
>>> +}
>>> +
>>> +static unsigned int aml_simple_strtoull(const char *cp)
>>> +{
>>> +     unsigned int result = 0;
>>> +     unsigned int value = 0;
>>> +     unsigned int len = strlen(cp);
>>> +
>>> +     while (len != 0) {
>>> +             len--;
>>> +             value = isdigit(*cp);
>>> +             if (value) {
>>> +                     value = *cp - '0';
>>> +             } else {
>>> +                     cp++;
>>> +                     continue;
>>> +             }
>>> +             cp++;
>>> +             result = result * 10 + value;
>>> +     }
>>> +     return result;
>>> +}
>>> +
>>> +static int aml_get_clk_id(const char *name)
>>> +{
>>> +     int clk_id = 0;
>>> +
>>> +     if (strstr(name, "mst_a"))
>>> +             clk_id = 0;
>>> +     else if (strstr(name, "mst_b"))
>>> +             clk_id = 1;
>>> +     else if (strstr(name, "mst_c"))
>>> +             clk_id = 2;
>>> +     else if (strstr(name, "mst_d"))
>>> +             clk_id = 3;
>>> +     else if (strstr(name, "mst_e"))
>>> +             clk_id = 4;
>>> +     else if (strstr(name, "mst_f"))
>>> +             clk_id = 5;
>>> +
>>> +     return clk_id;
>>> +}
>>> +
>>> +static int aml_tocodec_sel_set(struct snd_soc_dapm_widget *w)
>>> +{
>>> +     struct snd_soc_dai *be;
>>> +     struct axg_tdm_stream *stream;
>>> +     struct axg_tdm_iface *iface;
>>> +     struct snd_soc_component *component = 
>>> snd_soc_dapm_to_component(w->dapm);
>>> +     struct toacodec *priv = snd_soc_component_get_drvdata(component);
>>> +     unsigned int tdm_id = TDM_A_PAD;
>>> +     const char *dai_widget_name;
>>> +     struct snd_soc_dapm_path *p;
>>> +     unsigned int lane = 0;
>>> +     unsigned int val = 0;
>>> +     struct clk *sclk, *mclk;
>>> +     char *clk_name;
>>> +     int mclk_id, sclk_id;
>>> +
>>> +     be = tocodec_tdm_get_ahead_be(w);
>>> +     if (!be) {
>>> +             dev_err(component->dev, "%s not find the be\n", 
>>> __func__);
>>> +             return -EINVAL;
>>> +     }
>>> +     stream = snd_soc_dai_dma_data_get_playback(be);
>>> +     if (!stream) {
>>> +             dev_err(component->dev, "%s not find the stream\n", 
>>> __func__);
>>> +             return -EINVAL;
>>> +     }
>>> +     /*we like to use dai id, but it is fixed val*/
>>> +     dai_widget_name = 
>>> be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
>>> +     if (strstr(dai_widget_name, "TDM_A"))
>>> +             tdm_id = TDM_A_PAD;
>>> +     else if (strstr(dai_widget_name, "TDM_B"))
>>> +             tdm_id = TDM_B_PAD;
>>> +     else if (strstr(dai_widget_name, "TDM_C"))
>>> +             tdm_id = TDM_C_PAD;
>>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>>> +             if (p->connect && p->name) {
>>> +                     lane = aml_simple_strtoull(p->name);
>>> +                     val = lane + tdm_id * S4_LANE_OFFSET;
>>> + regmap_field_write(priv->field_dat_sel, val);
>>> +             }
>>> +     }
>>> +     iface = stream->iface;
>>> +     mclk = iface->mclk;
>>> +     sclk = iface->sclk;
>>> +     mclk_id = aml_get_clk_id(__clk_get_name(mclk));
>>> +     sclk_id = aml_get_clk_id(__clk_get_name(sclk));
>>> +     regmap_field_write(priv->field_mclk_sel, mclk_id);
>>> +     regmap_field_write(priv->field_bclk_sel, sclk_id);
>>> +     regmap_field_write(priv->field_lrclk_sel, sclk_id);
>>> +
>>> +     return 0;
>>> +}
>>> +
>>> +static int tocodec_sel_event(struct snd_soc_dapm_widget *w,
>>> +                          struct snd_kcontrol *control,
>>> +                          int event)
>>> +{
>>> +     struct snd_soc_component *component = 
>>> snd_soc_dapm_to_component(w->dapm);
>>> +     int ret = 0;
>>> +
>>> +     switch (event) {
>>> +     case SND_SOC_DAPM_PRE_PMU:
>>> +             ret = aml_tocodec_sel_set(w);
>>> +             break;
>>> +
>>> +     case SND_SOC_DAPM_PRE_PMD:
>>> +             break;
>>> +
>>> +     default:
>>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>>> +             return -EINVAL;
>>> +     }
>>> +
>>> +     return ret;
>>> +}
>>> +
>>> +static int tocodec_clk_enable(struct snd_soc_dapm_widget *w,
>>> +                           struct snd_kcontrol *control,
>>> +                           int event)
>>> +{
>>> +     int ret = 0;
>>> +     unsigned int mask = 0, val = 0;
>>> +     struct snd_soc_component *component = 
>>> snd_soc_dapm_to_component(w->dapm);
>>> +
>>> +     snd_soc_component_update_bits(component, TOACODEC_CTRL0,
>>> +                                   1 << CTRL0_BLK_CAP_INV_SHIFT, 1 
>>> << CTRL0_BLK_CAP_INV_SHIFT);
>>> +     switch (event) {
>>> +     case SND_SOC_DAPM_PRE_PMU:
>>> +             mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << 
>>> CTRL0_BCLK_ENABLE_SHIFT;
>>> +             val = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << 
>>> CTRL0_BCLK_ENABLE_SHIFT;
>>> +             snd_soc_component_update_bits(component, 
>>> TOACODEC_CTRL0, mask, val);
>>> +             break;
>>> +     case SND_SOC_DAPM_PRE_PMD:
>>> +             mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << 
>>> CTRL0_BCLK_ENABLE_SHIFT;
>>> +             val = 0 << CTRL0_MCLK_ENABLE_SHIFT | 0 << 
>>> CTRL0_BCLK_ENABLE_SHIFT;
>>> +             snd_soc_component_update_bits(component, 
>>> TOACODEC_CTRL0, mask, val);
>>> +             break;
>>> +     default:
>>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>>> +             return -EINVAL;
>>> +     }
>>> +
>>> +     return ret;
>>> +}
>>> +
>>> +static const struct snd_soc_dapm_widget s4_toacodec_widgets[] = {
>>> +     SND_SOC_DAPM_MUX_E("Lane SRC", SND_SOC_NOPM, 0, 0,
>>> +                        &s4_tocodec_lane_sel, tocodec_sel_event,
>>> +                        (SND_SOC_DAPM_PRE_PMU | 
>>> SND_SOC_DAPM_PRE_PMD)),
>>> +     SND_SOC_DAPM_MUX("INPUT SRC", SND_SOC_NOPM, 0, 0, 
>>> &s4_tocodec_src_sel),
>>> +     SND_SOC_DAPM_SWITCH_E("OUT EN", SND_SOC_NOPM, 0, 0,
>>> +                           &s4_toacodec_out_enable, 
>>> tocodec_clk_enable,
>>> +                             (SND_SOC_DAPM_PRE_PMU | 
>>> SND_SOC_DAPM_PRE_PMD)),
>>> +     SND_SOC_DAPM_AIF_IN("TDMA", NULL, 0, SND_SOC_NOPM, 0, 0),
>>> +     SND_SOC_DAPM_AIF_IN("TDMB", NULL, 0, SND_SOC_NOPM, 0, 0),
>>> +     SND_SOC_DAPM_AIF_IN("TDMC", NULL, 0, SND_SOC_NOPM, 0, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane0", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane1", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane2", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane3", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane4", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane5", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane6", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane7", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_TO_ACODEC"),
>>> +};
>>> +
>>> +static const struct snd_soc_dapm_route s4_tocodec_dapm_routes[] = {
>>> +     { "INPUT SRC", "TDMA", "TDMA"},
>>> +     { "INPUT SRC", "TDMB", "TDMB"},
>>> +     { "INPUT SRC", "TDMC", "TDMC"},
>>> +     { "Lane0", NULL, "INPUT SRC" },
>>> +     { "Lane1", NULL, "INPUT SRC"},
>>> +     { "Lane2", NULL, "INPUT SRC"},
>>> +     { "Lane3", NULL, "INPUT SRC"},
>>> +     { "Lane4", NULL, "INPUT SRC"},
>>> +     { "Lane5", NULL, "INPUT SRC"},
>>> +     { "Lane6", NULL, "INPUT SRC"},
>>> +     { "Lane7", NULL, "INPUT SRC"},
>>> +     { "Lane SRC", "Lane0", "Lane0"},
>>> +     { "Lane SRC", "Lane1", "Lane1"},
>>> +     { "Lane SRC", "Lane2", "Lane2"},
>>> +     { "Lane SRC", "Lane3", "Lane3"},
>>> +     { "Lane SRC", "Lane4", "Lane4"},
>>> +     { "Lane SRC", "Lane5", "Lane5"},
>>> +     { "Lane SRC", "Lane6", "Lane6"},
>>> +     { "Lane SRC", "Lane7", "Lane7"},
>>> +     { "OUT EN", "Switch", "Lane SRC"},
>>> +     { "TDM_TO_ACODEC", NULL, "OUT EN"},
>>> +
>>> +};
>>> +
>>> +static const struct snd_soc_component_driver 
>>> s4_tocodec_component_drv = {
>>> +     .dapm_widgets           = s4_toacodec_widgets,
>>> +     .num_dapm_widgets       = ARRAY_SIZE(s4_toacodec_widgets),
>>> +     .dapm_routes            = s4_tocodec_dapm_routes,
>>> +     .num_dapm_routes        = ARRAY_SIZE(s4_tocodec_dapm_routes),
>>> +};
>>> +
>>> +static const struct toacodec_match_data s4_toacodec_match_data = {
>>> +     .component_drv  = &s4_tocodec_component_drv,
>>> +     .field_dat_sel  = REG_FIELD(TOACODEC_CTRL0, 16, 20),
>>> +     .field_lrclk_sel = REG_FIELD(TOACODEC_CTRL0, 12, 14),
>>> +     .field_bclk_sel = REG_FIELD(TOACODEC_CTRL0, 4, 6),
>>> +     .field_mclk_sel = REG_FIELD(TOACODEC_CTRL0, 0, 2),
>>> +};
>>> +
>>> +static const struct of_device_id s4_tocodec_of_match[] = {
>>> +     {
>>> +             .compatible = "amlogic,s4-tocodec",
>>> +             .data = &s4_toacodec_match_data,
>>> +     }, {}
>>> +};
>>> +
>>> +MODULE_DEVICE_TABLE(of, s4_tocodec_of_match);
>>> +
>>> +static int tocodec_probe(struct platform_device *pdev)
>>> +{
>>> +     const struct toacodec_match_data *data;
>>> +     struct device *dev = &pdev->dev;
>>> +     struct toacodec *priv;
>>> +     void __iomem *regs;
>>> +     struct regmap *map;
>>> +     int ret;
>>> +
>>> +     data = device_get_match_data(dev);
>>> +     if (!data)
>>> +             return dev_err_probe(dev, -ENODEV, "failed to match 
>>> device\n");
>>> +     priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>>> +     if (!priv)
>>> +             return -ENOMEM;
>>> +
>>> +     platform_set_drvdata(pdev, priv);
>>> +
>>> +     ret = device_reset(dev);
>>> +     if (ret)
>>> +             return ret;
>>> +
>>> +     regs = devm_platform_ioremap_resource(pdev, 0);
>>> +     if (IS_ERR(regs))
>>> +             return PTR_ERR(regs);
>>> +
>>> +     map = devm_regmap_init_mmio(dev, regs, &tocodec_regmap_cfg);
>>> +     if (IS_ERR(map))
>>> +             return dev_err_probe(dev, PTR_ERR(map), "failed to 
>>> init regmap\n");
>>> +
>>> +     priv->field_dat_sel = devm_regmap_field_alloc(dev, map, 
>>> data->field_dat_sel);
>>> +     if (IS_ERR(priv->field_dat_sel))
>>> +             return PTR_ERR(priv->field_dat_sel);
>>> +
>>> +     priv->field_lrclk_sel = devm_regmap_field_alloc(dev, map, 
>>> data->field_lrclk_sel);
>>> +     if (IS_ERR(priv->field_lrclk_sel))
>>> +             return PTR_ERR(priv->field_lrclk_sel);
>>> +
>>> +     priv->field_bclk_sel = devm_regmap_field_alloc(dev, map, 
>>> data->field_bclk_sel);
>>> +     if (IS_ERR(priv->field_bclk_sel))
>>> +             return PTR_ERR(priv->field_bclk_sel);
>>> +
>>> +     priv->field_mclk_sel = devm_regmap_field_alloc(dev, map, 
>>> data->field_mclk_sel);
>>> +     if (IS_ERR(priv->field_mclk_sel))
>>> +             return PTR_ERR(priv->field_mclk_sel);
>>> +
>>> +     return devm_snd_soc_register_component(dev,
>>> +                     data->component_drv, NULL, 0);
>>> +}
>>> +
>>> +static struct platform_driver tocodec_pdrv = {
>>> +     .probe = tocodec_probe,
>>> +     .driver = {
>>> +             .name = "s4-tocodec",
>>> +             .of_match_table = s4_tocodec_of_match,
>>> +     },
>>> +};
>>> +
>>> +module_platform_driver(tocodec_pdrv);
>>> +
>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>> +MODULE_LICENSE("GPL");
>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>> index 
>>> 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648 
>>> 100644
>>> --- a/sound/soc/meson/t9015.c
>>> +++ b/sound/soc/meson/t9015.c
>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
>>>                .channels_min = 1,
>>>                .channels_max = 2,
>>>                .rates = SNDRV_PCM_RATE_8000_96000,
>>> -             .formats = (SNDRV_PCM_FMTBIT_S8 |
>>> -                         SNDRV_PCM_FMTBIT_S16_LE |
>>> -                         SNDRV_PCM_FMTBIT_S20_LE |
>>> -                         SNDRV_PCM_FMTBIT_S24_LE),
>>> +             .formats = (SNDRV_PCM_FMTBIT_S16_LE | 
>>> SNDRV_PCM_FMTBIT_S32_LE),
>> Again, mixed up changes with zero justification.
>>
>> This drops S8 and S16 format support for the existing SoCs (such as GXL)
>> which is known to work and add S32 support on an HW documented as 24bits
>> only. Can you explain ?

for g12a, sm1 etc, it is use new audio ip, GXL is old ip, the new ip not 
support 24 bit,

usually support 16/32 bit for new audio ip , for 
SNDRV_PCM_FMTBIT_S24_LE, it width =24, phy =32

it was  treated as 32 bit to send for tdm, so we can only add the S32LE 
base on it , right ? but if the gxl not support the 32bit

we need add new snd_soc_dai_driver t9015_dai_s4 ?

>>
>>>        },
>>>        .ops = &t9015_dai_ops,
>>>   };
>> -- 
>> Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50])
	(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 2B5C3224B1A
	for <linux-kernel@vger.kernel.org>; Tue, 14 Jan 2025 11:29:38 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736854182; cv=none; b=TlcpcuHfxQQF49S1NjIgK9SG7dg+f75/tAgjJjWixi/J45+4xw3epsz0rbvY2HHnev2XtOx0IahXmqjtxKWwyAPrhPb+HQ7et+2lI8P9EbJ1aUoDRmI7onIi5H/RAG02ZoN2ggH+SG+vOGMslztZP/Z4rJf3STeAXPCJ9pAD5C4=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736854182; c=relaxed/simple;
	bh=gfLItUxX8r/5eNUOsxe0r4AKIyHN4OmPMNixaQGGsFI=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=TCE7b8bsBB8R92I40xDggMl4WaNPeJyKIIQokxfBQvZ9te1ygV98VfQXVOv4PZ/YD/NHOSzM0ncwTH4wg1aMd0znavw7vMfMTP7sdxnauSY4WH6+831obKCF6mHqZ1/IZ/bOo0KkN+O3fdGKOOm1UA81X2qxXwuIv8Jy5kfoBWg=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=S8P1hdBC; arc=none smtp.client-ip=209.85.128.50
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="S8P1hdBC"
Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-43626213fffso38697205e9.1
        for <linux-kernel@vger.kernel.org>; Tue, 14 Jan 2025 03:29:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736854177; x=1737458977; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=20Yjc/n2Ib6F5lS80pWb9OKE5xBeEql4XyvGsNk67XY=;
        b=S8P1hdBCdwAACntqN46gFaLULHO4+HHI7K7TehtZJz7eXVLHGF66Djp+MQ66q1o4D4
         pV7GqskBL/i6uLVq9oHhWaf4/pCNY+Q9XquEWv+MKLv/QPjtpyGCZAcAfeC7Q64u4Vdy
         loMSDxLbJdaCH3kS8Lg6kclirBsrZAX4m0tvmUXnpt7umn3ZMCYFAjVggfhE9mNAl6qF
         JZ7KSxWe8b9NfAkdWW+d3QPBKYEDGMzFWcIT16S9daRfGkUZmZOi9c2NlrOmvSWf3d9W
         CdSVh13QYU3HbOBy7L4pGPMPcigzPRP8gCXx7uox2m7lskbfdQMx+SUUhypiK4DMUkXJ
         C2jg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1736854177; x=1737458977;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=20Yjc/n2Ib6F5lS80pWb9OKE5xBeEql4XyvGsNk67XY=;
        b=MhAqoJ8jJZscoZVRWlT7IVhpH2iobfhmTjBFO6jj/WzKkso8m6eyo1Xr6+nX2IV7kc
         579gyoaxP0cFop4yL4EAy1Y9MW8b0NN1A69KaXNc/JAu9W+d2fYEVTHbTVue2BM/c6H0
         TyQQN+0SEkx9nzZ9bjX/wgMY58yHa+XiCDV/zJjMYGdE/OTHj5J3PuUrp2kvKqTDQjQs
         3OFrouJxXuXMUhKmZFAA+Ey7Jvf46IgX+I6B4+tHBOpWreXavvym4+e8Kta7nep11dCr
         hVfvilmlHC6abKPw2iLgvqIdGCEWOFPcfySggXH0NM6ovGDLPRlgauayZ9xYc6OYg5pd
         va0w==
X-Forwarded-Encrypted: i=1; AJvYcCX4wQvrlXhutz34ihLNIU5b3DSFHPJjkjZLLaxTB5ihxZtPL/kA294vT0EyTw4MyeDkPsXIb9JYV9gLww8=@vger.kernel.org
X-Gm-Message-State: AOJu0YzXb9U/ipZQUKoJbbEnIuoDX9H//44/RgvkpGrFnxx1lRBdA7xW
	3O8atyx4W+d9jC6XNHCoj3r2sg9JZG8CJkc3Eph9jflvs1Dm1+mhV2a6q1zA0wg=
X-Gm-Gg: ASbGnctMcG4Trq+Ycc4vCFkQEoiFQEYVBHRj1Oed0/ivuKII0zIyj6hHYM7bGVcYds1
	Ec2FdU7jIediHhoSE8yEqfp4sZsPh5FYCvCJUme+PmlYDX8WdplNEc/8nABgSNCnb08XVDuYTNq
	OGv04GoUj7uGJEQmEuKL5nrkakTW5GW8hzUSlJ8iPOVjBLtL77mPJ9qHt9mnHk07NwJYGQwGE8w
	StScimO933gvg9kAxoA7on+EHI9mldN/Ra9lMC2aIKEtGtsv/UP/ZQn
X-Google-Smtp-Source: AGHT+IF7o6knngh+kGBhBymoYYO++0k0fEzVPFzyBMQqlFUvEiupbcgJ6G8Oi1ILWV70iXAFlgrJbg==
X-Received: by 2002:a05:6000:4011:b0:386:3d27:b4f0 with SMTP id ffacd0b85a97d-38a8b0d324bmr17534737f8f.14.1736854177449;
        Tue, 14 Jan 2025 03:29:37 -0800 (PST)
Received: from localhost ([2a01:e0a:3c5:5fb1:317c:3d93:b7d4:96cd])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b8116sm14469928f8f.79.2025.01.14.03.29.36
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 14 Jan 2025 03:29:36 -0800 (PST)
From: Jerome Brunet <jbrunet@baylibre.com>
To: Jiebing Chen <jiebing.chen@amlogic.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
  Liam Girdwood <lgirdwood@gmail.com>,  Mark Brown <broonie@kernel.org>,
  Rob Herring <robh@kernel.org>,  Krzysztof Kozlowski <krzk+dt@kernel.org>,
  Conor Dooley <conor+dt@kernel.org>,  Jaroslav Kysela <perex@perex.cz>,
  Takashi Iwai <tiwai@suse.com>,  Neil Armstrong
 <neil.armstrong@linaro.org>,  Kevin Hilman <khilman@baylibre.com>,  Martin
 Blumenstingl <martin.blumenstingl@googlemail.com>,
  linux-sound@vger.kernel.org,  devicetree@vger.kernel.org,
  linux-kernel@vger.kernel.org,  linux-arm-kernel@lists.infradead.org,
  linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
In-Reply-To: <e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com> (Jiebing
	Chen's message of "Tue, 14 Jan 2025 16:16:39 +0800")
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
	<20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
	<1jwmey9451.fsf@starbuckisacylon.baylibre.com>
	<e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
User-Agent: mu4e 1.12.7; emacs 29.4
Date: Tue, 14 Jan 2025 12:29:36 +0100
Message-ID: <1jh6617hwf.fsf@starbuckisacylon.baylibre.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue 14 Jan 2025 at 16:16, Jiebing Chen <jiebing.chen@amlogic.com> wrote:

>>> +static const char * const s4_tdmout_sel_texts[] =3D {
>>> +     "TDM_D0", "TDM_D1", "TDM_D2", "TDM_D3", "TDM_D4", "TDM_D5", "TDM_=
D6", "TDM_D7",
>>> +     "TDM_D8", "TDM_D9", "TDM_D10", "TDM_D11", "TDM_D12", "TDM_D13", "=
TDM_D14", "TDM_D15",
>>> +     "TDM_D16", "TDM_D17", "TDM_D18", "TDM_D19", "TDM_D20", "TDM_D21",=
 "TDM_D22", "TDM_D23",
>>> +     "TDM_D24", "TDM_D25", "TDM_D26", "TDM_D27", "TDM_D28", "TDM_D29",=
 "TDM_D30", "TDM_D31"
>>> +};
>> This thing does not belong in ASoC. This is clearly yet another layer of
>> pinctrl. Please deal with it there.
>
> Thanks for your suggestion, add audio pinctrl driver to control the which=
 tdm_dx pin can map the which tdm lane_x
> for example
> 	tdm_d6_pin {
> 		mux {
> 			groups =3D "tdm_d6";
> 			function =3D "tdmoutb_lane0";
> 		};
> 	}
> tdm_d6 pin map the tdmoutb lane 0, right ?

possibly

>
>>> +
>>> +static const struct soc_enum tdmout_sel_enum =3D
>>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tdmout_sel_texts),
>>> +                     s4_tdmout_sel_texts);
>>> +

[...]

>>> diff --git a/sound/soc/meson/s4-tocodec-control.c b/sound/soc/meson/s4-=
tocodec-control.c
>>> new file mode 100644
>>> index 0000000000000000000000000000000000000000..e5d824fae0eba545d38dc36=
e2566e7cee590e7f5
>>> --- /dev/null
>>> +++ b/sound/soc/meson/s4-tocodec-control.c
>> There is already a to-acodec driver a not reason has been provided as to=
 why a
>> completly new driver is required.
>>
>> Please have look at the existing driver and do try to use it.
>> If you need to do things so differently, clear justification are necessa=
ry.
>
> for g12a-toacodec.c, we find the tocodec clock source can't get the=C2=A0=
clock
> id from the tdm Be device,

This is clearly documented limitation of the current to-acodec driver:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sou=
nd/soc/meson/g12a-toacodec.c?h=3Dv6.13-rc7#n91

While it is a limitation, it is a manageable one considering the amount
of master clocks available and the fact the master should be manually
assinged to the output pad, which you did not do.

See the u200:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arc=
h/arm64/boot/dts/amlogic/meson-g12a-u200.dts?h=3Dv6.13-rc7#n569

You are more than welcome to help fix this limitation in the current
driver but just adding a fork is not OK

I would suggest to start with what is currently available and move on to
fixing this as a 2nd step, if you want to.

>
> and set it by the kcontrol from user,=C2=A0 For different soc chips, The
> kcontrol value maybe different, The kcontrol configuration doesn't look
> very friendly for user
>
> so we use dapm route path to manage it,
> fe(fddr)->be(tdm)->(tocodec)->(codec),=C2=A0 and use the aux-devs to regi=
ster,=C2=A0
> and sound card only include the
>
> sound-dai =3D <&tdmif_a>
>
> codec-0 {
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 sound-dai =3D <&acodec>;
> =C2=A0};
>
> and not include
>
> codec-1 {
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 sound-dai =3D <&toacodec>;
> =C2=A0};
>
> when tdm work, only connect the tocodec path
>
> =C2=A0"TDM_A Playback" ->"TOACODEC TDMA"->"TOACODEC INPUT SRC"
>
> iterate it find the be device ,and get the struct axg_tdm_stream, so we c=
an
> get the tdm clock id
>
> Take into account behavioral differences, we add new tocodec driver
> for s4

Still not seeing sufficient reason to make another driver.

>
>>> @@ -0,0 +1,376 @@
>>> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
>>> +/*
>>> + * Copyright (C) 2023 Amlogic, Inc. All rights reserved
>>> + */
>>> +
>>> +#include <linux/module.h>
>>> +#include <linux/of_platform.h>
>>> +#include <linux/regmap.h>
>>> +#include <sound/soc.h>
>>> +#include <sound/soc-dai.h>
>>> +#include <linux/init.h>
>>> +#include <linux/kernel.h>
>>> +#include<linux/kstrtox.h>
>>> +#include <linux/clk-provider.h>
>>> +#include <linux/reset.h>
>>> +#include "axg-tdm.h"
>>> +
>>> +#define TOACODEC_CTRL0                       0x0
>>> +
>>> +#define CTRL0_ENABLE_SHIFT           31
>>> +#define CTRL0_BCLK_ENABLE_SHIFT              30
>>> +#define CTRL0_MCLK_ENABLE_SHIFT              29
>>> +#define CTRL0_BLK_CAP_INV_SHIFT              9
>>> +
>>> +#define TDM_IFACE 0
>>> +#define TDM_A_PAD 0
>>> +#define TDM_B_PAD 1
>>> +#define TDM_C_PAD 2
>>> +
>>> +struct toacodec {
>>> +     struct regmap_field *field_dat_sel;
>>> +     struct regmap_field *field_lrclk_sel;
>>> +     struct regmap_field *field_bclk_sel;
>>> +     struct regmap_field *field_mclk_sel;
>>> +};
>>> +
>>> +struct toacodec_match_data {
>>> +     const struct snd_soc_component_driver *component_drv;
>>> +     const struct reg_field field_dat_sel;
>>> +     const struct reg_field field_lrclk_sel;
>>> +     const struct reg_field field_bclk_sel;
>>> +     const struct reg_field field_mclk_sel;
>>> +};
>>> +
>>> +static const struct regmap_config tocodec_regmap_cfg =3D {
>>> +     .reg_bits       =3D 32,
>>> +     .val_bits       =3D 32,
>>> +     .reg_stride     =3D 4,
>>> +     .max_register   =3D 0x1,
>>> +};
>>> +
>>> +#define S4_LANE_OFFSET 8
>>> +
>>> +static const char * const s4_tocodec_lane_sel_texts[] =3D {
>>> +     "Lane0", "Lane1", "Lane2", "Lane3", "Lane4", "Lane5", "Lane6", "L=
ane7"
>>> +};
>>> +
>>> +static const struct soc_enum s4_tocodec_lane_sel_enum =3D
>>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_lane_sel_t=
exts),
>>> +                     s4_tocodec_lane_sel_texts);
>>> +
>>> +static const struct snd_kcontrol_new s4_tocodec_lane_sel =3D
>>> +     SOC_DAPM_ENUM("TOCODEC LANE SEL", s4_tocodec_lane_sel_enum);
>>> +
>>> +static const char * const s4_tocodec_src_sel_texts[] =3D {
>>> +     "TDMA", "TDMB", "TDMC"
>>> +};
>>> +
>>> +static const struct soc_enum s4_tocodec_src_sel_enum =3D
>>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_src_sel_te=
xts),
>>> +                     s4_tocodec_src_sel_texts);
>>> +
>>> +static const struct snd_kcontrol_new s4_tocodec_src_sel =3D
>>> +     SOC_DAPM_ENUM("TOCODEC SEL", s4_tocodec_src_sel_enum);
>>> +
>>> +static const struct snd_kcontrol_new s4_toacodec_out_enable =3D
>>> +     SOC_DAPM_SINGLE_AUTODISABLE("Switch", TOACODEC_CTRL0,
>>> +                                 CTRL0_ENABLE_SHIFT, 1, 0);
>>> +
>>> +static struct snd_soc_dai *tocodec_tdm_get_ahead_be(struct snd_soc_dap=
m_widget *w)
>>> +{
>>> +     struct snd_soc_dapm_path *p;
>>> +     struct snd_soc_dai *be;
>>> +
>>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>>> +             if (!p->connect)
>>> +                     continue;
>>> +             if (p->source->id =3D=3D snd_soc_dapm_dai_in)
>>> +                     return (struct snd_soc_dai *)p->source->priv;
>>> +             be =3D tocodec_tdm_get_ahead_be(p->source);
>>> +             if (be && be->id =3D=3D TDM_IFACE)
>>> +                     return be;
>>> +     }
>>> +     return NULL;
>>> +}
>>> +
>>> +static unsigned int aml_simple_strtoull(const char *cp)
>>> +{
>>> +     unsigned int result =3D 0;
>>> +     unsigned int value =3D 0;
>>> +     unsigned int len =3D strlen(cp);
>>> +
>>> +     while (len !=3D 0) {
>>> +             len--;
>>> +             value =3D isdigit(*cp);
>>> +             if (value) {
>>> +                     value =3D *cp - '0';
>>> +             } else {
>>> +                     cp++;
>>> +                     continue;
>>> +             }
>>> +             cp++;
>>> +             result =3D result * 10 + value;
>>> +     }
>>> +     return result;
>>> +}
>>> +
>>> +static int aml_get_clk_id(const char *name)
>>> +{
>>> +     int clk_id =3D 0;
>>> +
>>> +     if (strstr(name, "mst_a"))
>>> +             clk_id =3D 0;
>>> +     else if (strstr(name, "mst_b"))
>>> +             clk_id =3D 1;
>>> +     else if (strstr(name, "mst_c"))
>>> +             clk_id =3D 2;
>>> +     else if (strstr(name, "mst_d"))
>>> +             clk_id =3D 3;
>>> +     else if (strstr(name, "mst_e"))
>>> +             clk_id =3D 4;
>>> +     else if (strstr(name, "mst_f"))
>>> +             clk_id =3D 5;
>>> +
>>> +     return clk_id;
>>> +}
>>> +
>>> +static int aml_tocodec_sel_set(struct snd_soc_dapm_widget *w)
>>> +{
>>> +     struct snd_soc_dai *be;
>>> +     struct axg_tdm_stream *stream;
>>> +     struct axg_tdm_iface *iface;
>>> +     struct snd_soc_component *component =3D snd_soc_dapm_to_component=
(w->dapm);
>>> +     struct toacodec *priv =3D snd_soc_component_get_drvdata(component=
);
>>> +     unsigned int tdm_id =3D TDM_A_PAD;
>>> +     const char *dai_widget_name;
>>> +     struct snd_soc_dapm_path *p;
>>> +     unsigned int lane =3D 0;
>>> +     unsigned int val =3D 0;
>>> +     struct clk *sclk, *mclk;
>>> +     char *clk_name;
>>> +     int mclk_id, sclk_id;
>>> +
>>> +     be =3D tocodec_tdm_get_ahead_be(w);
>>> +     if (!be) {
>>> +             dev_err(component->dev, "%s not find the be\n", __func__);
>>> +             return -EINVAL;
>>> +     }
>>> +     stream =3D snd_soc_dai_dma_data_get_playback(be);
>>> +     if (!stream) {
>>> +             dev_err(component->dev, "%s not find the stream\n", __fun=
c__);
>>> +             return -EINVAL;
>>> +     }
>>> +     /*we like to use dai id, but it is fixed val*/
>>> +     dai_widget_name =3D be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget-=
>name;
>>> +     if (strstr(dai_widget_name, "TDM_A"))
>>> +             tdm_id =3D TDM_A_PAD;
>>> +     else if (strstr(dai_widget_name, "TDM_B"))
>>> +             tdm_id =3D TDM_B_PAD;
>>> +     else if (strstr(dai_widget_name, "TDM_C"))
>>> +             tdm_id =3D TDM_C_PAD;
>>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>>> +             if (p->connect && p->name) {
>>> +                     lane =3D aml_simple_strtoull(p->name);
>>> +                     val =3D lane + tdm_id * S4_LANE_OFFSET;
>>> +                     regmap_field_write(priv->field_dat_sel, val);
>>> +             }
>>> +     }
>>> +     iface =3D stream->iface;
>>> +     mclk =3D iface->mclk;
>>> +     sclk =3D iface->sclk;
>>> +     mclk_id =3D aml_get_clk_id(__clk_get_name(mclk));
>>> +     sclk_id =3D aml_get_clk_id(__clk_get_name(sclk));
>>> +     regmap_field_write(priv->field_mclk_sel, mclk_id);
>>> +     regmap_field_write(priv->field_bclk_sel, sclk_id);
>>> +     regmap_field_write(priv->field_lrclk_sel, sclk_id);
>>> +
>>> +     return 0;
>>> +}
>>> +
>>> +static int tocodec_sel_event(struct snd_soc_dapm_widget *w,
>>> +                          struct snd_kcontrol *control,
>>> +                          int event)
>>> +{
>>> +     struct snd_soc_component *component =3D snd_soc_dapm_to_component=
(w->dapm);
>>> +     int ret =3D 0;
>>> +
>>> +     switch (event) {
>>> +     case SND_SOC_DAPM_PRE_PMU:
>>> +             ret =3D aml_tocodec_sel_set(w);
>>> +             break;
>>> +
>>> +     case SND_SOC_DAPM_PRE_PMD:
>>> +             break;
>>> +
>>> +     default:
>>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>>> +             return -EINVAL;
>>> +     }
>>> +
>>> +     return ret;
>>> +}
>>> +
>>> +static int tocodec_clk_enable(struct snd_soc_dapm_widget *w,
>>> +                           struct snd_kcontrol *control,
>>> +                           int event)
>>> +{
>>> +     int ret =3D 0;
>>> +     unsigned int mask =3D 0, val =3D 0;
>>> +     struct snd_soc_component *component =3D snd_soc_dapm_to_component=
(w->dapm);
>>> +
>>> +     snd_soc_component_update_bits(component, TOACODEC_CTRL0,
>>> +                                   1 << CTRL0_BLK_CAP_INV_SHIFT, 1 << =
CTRL0_BLK_CAP_INV_SHIFT);
>>> +     switch (event) {
>>> +     case SND_SOC_DAPM_PRE_PMU:
>>> +             mask =3D 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_E=
NABLE_SHIFT;
>>> +             val =3D 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_EN=
ABLE_SHIFT;
>>> +             snd_soc_component_update_bits(component, TOACODEC_CTRL0, =
mask, val);
>>> +             break;
>>> +     case SND_SOC_DAPM_PRE_PMD:
>>> +             mask =3D 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_E=
NABLE_SHIFT;
>>> +             val =3D 0 << CTRL0_MCLK_ENABLE_SHIFT | 0 << CTRL0_BCLK_EN=
ABLE_SHIFT;
>>> +             snd_soc_component_update_bits(component, TOACODEC_CTRL0, =
mask, val);
>>> +             break;
>>> +     default:
>>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>>> +             return -EINVAL;
>>> +     }
>>> +
>>> +     return ret;
>>> +}
>>> +
>>> +static const struct snd_soc_dapm_widget s4_toacodec_widgets[] =3D {
>>> +     SND_SOC_DAPM_MUX_E("Lane SRC", SND_SOC_NOPM, 0, 0,
>>> +                        &s4_tocodec_lane_sel, tocodec_sel_event,
>>> +                        (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
>>> +     SND_SOC_DAPM_MUX("INPUT SRC", SND_SOC_NOPM, 0, 0, &s4_tocodec_src=
_sel),
>>> +     SND_SOC_DAPM_SWITCH_E("OUT EN", SND_SOC_NOPM, 0, 0,
>>> +                           &s4_toacodec_out_enable, tocodec_clk_enable,
>>> +                             (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_=
PMD)),
>>> +     SND_SOC_DAPM_AIF_IN("TDMA", NULL, 0, SND_SOC_NOPM, 0, 0),
>>> +     SND_SOC_DAPM_AIF_IN("TDMB", NULL, 0, SND_SOC_NOPM, 0, 0),
>>> +     SND_SOC_DAPM_AIF_IN("TDMC", NULL, 0, SND_SOC_NOPM, 0, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane0", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane1", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane2", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane3", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane4", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane5", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane6", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUT_DRV("Lane7", SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +     SND_SOC_DAPM_OUTPUT("TDM_TO_ACODEC"),
>>> +};
>>> +
>>> +static const struct snd_soc_dapm_route s4_tocodec_dapm_routes[] =3D {
>>> +     { "INPUT SRC", "TDMA", "TDMA"},
>>> +     { "INPUT SRC", "TDMB", "TDMB"},
>>> +     { "INPUT SRC", "TDMC", "TDMC"},
>>> +     { "Lane0", NULL, "INPUT SRC" },
>>> +     { "Lane1", NULL, "INPUT SRC"},
>>> +     { "Lane2", NULL, "INPUT SRC"},
>>> +     { "Lane3", NULL, "INPUT SRC"},
>>> +     { "Lane4", NULL, "INPUT SRC"},
>>> +     { "Lane5", NULL, "INPUT SRC"},
>>> +     { "Lane6", NULL, "INPUT SRC"},
>>> +     { "Lane7", NULL, "INPUT SRC"},
>>> +     { "Lane SRC", "Lane0", "Lane0"},
>>> +     { "Lane SRC", "Lane1", "Lane1"},
>>> +     { "Lane SRC", "Lane2", "Lane2"},
>>> +     { "Lane SRC", "Lane3", "Lane3"},
>>> +     { "Lane SRC", "Lane4", "Lane4"},
>>> +     { "Lane SRC", "Lane5", "Lane5"},
>>> +     { "Lane SRC", "Lane6", "Lane6"},
>>> +     { "Lane SRC", "Lane7", "Lane7"},
>>> +     { "OUT EN", "Switch", "Lane SRC"},
>>> +     { "TDM_TO_ACODEC", NULL, "OUT EN"},
>>> +
>>> +};
>>> +
>>> +static const struct snd_soc_component_driver s4_tocodec_component_drv =
=3D {
>>> +     .dapm_widgets           =3D s4_toacodec_widgets,
>>> +     .num_dapm_widgets       =3D ARRAY_SIZE(s4_toacodec_widgets),
>>> +     .dapm_routes            =3D s4_tocodec_dapm_routes,
>>> +     .num_dapm_routes        =3D ARRAY_SIZE(s4_tocodec_dapm_routes),
>>> +};
>>> +
>>> +static const struct toacodec_match_data s4_toacodec_match_data =3D {
>>> +     .component_drv  =3D &s4_tocodec_component_drv,
>>> +     .field_dat_sel  =3D REG_FIELD(TOACODEC_CTRL0, 16, 20),
>>> +     .field_lrclk_sel =3D REG_FIELD(TOACODEC_CTRL0, 12, 14),
>>> +     .field_bclk_sel =3D REG_FIELD(TOACODEC_CTRL0, 4, 6),
>>> +     .field_mclk_sel =3D REG_FIELD(TOACODEC_CTRL0, 0, 2),
>>> +};
>>> +
>>> +static const struct of_device_id s4_tocodec_of_match[] =3D {
>>> +     {
>>> +             .compatible =3D "amlogic,s4-tocodec",
>>> +             .data =3D &s4_toacodec_match_data,
>>> +     }, {}
>>> +};
>>> +
>>> +MODULE_DEVICE_TABLE(of, s4_tocodec_of_match);
>>> +
>>> +static int tocodec_probe(struct platform_device *pdev)
>>> +{
>>> +     const struct toacodec_match_data *data;
>>> +     struct device *dev =3D &pdev->dev;
>>> +     struct toacodec *priv;
>>> +     void __iomem *regs;
>>> +     struct regmap *map;
>>> +     int ret;
>>> +
>>> +     data =3D device_get_match_data(dev);
>>> +     if (!data)
>>> +             return dev_err_probe(dev, -ENODEV, "failed to match devic=
e\n");
>>> +     priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>>> +     if (!priv)
>>> +             return -ENOMEM;
>>> +
>>> +     platform_set_drvdata(pdev, priv);
>>> +
>>> +     ret =3D device_reset(dev);
>>> +     if (ret)
>>> +             return ret;
>>> +
>>> +     regs =3D devm_platform_ioremap_resource(pdev, 0);
>>> +     if (IS_ERR(regs))
>>> +             return PTR_ERR(regs);
>>> +
>>> +     map =3D devm_regmap_init_mmio(dev, regs, &tocodec_regmap_cfg);
>>> +     if (IS_ERR(map))
>>> +             return dev_err_probe(dev, PTR_ERR(map), "failed to init r=
egmap\n");
>>> +
>>> +     priv->field_dat_sel =3D devm_regmap_field_alloc(dev, map, data->f=
ield_dat_sel);
>>> +     if (IS_ERR(priv->field_dat_sel))
>>> +             return PTR_ERR(priv->field_dat_sel);
>>> +
>>> +     priv->field_lrclk_sel =3D devm_regmap_field_alloc(dev, map, data-=
>field_lrclk_sel);
>>> +     if (IS_ERR(priv->field_lrclk_sel))
>>> +             return PTR_ERR(priv->field_lrclk_sel);
>>> +
>>> +     priv->field_bclk_sel =3D devm_regmap_field_alloc(dev, map, data->=
field_bclk_sel);
>>> +     if (IS_ERR(priv->field_bclk_sel))
>>> +             return PTR_ERR(priv->field_bclk_sel);
>>> +
>>> +     priv->field_mclk_sel =3D devm_regmap_field_alloc(dev, map, data->=
field_mclk_sel);
>>> +     if (IS_ERR(priv->field_mclk_sel))
>>> +             return PTR_ERR(priv->field_mclk_sel);
>>> +
>>> +     return devm_snd_soc_register_component(dev,
>>> +                     data->component_drv, NULL, 0);
>>> +}
>>> +
>>> +static struct platform_driver tocodec_pdrv =3D {
>>> +     .probe =3D tocodec_probe,
>>> +     .driver =3D {
>>> +             .name =3D "s4-tocodec",
>>> +             .of_match_table =3D s4_tocodec_of_match,
>>> +     },
>>> +};
>>> +
>>> +module_platform_driver(tocodec_pdrv);
>>> +
>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>> +MODULE_LICENSE("GPL");
>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>> index 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d728=
2054e03d953586648 100644
>>> --- a/sound/soc/meson/t9015.c
>>> +++ b/sound/soc/meson/t9015.c
>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai =3D {
>>>                .channels_min =3D 1,
>>>                .channels_max =3D 2,
>>>                .rates =3D SNDRV_PCM_RATE_8000_96000,
>>> -             .formats =3D (SNDRV_PCM_FMTBIT_S8 |
>>> -                         SNDRV_PCM_FMTBIT_S16_LE |
>>> -                         SNDRV_PCM_FMTBIT_S20_LE |
>>> -                         SNDRV_PCM_FMTBIT_S24_LE),
>>> +             .formats =3D (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_=
S32_LE),
>> Again, mixed up changes with zero justification.
>>
>> This drops S8 and S16 format support for the existing SoCs (such as GXL)
>> which is known to work and add S32 support on an HW documented as 24bits
>> only. Can you explain ?
>>
>>>        },
>>>        .ops =3D &t9015_dai_ops,
>>>   };
>> --
>> Jerome

--=20
Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2135.outbound.protection.outlook.com [40.107.255.135])
	(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 03CBC1E2309;
	Tue, 14 Jan 2025 12:34:09 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.135
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736858053; cv=fail; b=KY0vgShI5GmXb+dnjuUZ4ozZw40k10ktglg6IFSjo5ofqTwQt8NAV4yY/li7emdW0UlxfhXAX3ztZUJcbdcYP2g5XXqL26nHRhRbKawazyoyaP1QYZ4L+zoQgQPI9bI64EDj+xwlRbFxD1SqTz8umQi9tSnLDw1TKFqYCt0LwDs=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736858053; c=relaxed/simple;
	bh=41nAKTtp3Q8F4Bk7NefzcKFa4MwR54y+SMeTRVg+nOw=;
	h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=f46JtDrsYKP/rAO9rVBTwiamDVpmNciOMwpBcBly7kaPbekltFko9OJkxaYZH303LGLoZ3uMyJn98Dw9/GwU7Rum0F66SHofSq1VOJ+qs98oV6GFiwGCK6r0Y4xyi+AnemuJBstXXIG2ybqyX3y1fiGk6IPtzvsQTQhaO55rkXo=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=lZfxJiXX; arc=fail smtp.client-ip=40.107.255.135
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="lZfxJiXX"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=RTVM89lzbklTL1w34FXejvn7PXA+ZIAVhbZsiy2wyh2Vw/Wl5yYOOQdoross4hUIod/fs1Ea4a3RmDNPFub2F963BWEd+6049ZVIH3OGsDuxhPcpLYVWjAnXCVuRwIbIp35jp1B0vW0jcKOe1yLRqB4z77a8fDusglNP+XaDxQpY4MJ/ufQtSgcwSRCnzNGf5m5h8nGy8+d/FFfFj7rQy99cuWuxs2+lnFoLOv2DOW9qP33jxJjxTHrZ/VZlO1f1gw9Mc7hmWKjZaiUL+AryBe5rHjc6S8IeJ5aRjtBLDDlX3Ex6FdjdBu3+7twtPI1EFGMrVdMq4/vOB39/rkukag==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=G0UnBuu5tbLzKBjfvj9Rw9+wboJ9D8xHA/PnFgFTkgo=;
 b=TyDEO9mvMViz1xXhiMvysEqiZXKyJKUBnxGn2fq5wQXH1ZO0p78jfolrQ59qlnEYsuJQ9qAYaygDXoahU80djRtgZfJo8aa3UXVYNTjxLZ/oGRnkFWBVbDEOqTAgY7pz7/puqhO4psAnpSGyHQHKXO5uERHN7ln+AzxC9sn/zPLxPEOG3R9qMSWm/WV/sFYpDGfojvzrVfUU1QjvWjjYoN1bN1cJfhUjXFDMoNdTSQSRhk9mMcBXE+IFNvwbmphFq0Y3xC0VbSnrHwRkJf/2XwObyx8X9lwn4SM4zYGgDnYjjpRXLPrZ0XdWQsWRQwwa6eYKuMBOz+BSemvbyLnvhg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G0UnBuu5tbLzKBjfvj9Rw9+wboJ9D8xHA/PnFgFTkgo=;
 b=lZfxJiXXXPKaj3/3obl/3I4EpPvIYoz057rLG0yHopMbbcDk5SKiPgs2dzX7Skq3mevKUpaeWfNgSFLBGWcws//K+DUULhoky2blVzKfoJSQOa+PtY6fn8UIYTqiEdeYQ+sAcHH/+7oBjaZthpsVdgn65Wk1NDZ7sXTSVXuNJdj+fbYrySk0SJ+q+NMhRu0RfAN8xymUhIFVJqN8yDYnDtWRroFBl+essto5UdhuCQ0qp10bj9Eawt2MNkhZu9Kj5Zz9aAy7Od7bXPb2jtwDdZmn9KcI90i8F6RBD9mRtEmAOWiTXwNTeIQRfRX5Ga74rwxC33O5eOmpLLTkYOBT4A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by TYZPR03MB7518.apcprd03.prod.outlook.com (2603:1096:400:419::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Tue, 14 Jan
 2025 12:34:05 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8335.017; Tue, 14 Jan 2025
 12:34:05 +0000
Message-ID: <0e8b78c1-5c56-40e7-a2d8-41a7f49d52bc@amlogic.com>
Date: Tue, 14 Jan 2025 20:34:01 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
 <1jldve939f.fsf@starbuckisacylon.baylibre.com>
 <813e2564-8c4c-4adb-8184-ab88156e3e4c@amlogic.com>
 <1jmsft7ihz.fsf@starbuckisacylon.baylibre.com>
From: Jiebing Chen <jiebing.chen@amlogic.com>
In-Reply-To: <1jmsft7ihz.fsf@starbuckisacylon.baylibre.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: SG2PR01CA0192.apcprd01.prod.exchangelabs.com
 (2603:1096:4:189::21) To PUZPR03MB7135.apcprd03.prod.outlook.com
 (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|TYZPR03MB7518:EE_
X-MS-Office365-Filtering-Correlation-Id: b21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M3bGY5Y3Vya1ZSQ3F0dVhw?=
 =?utf-8?B?cGorR0dWZE16Z2VrOWZFeWYrR2JkbnBuYTNFZkVtTUFLY0F2VUc4Q3JURHZC?=
 =?utf-8?B?dExwUjJ6OFY3ZVFPRFJ5aEpxK3gzS1I2YVJVN05Lem0rSjkvWUh6ZWxodElD?=
 =?utf-8?B?eU1ZOEJWOUdsQVB5TnBoaytqSyszWmdlT2lFdkdHYko1d3hjeVhLU3JaS21J?=
 =?utf-8?B?ZkZaUmlnUURQejA5SjFMQVMxblY5ZmFpZjhIR3dvSDJ3M2xqV2hhZjFHT21a?=
 =?utf-8?Q?3bGzLssRf2L+F?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR03MB7135.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Q2p6ZlRLYTJML1JmYVJEamRaNTh3K29hM1UyYWJBWjJQclZNc2xMaHdqdWU1?=
 =?utf-8?B?Ti9qQ1RnSHo3YjdxRDJ4cmZ1SWg2UlB3U0FuemRlWENHU2RVdDBCNGhvVkc0?=
 =?utf-8?B?V2RuVlJlOC9RWEgwdlJ5QTNhVVg4emk3dkc4ditkWVNNeEZ4bUhrc2VpSXF6?=
 =?utf-8?B?KzZPY1RXbmZIV3JadndaalZSNFFRaldFcDh1dGdwTTZTbUw3YmQ2bEwvVUdC?=
 =?utf-8?B?VHk5T0NPK0ZsbnMrUVd2VnlZZTZOblVkR01ZMlRUM0RrVlZrNDMvUXU5U2Rv?=
 =?utf-8?B?aEhQNmRsQ3lDcEV0T3FIbFZSVFlpL2RTVzhaZlVxSG5wSVA1Y29CQ0YxK0E5?=
 =?utf-8?B?akhOaUFtK2QzS3lTbWxhZXdMT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B?UTR0NzRpWHhDcjhvbFQ5UTdDVm0wYUh0dDdzY0ZidjJ1MU5URGlUOGp6b1VL?=
 =?utf-8?B?VkE9PQ==?=
X-OriginatorOrg: amlogic.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b21f9f4a-a0e0-48aa-12d4-08dd3497bbbb
X-MS-Exchange-CrossTenant-AuthSource: PUZPR03MB7135.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 12:34:05.3082
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: bDLRqT1JjmDGuGwgVXNAm87SLYoz5AI9aBOzPc9HFcaUp0RPFGRjbdojAGucJY082jmbE7fKvXnc14U+EQYexhB649Fllzae2UWsabzDERg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR03MB7518


在 2025/1/14 19:16, Jerome Brunet 写道:
> [ EXTERNAL EMAIL ]
>
> On Tue 14 Jan 2025 at 16:52, Jiebing Chen <jiebing.chen@amlogic.com> wrote:
>
>> 在 2025/1/13 22:50, Jerome Brunet 写道:
>>> [ EXTERNAL EMAIL ]
>>>
>>> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:
>>>
>>>> From: jiebing chen <jiebing.chen@amlogic.com>
>>>>
>>>> Add basic audio driver support for the Amlogic S4 based Amlogic
>>>> AQ222 board.
>>>>
>>>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>>>> ---
>>>>    .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts     | 226 ++++++++++++
>>>>    arch/arm64/boot/dts/amlogic/meson-s4.dtsi          | 385 ++++++++++++++++++++-
>>>>    2 files changed, 610 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>> index 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c5528b43422b705b20130 100644
>>>> --- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>> @@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
>>>>                regulator-always-on;
>>>>         };
>>>>
>>>> +     vcc5v_reg: regulator-vcc-5v {
>>>> +             compatible = "regulator-fixed";
>>>> +             vin-supply = <&main_12v>;
>>>> +             regulator-name = "VCC5V";
>>>> +             regulator-min-microvolt = <5000000>;
>>>> +             regulator-max-microvolt = <5000000>;
>>>> +             gpio = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
>>>> +             startup-delay-us = <7000>;
>>>> +             enable-active-high;
>>>> +             regulator-boot-on;
>>>> +             regulator-always-on;
>>>> +     };
>>>> +
>>>>         /* SY8120B1ABC DC/DC Regulator. */
>>>>         vddcpu: regulator-vddcpu {
>>>>                 compatible = "pwm-regulator";
>>>> @@ -129,6 +142,219 @@ vddcpu: regulator-vddcpu {
>>>>                                 <699000 98>,
>>>>                                 <689000 100>;
>>>>         };
>>>> +     dmics: audio-codec-1 {
>>>> +             compatible = "dmic-codec";
>>>> +             #sound-dai-cells = <0>;
>>>> +             num-channels = <2>;
>>>> +             wakeup-delay-ms = <50>;
>>>> +             sound-name-prefix = "MIC";
>>>> +     };
>>>> +
>>>> +     dioo2133: audio-amplifier-0 {
>>>> +             compatible = "simple-audio-amplifier";
>>>> +             enable-gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
>>>> +             VCC-supply = <&vcc5v_reg>;
>>>> +             #sound-dai-cells = <0>;
>>>> +             sound-name-prefix = "10U2";
>>>> +     };
>>>> +
>>>> +     spdif_dir: audio-spdif-in {
>>>> +             compatible = "linux,spdif-dir";
>>>> +             #sound-dai-cells = <0>;
>>>> +             sound-name-prefix = "DIR";
>>>> +     };
>>>> +
>>>> +     spdif_dit: audio-spdif-out {
>>>> +             compatible = "linux,spdif-dit";
>>>> +             #sound-dai-cells = <0>;
>>>> +             sound-name-prefix = "DIT";
>>>> +     };
>>>> +
>>>> +     sound {
>>>> +             compatible = "amlogic,axg-sound-card";
>>>> +             model = "aq222";
>>>> +             audio-widgets = "Line", "Lineout";
>>>> +             audio-aux-devs = <&tdmout_a>, <&tdmout_b>, <&tdmout_c>,
>>>> +                              <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
>>>> +                              <&tdmin_lb>, <&dioo2133>, <&tdmout_pad>, <&toacodec>;
>>>> +             audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
>>>> +                             "TDMOUT_A IN 1", "FRDDR_B OUT 0",
>>>> +                             "TDMOUT_A IN 2", "FRDDR_C OUT 0",
>>>> +                             "TDM_A Playback", "TDMOUT_A OUT",
>>>> +                             "TDMA_OUT SEL",   "TDM_A Playback",
>>>> +                             "TDMOUT_B IN 0", "FRDDR_A OUT 1",
>>>> +                             "TDMOUT_B IN 1", "FRDDR_B OUT 1",
>>>> +                             "TDMOUT_B IN 2", "FRDDR_C OUT 1",
>>>> +                             "TDM_B Playback", "TDMOUT_B OUT",
>>>> +                             "TDMB_OUT SEL",   "TDM_B Playback",
>>>> +                             "TDMOUT_C IN 0", "FRDDR_A OUT 2",
>>>> +                             "TDMOUT_C IN 1", "FRDDR_B OUT 2",
>>>> +                             "TDMOUT_C IN 2", "FRDDR_C OUT 2",
>>>> +                             "TDM_C Playback", "TDMOUT_C OUT",
>>>> +                             "TDMC_OUT SEL",   "TDM_C Playback",
>>>> +                             "TOACODEC TDMA", "TDM_A Playback",
>>>> +                             "TOACODEC TDMB", "TDM_B Playback",
>>>> +                             "TOACODEC TDMC", "TDM_C Playback",
>>>> +                             "SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
>>>> +                             "SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
>>>> +                             "SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
>>>> +                             "SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
>>>> +                             "SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
>>>> +                             "SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
>>>> +                             "TDMIN_A IN 0", "TDM_A Capture",
>>>> +                             "TDMIN_A IN 1", "TDM_B Capture",
>>>> +                             "TDMIN_A IN 2", "TDM_C Capture",
>>>> +                             "TDMIN_A IN 3", "TDM_A Loopback",
>>>> +                             "TDMIN_A IN 4", "TDM_B Loopback",
>>>> +                             "TDMIN_A IN 5", "TDM_C Loopback",
>>>> +                             "TDMIN_B IN 0", "TDM_A Capture",
>>>> +                             "TDMIN_B IN 1", "TDM_B Capture",
>>>> +                             "TDMIN_B IN 2", "TDM_C Capture",
>>>> +                             "TDMIN_B IN 3", "TDM_A Loopback",
>>>> +                             "TDMIN_B IN 4", "TDM_B Loopback",
>>>> +                             "TDMIN_B IN 5", "TDM_C Loopback",
>>>> +                             "TDMIN_C IN 0", "TDM_A Capture",
>>>> +                             "TDMIN_C IN 1", "TDM_B Capture",
>>>> +                             "TDMIN_C IN 2", "TDM_C Capture",
>>>> +                             "TDMIN_C IN 3", "TDM_A Loopback",
>>>> +                             "TDMIN_C IN 4", "TDM_B Loopback",
>>>> +                             "TDMIN_C IN 5", "TDM_C Loopback",
>>>> +                             "TDMIN_LB IN 3", "TDM_A Capture",
>>>> +                             "TDMIN_LB IN 4", "TDM_B Capture",
>>>> +                             "TDMIN_LB IN 5", "TDM_C Capture",
>>>> +                             "TDMIN_LB IN 0", "TDM_A Loopback",
>>>> +                             "TDMIN_LB IN 1", "TDM_B Loopback",
>>>> +                             "TDMIN_LB IN 2", "TDM_C Loopback",
>>>> +                             "TODDR_A IN 0", "TDMIN_A OUT",
>>>> +                             "TODDR_B IN 0", "TDMIN_A OUT",
>>>> +                             "TODDR_C IN 0", "TDMIN_A OUT",
>>>> +                             "TODDR_A IN 1", "TDMIN_B OUT",
>>>> +                             "TODDR_B IN 1", "TDMIN_B OUT",
>>>> +                             "TODDR_C IN 1", "TDMIN_B OUT",
>>>> +                             "TODDR_A IN 2", "TDMIN_C OUT",
>>>> +                             "TODDR_B IN 2", "TDMIN_C OUT",
>>>> +                             "TODDR_C IN 2", "TDMIN_C OUT",
>>>> +                             "TODDR_A IN 3", "SPDIFIN Capture",
>>>> +                             "TODDR_B IN 3", "SPDIFIN Capture",
>>>> +                             "TODDR_C IN 3", "SPDIFIN Capture",
>>>> +                             "TODDR_A IN 6", "TDMIN_LB OUT",
>>>> +                             "TODDR_B IN 6", "TDMIN_LB OUT",
>>>> +                             "TODDR_C IN 6", "TDMIN_LB OUT",
>>>> +                             "10U2 INL", "ACODEC LOLP",
>>>> +                             "10U2 INR", "ACODEC LORP",
>>>> +                             "Lineout", "10U2 OUTL",
>>>> +                             "Lineout", "10U2 OUTR";
>>>> +             assigned-clocks = <&clkc_pll CLKID_HIFI_PLL>,
>>>> +                               <&clkc_pll CLKID_MPLL2>,
>>>> +                               <&clkc_pll CLKID_MPLL0>,
>>>> +                               <&clkc_pll CLKID_MPLL1>;
>>>> +             assigned-clock-rates = <491520000>,
>>>> +                                    <294912000>,
>>>> +                                    <270950400>,
>>>> +                                    <393216000>;
>>> Why do you need 4 base rates ? Which rate family does each provide ?
>> hifipll 49152000, mpll2 294912000 mpll0 270950400, mpll1 393216000, the
>> accuracy of hifipll
>>
>> is relatively high, for tdm/pdm/spdif 16/48/96/192k we can use it. if the
>> tdm and spdif work on
> It is fine to use the HiFi. I'm glad this clock finally got fixed
>
>> the same time, for example ,tdm 48k. spdif 44.1k, we can't use the same
>> pll, so spdif need use the mpll 0
>>
>> other pll , only set a default value, at the latest chip, we remove all
>> mpll for hardware, only two hifipll
> I'm not sure you understand how this works.
> There is 3 families of audio rate: 48kHz, 44.1kHz and 32kHz
>
> Each family needs a PLL assigned, so you need 3, not 4, unless there is
> another specific rate family you want to support. If that's the case,
> document it.
>
> Setting the rate of the PLL should follow this principle:
> * Family rate
>    - multiplied by (32 x 24): to accomodate different sample sizes
>    - multiplied by 2 until you reach the maximum rate of selected PLLs
>      This allows to support rates such 192k or even 768k
>
> 491520000 is not dividable by 3, it won't allow 24 bits words. It is a
> poor choice.
>
> Have a look at the s400 for an example using the HiFi PLL. The axg was
> restricted to a 68 PLL multiplier but the S4 is not so you should be
> able to use a higher base rate (4 718 592 000 Hz), providing better
> accuracy in the end

for new soc audio ip, the hardware will not support the 24bit(include 
g12a, sm1,axg)

SNDRV_PCM_FMTBIT_S24_3LE, 24 bit in memory

>>>> +
>>>> +             dai-link-0 {
>>>> +                     sound-dai = <&frddr_a>;
>>>> +             };
>>>> +
>>>> +             dai-link-1 {
>>>> +                     sound-dai = <&frddr_b>;
>>>> +             };
>>>> +
>>>> +             dai-link-2 {
>>>> +                     sound-dai = <&frddr_c>;
>>>> +             };
>>>> +
>>>> +             dai-link-3 {
>>>> +                     sound-dai = <&toddr_a>;
>>>> +             };
>>>> +
>>>> +             dai-link-4 {
>>>> +                     sound-dai = <&toddr_b>;
>>>> +             };
>>>> +
>>>> +             dai-link-5 {
>>>> +                     sound-dai = <&toddr_c>;
>>>> +             };
>>>> +
>>>> +             /* Connected to the WIFI/BT chip */
>>>> +             dai-link-6 {
>>>> +                     sound-dai = <&tdmif_a>;
>>>> +                     dai-format = "dsp_a";
>>>> +                     dai-tdm-slot-tx-mask-0 = <1 1>;
>>>> +                     mclk-fs = <256>;
>>>> +                     codec-0 {
>>>> +                             sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
>>>> +                     };
>>>> +             };
>>>> +
>>>> +             /* Connected to the onboard AD82584F DAC */
>>>> +             dai-link-7 {
>>>> +                     sound-dai = <&tdmif_b>;
>>>> +                     dai-format = "i2s";
>>>> +                     dai-tdm-slot-tx-mask-0 = <1 1>;
>>>> +                     mclk-fs = <256>;
>>>> +
>>>> +                     codec-0 {
>>>> +                             sound-dai = <&acodec>;
>>>> +                     };
>>>> +
>>>> +                     codec-1 {
>>>> +                             sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
>>>> +                     };
>>>> +             };
>>>> +
>>>> +             /* 8ch HDMI interface */
>>>> +             dai-link-8 {
>>>> +                     sound-dai = <&tdmif_c>;
>>>> +                     dai-format = "i2s";
>>>> +                     dai-tdm-slot-tx-mask-0 = <1 1>;
>>>> +                     dai-tdm-slot-tx-mask-1 = <1 1>;
>>>> +                     dai-tdm-slot-tx-mask-2 = <1 1>;
>>>> +                     dai-tdm-slot-tx-mask-3 = <1 1>;
>>>> +                     mclk-fs = <256>;
>>>> +
>>>> +                     codec-0 {
>>>> +                             sound-dai = <&acodec>;
>>>> +                     };
>>>> +
>>>> +                     codec-1 {
>>>> +                             sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
>>>> +                     };
>>>> +             };
>>>> +
>>>> +             /* spdif hdmi and coax output */
>>>> +             dai-link-9 {
>>>> +                     sound-dai = <&spdifout_a>;
>>>> +
>>>> +                     codec-0 {
>>>> +                             sound-dai = <&spdif_dit>;
>>>> +                     };
>>>> +
>>>> +                     codec-1 {
>>>> +                             sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>;
>>>> +                     };
>>>> +             };
>>>> +
>>>> +             /* spdif hdmi interface */
>>>> +             dai-link-10 {
>>>> +                     sound-dai = <&spdifout_b>;
>>>> +
>>>> +                     codec {
>>>> +                             sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>;
>>>> +                     };
>>>> +             };
>>>> +
>>>> +             /* spdif coax input */
>>>> +             dai-link-11 {
>>>> +                     sound-dai = <&spdifin>;
>>>> +
>>>> +                     codec {
>>>> +                             sound-dai = <&spdif_dir>;
>>>> +                     };
>>>> +             };
>>>> +     };
>>>> +
>>>>    };
>>>>
>>>>    &pwm_ef {
>>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>>>> index 957577d986c0675a503115e1ccbc4387c2051620..87a00ace23131e31822bb43fbe956b8abcbaef40 100644
>>>> --- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>>>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
>>>> @@ -11,7 +11,11 @@
>>>>    #include <dt-bindings/clock/amlogic,s4-peripherals-clkc.h>
>>>>    #include <dt-bindings/power/meson-s4-power.h>
>>>>    #include <dt-bindings/reset/amlogic,meson-s4-reset.h>
>>>> -
>>>> +#include <dt-bindings/clock/axg-audio-clkc.h>
>>>> +#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
>>>> +#include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>
>>>> +#include <dt-bindings/sound/meson-g12a-toacodec.h>
>>>> +#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
>>>>    / {
>>>>         cpus {
>>>>                 #address-cells = <2>;
>>>> @@ -46,6 +50,42 @@ cpu3: cpu@3 {
>>>>                 };
>>>>         };
>>>>
>>>> +     tdmif_a: audio-controller-0 {
>>>> +             compatible = "amlogic,axg-tdm-iface";
>>>> +             #sound-dai-cells = <0>;
>>>> +             sound-name-prefix = "TDM_A";
>>>> +             clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
>>>> +                      <&clkc_audio AUD_CLKID_MST_A_SCLK>,
>>>> +                      <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
>>>> +             clock-names = "mclk", "sclk", "lrclk";
>>>> +             assigned-clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK_SEL>;
>>>> +             assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
>>> Based on clock provider used, I doubt this is of any use.
>> if not set the mclk parent. we dump clk_summary, the default parent is mpll
>> 0
>>
>> we tend  to use hifipll
> Have you really tested this ? Master clocks do reparent to the appropriate PLL
> depending on the rate required, this is how it has always worked.

you are right, when boot up kernel, it is default, but when aplay

it auto switch the hifipll, it is a good skill, thanks

>>>> +     };
>>>> +
>>>> +     tdmif_b: audio-controller-1 {
>>>> +             compatible = "amlogic,axg-tdm-iface";
>>>> +             #sound-dai-cells = <0>;
>>>> +             sound-name-prefix = "TDM_B";
>>>> +             clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
>>>> +                      <&clkc_audio AUD_CLKID_MST_B_SCLK>,
>>>> +                      <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
>>>> +             clock-names = "mclk", "sclk", "lrclk";
>>>> +             assigned-clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK_SEL>;
>>>> +             assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
>>>> +     };
>>>> +
>>>> +     tdmif_c: audio-controller-2 {
>>>> +             compatible = "amlogic,axg-tdm-iface";
>>>> +             #sound-dai-cells = <0>;
>>>> +             sound-name-prefix = "TDM_C";
>>>> +             clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK>,
>>>> +                      <&clkc_audio AUD_CLKID_MST_C_SCLK>,
>>>> +                      <&clkc_audio AUD_CLKID_MST_C_LRCLK>;
>>>> +             clock-names = "mclk", "sclk", "lrclk";
>>>> +             assigned-clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK_SEL>;
>>>> +             assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>;
>>>> +     };
>>>> +
>>>>         timer {
>>>>                 compatible = "arm,armv8-timer";
>>>>                 interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
>>>> @@ -850,3 +890,346 @@ emmc: mmc@fe08c000 {
>>>>                 };
>>>>         };
>>>>    };
>>>> +
>>>> +&apb4 {
>>>> +     audio: bus@330000 {
>>>> +             compatible = "simple-bus";
>>>> +             reg = <0x0 0x330000 0x0 0x1000>;
>>>> +             #address-cells = <2>;
>>>> +             #size-cells = <2>;
>>>> +             ranges = <0x0 0x0 0x0 0x330000 0x0 0x1000>;
>>>> +
>>>> +             clkc_audio: clock-controller@0 {
>>>> +                     compatible = "amlogic,sm1-audio-clkc";
>>> I suspect the DT folks would like having SoC specific compatible in
>>> addition to the fall back. In that case, I think that would be wise. I
>>> doubt the compatibility will hold in the long run.
>>>
>>> Same goes for the other HW components.
>> you are right, for s4 , some clock is different, we will add the
>> "amlogic,s4-audio-clkc"
>>
>> this is a base clk for tdm
>>
>>>> +                     reg = <0x0 0x0 0x0 0xb4>;
>>>> +                     #clock-cells = <1>;
>>>> +                     #reset-cells = <1>;
>>>> +                     power-domains = <&pwrc PWRC_S4_AUDIO_ID>;
>>>> +                     clocks = <&clkc_periphs CLKID_AUDIO>,
>>>> +                              <&clkc_pll CLKID_MPLL0>,
>>>> +                              <&clkc_pll CLKID_MPLL1>,
>>>> +                              <&clkc_pll CLKID_MPLL2>,
>>>> +                              <&clkc_pll CLKID_MPLL3>,
>>>> +                              <&clkc_pll CLKID_HIFI_PLL>,
>>>> +                              <&clkc_pll CLKID_FCLK_DIV3>,
>>>> +                              <&clkc_pll CLKID_FCLK_DIV4>,
>>>> +                              <&clkc_pll CLKID_FCLK_DIV5>;
>>>> +                     clock-names = "pclk",
>>>> +                                   "mst_in0",
>>>> +                                   "mst_in1",
>>>> +                                   "mst_in2",
>>>> +                                   "mst_in3",
>>>> +                                   "mst_in4",
>>>> +                                   "mst_in5",
>>>> +                                   "mst_in6",
>>>> +                                   "mst_in7";
>>>> +
>>>> +                     resets = <&reset RESET_AUDIO>;
>>>> +             };
>>>> +
>>>> +             toddr_a: audio-controller@100 {
>>>> +                     compatible = "amlogic,sm1-toddr",
>>>> +                                  "amlogic,axg-toddr";
>>>> +                     reg = <0x0 0x100 0x0 0x2c>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "TODDR_A";
>>>> +                     interrupts = <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TODDR_A>;
>>>> +                     resets = <&arb AXG_ARB_TODDR_A>,
>>>> +                              <&clkc_audio AUD_RESET_TODDR_A>;
>>>> +                     reset-names = "arb", "rst";
>>>> +                     amlogic,fifo-depth = <8192>;
>>>> +             };
>>>> +
>>>> +             toddr_b: audio-controller@140 {
>>>> +                     compatible = "amlogic,sm1-toddr",
>>>> +                                  "amlogic,axg-toddr";
>>>> +                     reg = <0x0 0x140 0x0 0x2c>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "TODDR_B";
>>>> +                     interrupts = <GIC_SPI 33 IRQ_TYPE_EDGE_RISING>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TODDR_B>;
>>>> +                     resets = <&arb AXG_ARB_TODDR_B>,
>>>> +                              <&clkc_audio AUD_RESET_TODDR_B>;
>>>> +                     reset-names = "arb", "rst";
>>>> +                     amlogic,fifo-depth = <256>;
>>>> +             };
>>>> +
>>>> +             toddr_c: audio-controller@180 {
>>>> +                     compatible = "amlogic,sm1-toddr",
>>>> +                                  "amlogic,axg-toddr";
>>>> +                     reg = <0x0 0x180 0x0 0x2c>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "TODDR_C";
>>>> +                     interrupts = <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TODDR_C>;
>>>> +                     resets = <&arb AXG_ARB_TODDR_C>,
>>>> +                              <&clkc_audio AUD_RESET_TODDR_C>;
>>>> +                     reset-names = "arb", "rst";
>>>> +                     amlogic,fifo-depth = <256>;
>>>> +             };
>>>> +
>>>> +             frddr_a: audio-controller@1c0 {
>>>> +                     compatible = "amlogic,sm1-frddr",
>>>> +                                  "amlogic,axg-frddr";
>>>> +                     reg = <0x0 0x1c0 0x0 0x2c>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "FRDDR_A";
>>>> +                     interrupts = <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
>>>> +                     resets = <&arb AXG_ARB_FRDDR_A>,
>>>> +                              <&clkc_audio AUD_RESET_FRDDR_A>;
>>>> +                     reset-names = "arb", "rst";
>>>> +                     amlogic,fifo-depth = <512>;
>>>> +             };
>>>> +
>>>> +             frddr_b: audio-controller@200 {
>>>> +                     compatible = "amlogic,sm1-frddr",
>>>> +                                  "amlogic,axg-frddr";
>>>> +                     reg = <0x0 0x200 0x0 0x2c>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "FRDDR_B";
>>>> +                     interrupts = <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_FRDDR_B>;
>>>> +                     resets = <&arb AXG_ARB_FRDDR_B>,
>>>> +                              <&clkc_audio AUD_RESET_FRDDR_B>;
>>>> +                     reset-names = "arb", "rst";
>>>> +                     amlogic,fifo-depth = <256>;
>>>> +             };
>>>> +
>>>> +             frddr_c: audio-controller@240 {
>>>> +                     compatible = "amlogic,sm1-frddr",
>>>> +                                  "amlogic,axg-frddr";
>>>> +                     reg = <0x0 0x240 0x0 0x2c>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "FRDDR_C";
>>>> +                     interrupts = <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_FRDDR_C>;
>>>> +                     resets = <&arb AXG_ARB_FRDDR_C>,
>>>> +                              <&clkc_audio AUD_RESET_FRDDR_C>;
>>>> +                     reset-names = "arb", "rst";
>>>> +                     amlogic,fifo-depth = <256>;
>>>> +             };
>>>> +
>>>> +             arb: reset-controller@280 {
>>>> +                     compatible = "amlogic,meson-sm1-audio-arb";
>>>> +                     reg = <0x0 0x280 0x0 0x4>;
>>>> +                     #reset-cells = <1>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_DDR_ARB>;
>>>> +             };
>>>> +
>>>> +             tdmin_a: audio-controller@300 {
>>>> +                     compatible = "amlogic,sm1-tdmin",
>>>> +                                  "amlogic,axg-tdmin";
>>>> +                     reg = <0x0 0x300 0x0 0x40>;
>>>> +                     sound-name-prefix = "TDMIN_A";
>>>> +                     resets = <&clkc_audio AUD_RESET_TDMIN_A>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TDMIN_A>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_SCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_SCLK_SEL>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>;
>>>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>>>> +                                   "lrclk", "lrclk_sel";
>>>> +             };
>>>> +
>>>> +             tdmin_b: audio-controller@340 {
>>>> +                     compatible = "amlogic,sm1-tdmin",
>>>> +                                  "amlogic,axg-tdmin";
>>>> +                     reg = <0x0 0x340 0x0 0x40>;
>>>> +                     sound-name-prefix = "TDMIN_B";
>>>> +                     resets = <&clkc_audio AUD_RESET_TDMIN_B>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TDMIN_B>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_SCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_SCLK_SEL>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>;
>>>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>>>> +                                   "lrclk", "lrclk_sel";
>>>> +             };
>>>> +
>>>> +             tdmin_c: audio-controller@380 {
>>>> +                     compatible = "amlogic,sm1-tdmin",
>>>> +                                  "amlogic,axg-tdmin";
>>>> +                     reg = <0x0 0x380 0x0 0x40>;
>>>> +                     sound-name-prefix = "TDMIN_C";
>>>> +                     resets = <&clkc_audio AUD_RESET_TDMIN_C>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TDMIN_C>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_SCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_SCLK_SEL>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>;
>>>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>>>> +                                   "lrclk", "lrclk_sel";
>>>> +             };
>>>> +
>>>> +             tdmin_lb: audio-controller@3c0 {
>>>> +                     compatible = "amlogic,sm1-tdmin",
>>>> +                                  "amlogic,axg-tdmin";
>>>> +                     reg = <0x0 0x3c0 0x0 0x40>;
>>>> +                     sound-name-prefix = "TDMIN_LB";
>>>> +                     resets = <&clkc_audio AUD_RESET_TDMIN_LB>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TDMIN_LB>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK_SEL>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>;
>>>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>>>> +                                   "lrclk", "lrclk_sel";
>>>> +             };
>>>> +
>>>> +             spdifin: audio-controller@400 {
>>>> +                     compatible = "amlogic,g12a-spdifin",
>>>> +                                  "amlogic,axg-spdifin";
>>>> +                     reg = <0x0 0x400 0x0 0x30>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "SPDIFIN";
>>>> +                     interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
>>>> +                     <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
>>>> +                     clock-names = "pclk", "refclk";
>>>> +                     resets = <&clkc_audio AUD_RESET_SPDIFIN>;
>>>> +             };
>>>> +
>>>> +             spdifout_a: audio-controller@480 {
>>>> +                     compatible = "amlogic,g12a-spdifout",
>>>> +                                  "amlogic,axg-spdifout";
>>>> +                     reg = <0x0 0x480 0x0 0x50>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "SPDIFOUT_A";
>>>> +                     clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
>>>> +                     <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
>>>> +                     clock-names = "pclk", "mclk";
>>>> +                     resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
>>>> +             };
>>>> +
>>>> +             tdmout_a: audio-controller@500 {
>>>> +                     compatible = "amlogic,sm1-tdmout";
>>>> +                     reg = <0x0 0x500 0x0 0x40>;
>>>> +                     sound-name-prefix = "TDMOUT_A";
>>>> +                     resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
>>>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>>>> +                                   "lrclk", "lrclk_sel";
>>>> +             };
>>>> +
>>>> +             tdmout_b: audio-controller@540 {
>>>> +                     compatible = "amlogic,sm1-tdmout";
>>>> +                     reg = <0x0 0x540 0x0 0x40>;
>>>> +                     sound-name-prefix = "TDMOUT_B";
>>>> +                     resets = <&clkc_audio AUD_RESET_TDMOUT_B>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TDMOUT_B>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK_SEL>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>;
>>>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>>>> +                                   "lrclk", "lrclk_sel";
>>>> +             };
>>>> +
>>>> +             tdmout_c: audio-controller@580 {
>>>> +                     compatible = "amlogic,sm1-tdmout";
>>>> +                     reg = <0x0 0x580 0x0 0x40>;
>>>> +                     sound-name-prefix = "TDMOUT_C";
>>>> +                     resets = <&clkc_audio AUD_RESET_TDMOUT_C>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TDMOUT_C>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK_SEL>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>,
>>>> +                              <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>;
>>>> +                     clock-names = "pclk", "sclk", "sclk_sel",
>>>> +                                   "lrclk", "lrclk_sel";
>>>> +             };
>>>> +
>>>> +             spdifout_b: audio-controller@680 {
>>>> +                     compatible = "amlogic,g12a-spdifout",
>>>> +                                  "amlogic,axg-spdifout";
>>>> +                     reg = <0x0 0x680 0x0 0x50>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "SPDIFOUT_B";
>>>> +                     clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
>>>> +                              <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
>>>> +                     clock-names = "pclk", "mclk";
>>>> +                     resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
>>>> +             };
>>>> +
>>>> +             toacodec: audio-controller@740 {
>>>> +                     compatible = "amlogic,s4-tocodec";
>>>> +                     reg = <0x0 0x740 0x0 0x4>;
>>>> +                     sound-name-prefix = "TOACODEC";
>>>> +                     resets = <&clkc_audio AUD_RESET_TOACODEC>;
>>>> +             };
>>>> +
>>>> +             tohdmitx: audio-controller@744 {
>>>> +                     compatible = "amlogic,sm1-tohdmitx",
>>>> +                                  "amlogic,g12a-tohdmitx";
>>>> +                     reg = <0x0 0x744 0x0 0x4>;
>>>> +                     #sound-dai-cells = <1>;
>>>> +                     sound-name-prefix = "TOHDMITX";
>>>> +                     resets = <&clkc_audio AUD_RESET_TOHDMITX>;
>>>> +             };
>>>> +
>>>> +             toddr_d: audio-controller@840 {
>>>> +                     compatible = "amlogic,sm1-toddr",
>>>> +                                  "amlogic,axg-toddr";
>>>> +                     reg = <0x0 0x840 0x0 0x2c>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "TODDR_D";
>>>> +                     interrupts = <GIC_SPI 45 IRQ_TYPE_EDGE_RISING>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_TODDR_D>;
>>>> +                     resets = <&arb AXG_ARB_TODDR_D>,
>>>> +                              <&clkc_audio AUD_RESET_TODDR_D>;
>>>> +                     reset-names = "arb", "rst";
>>>> +                     amlogic,fifo-depth = <256>;
>>>> +             };
>>>> +
>>>> +             frddr_d: audio-controller@880 {
>>>> +                      compatible = "amlogic,sm1-frddr",
>>>> +                                   "amlogic,axg-frddr";
>>>> +                     reg = <0x0 0x880 0x0 0x2c>;
>>>> +                     #sound-dai-cells = <0>;
>>>> +                     sound-name-prefix = "FRDDR_D";
>>>> +                     interrupts = <GIC_SPI 46 IRQ_TYPE_EDGE_RISING>;
>>>> +                     clocks = <&clkc_audio AUD_CLKID_FRDDR_D>;
>>>> +                     resets = <&arb AXG_ARB_FRDDR_D>,
>>>> +                              <&clkc_audio AUD_RESET_FRDDR_D>;
>>>> +                     reset-names = "arb", "rst";
>>>> +                     amlogic,fifo-depth = <256>;
>>>> +             };
>>>> +
>>>> +             tdmout_pad: audio-controller@E58 {
>>>> +                     compatible = "amlogic,s4-tdmout-pad";
>>>> +                     reg = <0x0 0xe58 0x0 0x28>;
>>>> +             };
>>>> +     };
>>>> +
>>>> +     pdm: audio-controller@331000 {
>>>> +             compatible = "amlogic,sm1-pdm",
>>>> +                          "amlogic,axg-pdm";
>>>> +             reg = <0x0 0x331000 0x0 0x34>;
>>>> +             #sound-dai-cells = <0>;
>>>> +             sound-name-prefix = "PDM";
>>>> +             clocks = <&clkc_audio AUD_CLKID_PDM>,
>>>> +                      <&clkc_audio AUD_CLKID_PDM_DCLK>,
>>>> +                      <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
>>>> +             clock-names = "pclk", "dclk", "sysclk";
>>>> +             resets = <&clkc_audio AUD_RESET_PDM>;
>>>> +             assigned-clocks = <&clkc_audio AUD_CLKID_PDM_DCLK_SEL>,
>>>> +                               <&clkc_audio AUD_CLKID_PDM_SYSCLK_SEL>;
>>>> +             assigned-clock-parents = <&clkc_pll CLKID_HIFI_PLL>,<&clkc_pll CLKID_HIFI_PLL>;
>>>> +     };
>>>> +      acodec: audio-controller@1A000 {
>>>> +             compatible = "amlogic,t9015";
>>>> +             reg = <0x0 0x1A000 0x0 0x14>;
>>>> +             #sound-dai-cells = <0>;
>>>> +             sound-name-prefix = "ACODEC";
>>>> +             clocks = <&clkc_periphs CLKID_ACODEC>;
>>>> +             clock-names = "pclk";
>>>> +             resets = <&reset RESET_ACODEC>;
>>>> +     };
>>>> +
>>>> +};
>>> --
>>> Jerome
> --
> Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11020137.outbound.protection.outlook.com [52.101.128.137])
	(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 9CE7B236A8B;
	Tue, 14 Jan 2025 12:41:53 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.137
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736858516; cv=fail; b=bbNlQHmPsgqsci0pDXjstsKf6H1qrW4DJG3+ms7iDn9Xo3wJx672n7iXA5yNAovhQeBIJoc9J0FVPWhK1uWQDkmUlnpa2ycKeXBZnNqmBattu4NJbKOXTOZiZojD+Z+cuuFF8z68mvhIA5AT1bcCq3P9imXDjok9BdqiaTD56GI=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736858516; c=relaxed/simple;
	bh=ss9ZMGlUHLtOyMlPSefAbzigVrapWtqeIUuNUDjPz1E=;
	h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=A1GMMwvW668gL4i/QEWlyuEdmJDfblGPm3oOmBWdNXCqUoBjMfw0ZJI9MfZUAzZ0oGdSdY8jaJR2jcpHd1zUgi842TqDfONaKzWNx977PQYvUNLz3L0uME60rfdHlOdqT4sBzglhwGrSi7mBom9oqpEDKkBmUCNySwHcon4rRxc=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=nKab9X28; arc=fail smtp.client-ip=52.101.128.137
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="nKab9X28"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=nKREVpWlMmubI/LSzBx9QkPeW3UViRRUNpYO843C2Q8ya2heKGdG2nVG4Yi78aHoCLUDyI+fv69hFesZQqy1bKtDGVp6MneHnp/SNKodEsH/z68Unz6oi2Mgax9mW4/qCFKZkdUYYHfSSshXZVY9k6ZMcd1zJFKR38LGdK1k2KGsTiwXVMsbyjM6KYQhw42swYS9KTknjk/kliLO6qIKgT1LCGB4HItYhuXCZ0Yv+sDTih1lXz0Gu6ol77sOAv10QPfIh/ufPcA/PnotZn3L7nkWsQnITm3dqf7B1dJtob2/8IO6N1jaB2jF3RB6sAFl73GeGlul26uJxSBIpboN4g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=e6M+Aq3iD1iSZwtU7ci0QHqNGElyK7JiLBPkduGAzfw=;
 b=OTZISEWn6mPK0i5VNN621JLcrcPSHxiqKVk3NEJZXEOZ9RUV3WUAvnY7G8H4FIXkM/eGvHkM1ace1z7ZOZMVREL6ya2PkTx5SMedQ+agQMqjVLVCu/hhofnvG5AZzknn85CYSzV0ovUmJFnbgVo8ukIEHvx8xPj0KSYku+55f1hE//vLUoH24J6B5Dc9y8d8nCqVgC9TlCcL4ZhFKOEa9LiLjGwa2rn19Zaul9kn3ek9ZZrV9nBsxrnUcnEgz2c0iKXmL0BP8NRtRYmN+64Huh6ROjPJlUBNAj+2i8T1EVAyN4NZASXzgwMGQLC6WwDf6DXMRr2CFQuzghj3hHKm9w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=e6M+Aq3iD1iSZwtU7ci0QHqNGElyK7JiLBPkduGAzfw=;
 b=nKab9X285hh3e87prpOmniOL2n4dSuhSVgo+L/RE6Qe6PrFS5Gzb54GjRaZvm008axmvDwaUsbDSrqOCRDT2VC+u0H6HbcdnBPRi4rSoeYAvmi+EGH4q7U2Mj8G482aza0kzhM8IqNbNvEqroYwXADGcaMpEzF6zfQicioRlUCkUWpSi/zu9TJVxgmBHJvuWzQxmwJSmR6KxS31u6mSvJrEofG1TKeMVuWz5IHEeKjYS9mDtXnN1EIxSWa/1o7GtkWpnE0Pym5KPmzG/80vXOXR9XcOTDRzAnQe5UPQgAMzKq5O5auYPgC9DW0mfMmiRhs8KmB/ogTDZj89b0Sk9kQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by SI6PR03MB8707.apcprd03.prod.outlook.com (2603:1096:4:253::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Tue, 14 Jan
 2025 12:41:50 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8335.017; Tue, 14 Jan 2025
 12:41:50 +0000
Message-ID: <31ce586b-a7d9-4f69-8ca4-4f98cfbeee1d@amlogic.com>
Date: Tue, 14 Jan 2025 20:41:35 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
 <1jwmey9451.fsf@starbuckisacylon.baylibre.com>
 <e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
 <1jh6617hwf.fsf@starbuckisacylon.baylibre.com>
From: Jiebing Chen <jiebing.chen@amlogic.com>
In-Reply-To: <1jh6617hwf.fsf@starbuckisacylon.baylibre.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: SG2PR01CA0182.apcprd01.prod.exchangelabs.com
 (2603:1096:4:189::20) To PUZPR03MB7135.apcprd03.prod.outlook.com
 (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|SI6PR03MB8707:EE_
X-MS-Office365-Filtering-Correlation-Id: e5b4172e-79ec-4530-1837-08dd3498d128
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|7416014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?dWQ2OTM3LzNmU0xPUHNHZ0VRTUhDMlQxUXhWRkNqNzhlbTlLWTZXM3NBYnJN?=
 =?utf-8?B?MWZpN3dkbDhyN1BLWHlKQ28rZERncXFYZ3dCS3FTN1grOXp6VWtObC91bUV3?=
 =?utf-8?B?M3BNbkRSN0FDZXBiQm9PTUJueDR6NWYwOEs3SV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PR03MB7135.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(7416014);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OUltU2hGZjVqa2dTcEtaVEFiRHNXVUdlNTRYbkRxV1hKRmkzV1J6d0RrRHhY?=
 =?utf-8?B?R00vK2pNcmFpTFVYbVJCZGNHa2RXR2Zodi9ERVJIQUY1NUNZSE5tbWRoSHFC?=
 =?utf-8?B?Z1g0cGh0YU12Qk1pWlpaUFA3VlZob3BoY2lwamI1V0lCNnZoNjdHQUV6Q3BZ?=
 =?utf-8?B?Vyt1WUdkNGxXU1RLbWtvMlFxK1ZrbkkrSERrblZQTXo0VXpBMUVCNkV2VEFN?=
 =?utf-8?B?TmYzTEVBbk9VKzdqeXhNVEc3cXc1bjlTbHkxSllMVVIrNEtwT1k0TVhGSDBv?=
 =?utf-8?B?YkhOdjdpcW9ycmpoTzB2dzRpc3VoMDBPQVhCbWcyZkVIa2xZUHUvcWVnbC9C?=
 =?utf-8?B?QkRoVFplM211QzdZc1BKWDBHdTdFbG8xMEd3TWRnUVArNkd5MG9KZHhOQkVj?=
 =?utf-8?B?bVZha1dHU3VZM0JBSFhrWVlkdzhjUU51ZWdjd3hVWXBXWE1ocEQvdEJmMnl0?=
 =?utf-8?B?K295MXMzSFltazdhYi94K29WOEJVc1dMR0N6ZWthMk53elM3N3hEUFpZK2RE?=
 =?utf-8?B?R0k4aE1tMlFVTnUvWG83d29oNEN4K3doamw5RnMySWhvb1NEd2NrSmg3ZGNo?=
 =?utf-8?B?dk5MYTkvb29NcHJhdkI3UDZSL2k2bDJPOEVaZEtUNEc2WVlJYnRqb0k0SjE1?=
 =?utf-8?B?emhaNTBVbUk2Y0xwdmlKVlZ3UXVEZHltWGNESHZxVHpiK05Rbnp5RldiWmw1?=
 =?utf-8?B?c0hSY2t2ZjYwbzMwcDZGby9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MwNVZ0R2pG?=
 =?utf-8?B?Y3FKMGV2TTRGbVNHeEw1azNxRWYyME8xaTFQaXpaYkc5MExJWUpqNVhXMjlF?=
 =?utf-8?B?VDVIVEd6aW9qRTB1VWgydzFLbzNscGM1SHRaMlJqWHJFMzgvbG1FOHVQR25R?=
 =?utf-8?B?M0xmSVBOUklHRlJtRjZYbVlZajdsaXBwTFY2ZHZRWE9JRFh5NUtkTUpkdi9S?=
 =?utf-8?B?d1g2aTZ6cm92NDBCd2JMOG5GV3hqdllta21taHNiclRta2N2RDBZZUJRMWZk?=
 =?utf-8?B?OHk1dW1USVZNRDdmL0VSQkpKV1RIcFBjM3Y0RitHbmdqYklpc1hFTkE2WlFG?=
 =?utf-8?B?ZVVFVHJuR3lCRXVhaitqUmFvSlpnZVJuaUxnZm54N1pUVHArbnZZanpEQWxu?=
 =?utf-8?B?azc1YmpzOEtkbklsMTN1TTRreS9mLzFqZ1VtYzIwZVgwS3dyUFpuQVN0NFhJ?=
 =?utf-8?B?aG5Gd3hHd01sZ3ZNdXRqZVdLdzY3SVFZMGg2K1Y5QkNuMTMzTmlCTUtDOVRZ?=
 =?utf-8?B?bmJNOCt3MWY1SVNhMDkwTG5HSTNGODdXWU5uV0RaK21vQm9Vbk5MVXJXdVNJ?=
 =?utf-8?B?cEE9PQ==?=
X-OriginatorOrg: amlogic.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e5b4172e-79ec-4530-1837-08dd3498d128
X-MS-Exchange-CrossTenant-AuthSource: PUZPR03MB7135.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 12:41:50.7004
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: rC64f7SNku7Jc+RSqW9tHVxcA29FdSHtQbktpihh0CVJ2EYHJfAF/YPoXnu3hy5KOj5JaWSENirF2n5MexFoB2ie80hVHPqZV1ASOp24eEk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI6PR03MB8707


在 2025/1/14 19:29, Jerome Brunet 写道:
> [ EXTERNAL EMAIL ]
>
> On Tue 14 Jan 2025 at 16:16, Jiebing Chen <jiebing.chen@amlogic.com> wrote:
>
>>>> +static const char * const s4_tdmout_sel_texts[] = {
>>>> +     "TDM_D0", "TDM_D1", "TDM_D2", "TDM_D3", "TDM_D4", "TDM_D5", "TDM_D6", "TDM_D7",
>>>> +     "TDM_D8", "TDM_D9", "TDM_D10", "TDM_D11", "TDM_D12", "TDM_D13", "TDM_D14", "TDM_D15",
>>>> +     "TDM_D16", "TDM_D17", "TDM_D18", "TDM_D19", "TDM_D20", "TDM_D21", "TDM_D22", "TDM_D23",
>>>> +     "TDM_D24", "TDM_D25", "TDM_D26", "TDM_D27", "TDM_D28", "TDM_D29", "TDM_D30", "TDM_D31"
>>>> +};
>>> This thing does not belong in ASoC. This is clearly yet another layer of
>>> pinctrl. Please deal with it there.
>> Thanks for your suggestion, add audio pinctrl driver to control the which tdm_dx pin can map the which tdm lane_x
>> for example
>>        tdm_d6_pin {
>>                mux {
>>                        groups = "tdm_d6";
>>                        function = "tdmoutb_lane0";
>>                };
>>        }
>> tdm_d6 pin map the tdmoutb lane 0, right ?
> possibly
>
>>>> +
>>>> +static const struct soc_enum tdmout_sel_enum =
>>>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tdmout_sel_texts),
>>>> +                     s4_tdmout_sel_texts);
>>>> +
> [...]
>
>>>> diff --git a/sound/soc/meson/s4-tocodec-control.c b/sound/soc/meson/s4-tocodec-control.c
>>>> new file mode 100644
>>>> index 0000000000000000000000000000000000000000..e5d824fae0eba545d38dc36e2566e7cee590e7f5
>>>> --- /dev/null
>>>> +++ b/sound/soc/meson/s4-tocodec-control.c
>>> There is already a to-acodec driver a not reason has been provided as to why a
>>> completly new driver is required.
>>>
>>> Please have look at the existing driver and do try to use it.
>>> If you need to do things so differently, clear justification are necessary.
>> for g12a-toacodec.c, we find the tocodec clock source can't get the clock
>> id from the tdm Be device,
> This is clearly documented limitation of the current to-acodec driver:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/meson/g12a-toacodec.c?h=v6.13-rc7#n91
>
> While it is a limitation, it is a manageable one considering the amount
> of master clocks available and the fact the master should be manually
> assinged to the output pad, which you did not do.
>
> See the u200:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts?h=v6.13-rc7#n569
>
> You are more than welcome to help fix this limitation in the current
> driver but just adding a fork is not OK
>
> I would suggest to start with what is currently available and move on to
> fixing this as a 2nd step, if you want to.
>
>> and set it by the kcontrol from user,  For different soc chips, The
>> kcontrol value maybe different, The kcontrol configuration doesn't look
>> very friendly for user
>>
>> so we use dapm route path to manage it,
>> fe(fddr)->be(tdm)->(tocodec)->(codec),  and use the aux-devs to register,
>> and sound card only include the
>>
>> sound-dai = <&tdmif_a>
>>
>> codec-0 {
>>                  sound-dai = <&acodec>;
>>   };
>>
>> and not include
>>
>> codec-1 {
>>                  sound-dai = <&toacodec>;
>>   };
>>
>> when tdm work, only connect the tocodec path
>>
>>   "TDM_A Playback" ->"TOACODEC TDMA"->"TOACODEC INPUT SRC"
>>
>> iterate it find the be device ,and get the struct axg_tdm_stream, so we can
>> get the tdm clock id
>>
>> Take into account behavioral differences, we add new tocodec driver
>> for s4
> Still not seeing sufficient reason to make another driver.
it is a good idea, i will add the change for s4 base on g12a-toacodec.c
>
>>>> @@ -0,0 +1,376 @@
>>>> +// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
>>>> +/*
>>>> + * Copyright (C) 2023 Amlogic, Inc. All rights reserved
>>>> + */
>>>> +
>>>> +#include <linux/module.h>
>>>> +#include <linux/of_platform.h>
>>>> +#include <linux/regmap.h>
>>>> +#include <sound/soc.h>
>>>> +#include <sound/soc-dai.h>
>>>> +#include <linux/init.h>
>>>> +#include <linux/kernel.h>
>>>> +#include<linux/kstrtox.h>
>>>> +#include <linux/clk-provider.h>
>>>> +#include <linux/reset.h>
>>>> +#include "axg-tdm.h"
>>>> +
>>>> +#define TOACODEC_CTRL0                       0x0
>>>> +
>>>> +#define CTRL0_ENABLE_SHIFT           31
>>>> +#define CTRL0_BCLK_ENABLE_SHIFT              30
>>>> +#define CTRL0_MCLK_ENABLE_SHIFT              29
>>>> +#define CTRL0_BLK_CAP_INV_SHIFT              9
>>>> +
>>>> +#define TDM_IFACE 0
>>>> +#define TDM_A_PAD 0
>>>> +#define TDM_B_PAD 1
>>>> +#define TDM_C_PAD 2
>>>> +
>>>> +struct toacodec {
>>>> +     struct regmap_field *field_dat_sel;
>>>> +     struct regmap_field *field_lrclk_sel;
>>>> +     struct regmap_field *field_bclk_sel;
>>>> +     struct regmap_field *field_mclk_sel;
>>>> +};
>>>> +
>>>> +struct toacodec_match_data {
>>>> +     const struct snd_soc_component_driver *component_drv;
>>>> +     const struct reg_field field_dat_sel;
>>>> +     const struct reg_field field_lrclk_sel;
>>>> +     const struct reg_field field_bclk_sel;
>>>> +     const struct reg_field field_mclk_sel;
>>>> +};
>>>> +
>>>> +static const struct regmap_config tocodec_regmap_cfg = {
>>>> +     .reg_bits       = 32,
>>>> +     .val_bits       = 32,
>>>> +     .reg_stride     = 4,
>>>> +     .max_register   = 0x1,
>>>> +};
>>>> +
>>>> +#define S4_LANE_OFFSET 8
>>>> +
>>>> +static const char * const s4_tocodec_lane_sel_texts[] = {
>>>> +     "Lane0", "Lane1", "Lane2", "Lane3", "Lane4", "Lane5", "Lane6", "Lane7"
>>>> +};
>>>> +
>>>> +static const struct soc_enum s4_tocodec_lane_sel_enum =
>>>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_lane_sel_texts),
>>>> +                     s4_tocodec_lane_sel_texts);
>>>> +
>>>> +static const struct snd_kcontrol_new s4_tocodec_lane_sel =
>>>> +     SOC_DAPM_ENUM("TOCODEC LANE SEL", s4_tocodec_lane_sel_enum);
>>>> +
>>>> +static const char * const s4_tocodec_src_sel_texts[] = {
>>>> +     "TDMA", "TDMB", "TDMC"
>>>> +};
>>>> +
>>>> +static const struct soc_enum s4_tocodec_src_sel_enum =
>>>> +     SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(s4_tocodec_src_sel_texts),
>>>> +                     s4_tocodec_src_sel_texts);
>>>> +
>>>> +static const struct snd_kcontrol_new s4_tocodec_src_sel =
>>>> +     SOC_DAPM_ENUM("TOCODEC SEL", s4_tocodec_src_sel_enum);
>>>> +
>>>> +static const struct snd_kcontrol_new s4_toacodec_out_enable =
>>>> +     SOC_DAPM_SINGLE_AUTODISABLE("Switch", TOACODEC_CTRL0,
>>>> +                                 CTRL0_ENABLE_SHIFT, 1, 0);
>>>> +
>>>> +static struct snd_soc_dai *tocodec_tdm_get_ahead_be(struct snd_soc_dapm_widget *w)
>>>> +{
>>>> +     struct snd_soc_dapm_path *p;
>>>> +     struct snd_soc_dai *be;
>>>> +
>>>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>>>> +             if (!p->connect)
>>>> +                     continue;
>>>> +             if (p->source->id == snd_soc_dapm_dai_in)
>>>> +                     return (struct snd_soc_dai *)p->source->priv;
>>>> +             be = tocodec_tdm_get_ahead_be(p->source);
>>>> +             if (be && be->id == TDM_IFACE)
>>>> +                     return be;
>>>> +     }
>>>> +     return NULL;
>>>> +}
>>>> +
>>>> +static unsigned int aml_simple_strtoull(const char *cp)
>>>> +{
>>>> +     unsigned int result = 0;
>>>> +     unsigned int value = 0;
>>>> +     unsigned int len = strlen(cp);
>>>> +
>>>> +     while (len != 0) {
>>>> +             len--;
>>>> +             value = isdigit(*cp);
>>>> +             if (value) {
>>>> +                     value = *cp - '0';
>>>> +             } else {
>>>> +                     cp++;
>>>> +                     continue;
>>>> +             }
>>>> +             cp++;
>>>> +             result = result * 10 + value;
>>>> +     }
>>>> +     return result;
>>>> +}
>>>> +
>>>> +static int aml_get_clk_id(const char *name)
>>>> +{
>>>> +     int clk_id = 0;
>>>> +
>>>> +     if (strstr(name, "mst_a"))
>>>> +             clk_id = 0;
>>>> +     else if (strstr(name, "mst_b"))
>>>> +             clk_id = 1;
>>>> +     else if (strstr(name, "mst_c"))
>>>> +             clk_id = 2;
>>>> +     else if (strstr(name, "mst_d"))
>>>> +             clk_id = 3;
>>>> +     else if (strstr(name, "mst_e"))
>>>> +             clk_id = 4;
>>>> +     else if (strstr(name, "mst_f"))
>>>> +             clk_id = 5;
>>>> +
>>>> +     return clk_id;
>>>> +}
>>>> +
>>>> +static int aml_tocodec_sel_set(struct snd_soc_dapm_widget *w)
>>>> +{
>>>> +     struct snd_soc_dai *be;
>>>> +     struct axg_tdm_stream *stream;
>>>> +     struct axg_tdm_iface *iface;
>>>> +     struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
>>>> +     struct toacodec *priv = snd_soc_component_get_drvdata(component);
>>>> +     unsigned int tdm_id = TDM_A_PAD;
>>>> +     const char *dai_widget_name;
>>>> +     struct snd_soc_dapm_path *p;
>>>> +     unsigned int lane = 0;
>>>> +     unsigned int val = 0;
>>>> +     struct clk *sclk, *mclk;
>>>> +     char *clk_name;
>>>> +     int mclk_id, sclk_id;
>>>> +
>>>> +     be = tocodec_tdm_get_ahead_be(w);
>>>> +     if (!be) {
>>>> +             dev_err(component->dev, "%s not find the be\n", __func__);
>>>> +             return -EINVAL;
>>>> +     }
>>>> +     stream = snd_soc_dai_dma_data_get_playback(be);
>>>> +     if (!stream) {
>>>> +             dev_err(component->dev, "%s not find the stream\n", __func__);
>>>> +             return -EINVAL;
>>>> +     }
>>>> +     /*we like to use dai id, but it is fixed val*/
>>>> +     dai_widget_name = be->stream[SNDRV_PCM_STREAM_PLAYBACK].widget->name;
>>>> +     if (strstr(dai_widget_name, "TDM_A"))
>>>> +             tdm_id = TDM_A_PAD;
>>>> +     else if (strstr(dai_widget_name, "TDM_B"))
>>>> +             tdm_id = TDM_B_PAD;
>>>> +     else if (strstr(dai_widget_name, "TDM_C"))
>>>> +             tdm_id = TDM_C_PAD;
>>>> +     snd_soc_dapm_widget_for_each_source_path(w, p) {
>>>> +             if (p->connect && p->name) {
>>>> +                     lane = aml_simple_strtoull(p->name);
>>>> +                     val = lane + tdm_id * S4_LANE_OFFSET;
>>>> +                     regmap_field_write(priv->field_dat_sel, val);
>>>> +             }
>>>> +     }
>>>> +     iface = stream->iface;
>>>> +     mclk = iface->mclk;
>>>> +     sclk = iface->sclk;
>>>> +     mclk_id = aml_get_clk_id(__clk_get_name(mclk));
>>>> +     sclk_id = aml_get_clk_id(__clk_get_name(sclk));
>>>> +     regmap_field_write(priv->field_mclk_sel, mclk_id);
>>>> +     regmap_field_write(priv->field_bclk_sel, sclk_id);
>>>> +     regmap_field_write(priv->field_lrclk_sel, sclk_id);
>>>> +
>>>> +     return 0;
>>>> +}
>>>> +
>>>> +static int tocodec_sel_event(struct snd_soc_dapm_widget *w,
>>>> +                          struct snd_kcontrol *control,
>>>> +                          int event)
>>>> +{
>>>> +     struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
>>>> +     int ret = 0;
>>>> +
>>>> +     switch (event) {
>>>> +     case SND_SOC_DAPM_PRE_PMU:
>>>> +             ret = aml_tocodec_sel_set(w);
>>>> +             break;
>>>> +
>>>> +     case SND_SOC_DAPM_PRE_PMD:
>>>> +             break;
>>>> +
>>>> +     default:
>>>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>>>> +             return -EINVAL;
>>>> +     }
>>>> +
>>>> +     return ret;
>>>> +}
>>>> +
>>>> +static int tocodec_clk_enable(struct snd_soc_dapm_widget *w,
>>>> +                           struct snd_kcontrol *control,
>>>> +                           int event)
>>>> +{
>>>> +     int ret = 0;
>>>> +     unsigned int mask = 0, val = 0;
>>>> +     struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
>>>> +
>>>> +     snd_soc_component_update_bits(component, TOACODEC_CTRL0,
>>>> +                                   1 << CTRL0_BLK_CAP_INV_SHIFT, 1 << CTRL0_BLK_CAP_INV_SHIFT);
>>>> +     switch (event) {
>>>> +     case SND_SOC_DAPM_PRE_PMU:
>>>> +             mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
>>>> +             val = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
>>>> +             snd_soc_component_update_bits(component, TOACODEC_CTRL0, mask, val);
>>>> +             break;
>>>> +     case SND_SOC_DAPM_PRE_PMD:
>>>> +             mask = 1 << CTRL0_MCLK_ENABLE_SHIFT | 1 << CTRL0_BCLK_ENABLE_SHIFT;
>>>> +             val = 0 << CTRL0_MCLK_ENABLE_SHIFT | 0 << CTRL0_BCLK_ENABLE_SHIFT;
>>>> +             snd_soc_component_update_bits(component, TOACODEC_CTRL0, mask, val);
>>>> +             break;
>>>> +     default:
>>>> +             dev_err(component->dev, "Unexpected event %d\n", event);
>>>> +             return -EINVAL;
>>>> +     }
>>>> +
>>>> +     return ret;
>>>> +}
>>>> +
>>>> +static const struct snd_soc_dapm_widget s4_toacodec_widgets[] = {
>>>> +     SND_SOC_DAPM_MUX_E("Lane SRC", SND_SOC_NOPM, 0, 0,
>>>> +                        &s4_tocodec_lane_sel, tocodec_sel_event,
>>>> +                        (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
>>>> +     SND_SOC_DAPM_MUX("INPUT SRC", SND_SOC_NOPM, 0, 0, &s4_tocodec_src_sel),
>>>> +     SND_SOC_DAPM_SWITCH_E("OUT EN", SND_SOC_NOPM, 0, 0,
>>>> +                           &s4_toacodec_out_enable, tocodec_clk_enable,
>>>> +                             (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
>>>> +     SND_SOC_DAPM_AIF_IN("TDMA", NULL, 0, SND_SOC_NOPM, 0, 0),
>>>> +     SND_SOC_DAPM_AIF_IN("TDMB", NULL, 0, SND_SOC_NOPM, 0, 0),
>>>> +     SND_SOC_DAPM_AIF_IN("TDMC", NULL, 0, SND_SOC_NOPM, 0, 0),
>>>> +     SND_SOC_DAPM_OUT_DRV("Lane0", SND_SOC_NOPM, 0, 0, NULL, 0),
>>>> +     SND_SOC_DAPM_OUT_DRV("Lane1", SND_SOC_NOPM, 0, 0, NULL, 0),
>>>> +     SND_SOC_DAPM_OUT_DRV("Lane2", SND_SOC_NOPM, 0, 0, NULL, 0),
>>>> +     SND_SOC_DAPM_OUT_DRV("Lane3", SND_SOC_NOPM, 0, 0, NULL, 0),
>>>> +     SND_SOC_DAPM_OUT_DRV("Lane4", SND_SOC_NOPM, 0, 0, NULL, 0),
>>>> +     SND_SOC_DAPM_OUT_DRV("Lane5", SND_SOC_NOPM, 0, 0, NULL, 0),
>>>> +     SND_SOC_DAPM_OUT_DRV("Lane6", SND_SOC_NOPM, 0, 0, NULL, 0),
>>>> +     SND_SOC_DAPM_OUT_DRV("Lane7", SND_SOC_NOPM, 0, 0, NULL, 0),
>>>> +     SND_SOC_DAPM_OUTPUT("TDM_TO_ACODEC"),
>>>> +};
>>>> +
>>>> +static const struct snd_soc_dapm_route s4_tocodec_dapm_routes[] = {
>>>> +     { "INPUT SRC", "TDMA", "TDMA"},
>>>> +     { "INPUT SRC", "TDMB", "TDMB"},
>>>> +     { "INPUT SRC", "TDMC", "TDMC"},
>>>> +     { "Lane0", NULL, "INPUT SRC" },
>>>> +     { "Lane1", NULL, "INPUT SRC"},
>>>> +     { "Lane2", NULL, "INPUT SRC"},
>>>> +     { "Lane3", NULL, "INPUT SRC"},
>>>> +     { "Lane4", NULL, "INPUT SRC"},
>>>> +     { "Lane5", NULL, "INPUT SRC"},
>>>> +     { "Lane6", NULL, "INPUT SRC"},
>>>> +     { "Lane7", NULL, "INPUT SRC"},
>>>> +     { "Lane SRC", "Lane0", "Lane0"},
>>>> +     { "Lane SRC", "Lane1", "Lane1"},
>>>> +     { "Lane SRC", "Lane2", "Lane2"},
>>>> +     { "Lane SRC", "Lane3", "Lane3"},
>>>> +     { "Lane SRC", "Lane4", "Lane4"},
>>>> +     { "Lane SRC", "Lane5", "Lane5"},
>>>> +     { "Lane SRC", "Lane6", "Lane6"},
>>>> +     { "Lane SRC", "Lane7", "Lane7"},
>>>> +     { "OUT EN", "Switch", "Lane SRC"},
>>>> +     { "TDM_TO_ACODEC", NULL, "OUT EN"},
>>>> +
>>>> +};
>>>> +
>>>> +static const struct snd_soc_component_driver s4_tocodec_component_drv = {
>>>> +     .dapm_widgets           = s4_toacodec_widgets,
>>>> +     .num_dapm_widgets       = ARRAY_SIZE(s4_toacodec_widgets),
>>>> +     .dapm_routes            = s4_tocodec_dapm_routes,
>>>> +     .num_dapm_routes        = ARRAY_SIZE(s4_tocodec_dapm_routes),
>>>> +};
>>>> +
>>>> +static const struct toacodec_match_data s4_toacodec_match_data = {
>>>> +     .component_drv  = &s4_tocodec_component_drv,
>>>> +     .field_dat_sel  = REG_FIELD(TOACODEC_CTRL0, 16, 20),
>>>> +     .field_lrclk_sel = REG_FIELD(TOACODEC_CTRL0, 12, 14),
>>>> +     .field_bclk_sel = REG_FIELD(TOACODEC_CTRL0, 4, 6),
>>>> +     .field_mclk_sel = REG_FIELD(TOACODEC_CTRL0, 0, 2),
>>>> +};
>>>> +
>>>> +static const struct of_device_id s4_tocodec_of_match[] = {
>>>> +     {
>>>> +             .compatible = "amlogic,s4-tocodec",
>>>> +             .data = &s4_toacodec_match_data,
>>>> +     }, {}
>>>> +};
>>>> +
>>>> +MODULE_DEVICE_TABLE(of, s4_tocodec_of_match);
>>>> +
>>>> +static int tocodec_probe(struct platform_device *pdev)
>>>> +{
>>>> +     const struct toacodec_match_data *data;
>>>> +     struct device *dev = &pdev->dev;
>>>> +     struct toacodec *priv;
>>>> +     void __iomem *regs;
>>>> +     struct regmap *map;
>>>> +     int ret;
>>>> +
>>>> +     data = device_get_match_data(dev);
>>>> +     if (!data)
>>>> +             return dev_err_probe(dev, -ENODEV, "failed to match device\n");
>>>> +     priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>>>> +     if (!priv)
>>>> +             return -ENOMEM;
>>>> +
>>>> +     platform_set_drvdata(pdev, priv);
>>>> +
>>>> +     ret = device_reset(dev);
>>>> +     if (ret)
>>>> +             return ret;
>>>> +
>>>> +     regs = devm_platform_ioremap_resource(pdev, 0);
>>>> +     if (IS_ERR(regs))
>>>> +             return PTR_ERR(regs);
>>>> +
>>>> +     map = devm_regmap_init_mmio(dev, regs, &tocodec_regmap_cfg);
>>>> +     if (IS_ERR(map))
>>>> +             return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap\n");
>>>> +
>>>> +     priv->field_dat_sel = devm_regmap_field_alloc(dev, map, data->field_dat_sel);
>>>> +     if (IS_ERR(priv->field_dat_sel))
>>>> +             return PTR_ERR(priv->field_dat_sel);
>>>> +
>>>> +     priv->field_lrclk_sel = devm_regmap_field_alloc(dev, map, data->field_lrclk_sel);
>>>> +     if (IS_ERR(priv->field_lrclk_sel))
>>>> +             return PTR_ERR(priv->field_lrclk_sel);
>>>> +
>>>> +     priv->field_bclk_sel = devm_regmap_field_alloc(dev, map, data->field_bclk_sel);
>>>> +     if (IS_ERR(priv->field_bclk_sel))
>>>> +             return PTR_ERR(priv->field_bclk_sel);
>>>> +
>>>> +     priv->field_mclk_sel = devm_regmap_field_alloc(dev, map, data->field_mclk_sel);
>>>> +     if (IS_ERR(priv->field_mclk_sel))
>>>> +             return PTR_ERR(priv->field_mclk_sel);
>>>> +
>>>> +     return devm_snd_soc_register_component(dev,
>>>> +                     data->component_drv, NULL, 0);
>>>> +}
>>>> +
>>>> +static struct platform_driver tocodec_pdrv = {
>>>> +     .probe = tocodec_probe,
>>>> +     .driver = {
>>>> +             .name = "s4-tocodec",
>>>> +             .of_match_table = s4_tocodec_of_match,
>>>> +     },
>>>> +};
>>>> +
>>>> +module_platform_driver(tocodec_pdrv);
>>>> +
>>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>>> +MODULE_LICENSE("GPL");
>>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>>> index 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648 100644
>>>> --- a/sound/soc/meson/t9015.c
>>>> +++ b/sound/soc/meson/t9015.c
>>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
>>>>                 .channels_min = 1,
>>>>                 .channels_max = 2,
>>>>                 .rates = SNDRV_PCM_RATE_8000_96000,
>>>> -             .formats = (SNDRV_PCM_FMTBIT_S8 |
>>>> -                         SNDRV_PCM_FMTBIT_S16_LE |
>>>> -                         SNDRV_PCM_FMTBIT_S20_LE |
>>>> -                         SNDRV_PCM_FMTBIT_S24_LE),
>>>> +             .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE),
>>> Again, mixed up changes with zero justification.
>>>
>>> This drops S8 and S16 format support for the existing SoCs (such as GXL)
>>> which is known to work and add S32 support on an HW documented as 24bits
>>> only. Can you explain ?
>>>
>>>>         },
>>>>         .ops = &t9015_dai_ops,
>>>>    };
>>> --
>>> Jerome
> --
> Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44])
	(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 E262A232437
	for <linux-kernel@vger.kernel.org>; Tue, 14 Jan 2025 14:05:27 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736863530; cv=none; b=cvHuknOZKU5D7Z1Vnfp0eNl9oY9osVCjNXBmFzm8yBXXkXWR1+Ae+SStwjJOpRUeXL1n2EcSTCoEzf/API6nJyK9aPJ+2k3yze96wqPHvrKoWqNc3bNbKGmJUi7XEPuYMOLRTunqL/XK6dEI74ynKs/exiGTRlcapZGKralJ0S4=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736863530; c=relaxed/simple;
	bh=6tKjcpDmSDVi0I0Iymsx6pKq7XeGCNlnh/DkEXq+Kvg=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=SVrI5H64nvFUVVdhYgqC8anFgzk0aXy7cfUZobw3fyCWEtycB4MYV4k6tcYycF1BMUNwoWKJRWnLVe+RjVWbHVZN1ZzVlCqDR0pr1p3nlsC1WoTqRlwqWTOT3PHDnDUpENc+ay7J9Q9uN99tMu0+nqjiqxTFOXV8nILXYJq6ujA=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=zxLaka5h; arc=none smtp.client-ip=209.85.128.44
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="zxLaka5h"
Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-436637e8c8dso57390425e9.1
        for <linux-kernel@vger.kernel.org>; Tue, 14 Jan 2025 06:05:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736863526; x=1737468326; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=6tKjcpDmSDVi0I0Iymsx6pKq7XeGCNlnh/DkEXq+Kvg=;
        b=zxLaka5hYGgofHs76q25QEOy75B3+rFA0WfYvOvZyAnj7iWI6+5m6hBSri6TLPzJ54
         xjmAbueWQ/wNkuZTVFXMtp0CXUJvfoV9w4PTz+0ZR0TKtoNB0Gwq+tDRkLsXiezh/U0n
         ZMpdb19uusTeim/SU5p0iHPpb6x33XnrCEGj8868XBr5y10jo+IG39g55rXd4rqYYTmh
         sctJp2qe7bIp27b4STvMrbFJOv24wLHWTtqXwuPy4T4BR4DxskTavNYw2QZ6zDu/uOQF
         l2BSiTGf/8tBfFABa7xJBUd/0OwB4990OVqbE1Q7QnpaeSgsgSHyTS8CXL1FHhMoKyAu
         t2gw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1736863526; x=1737468326;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=6tKjcpDmSDVi0I0Iymsx6pKq7XeGCNlnh/DkEXq+Kvg=;
        b=p6xTH0N0yJTPbdRZPNm+NkmmhfJ0GrSulYbhZRMWcKXo6DOgwpPGm+TAIhHwnXGgtE
         j16EcBKK96ymKP9az3aoolO7ZSPkTCBjAvdXKGYREY236u5Pjl+AV4+fgKk/8P5jCzC8
         TDvDFMqMJdDSmv7nMBYfqQwI6qZ1b6szadbZ9yFG6iQWSrFQcRgWzFYfgQlY+TzoizNT
         NwfSHDkheeFVV9vUVcRaiwVcMkiMze4tPs6e4RiTfAy54gJmZyf5EKzcGCDq3NGKVj0p
         vACjtFt0Y3kzqNHpqFh3/IePXbYFFYXuQERDM9rbQ+/BapfKIBQc7C0/aITFFjoge/aU
         aVOw==
X-Forwarded-Encrypted: i=1; AJvYcCX+zM2pY7OSu9sjBa1r6gAw3d5zNIWFggS4ENAi0YzckTEtkzTRZXN06ly8/di2wyDyWzBPYY+TE1rkREU=@vger.kernel.org
X-Gm-Message-State: AOJu0YyapGZ72z95RWAepvh2dCLPjsmJpNLXZYO0xVEJPodzrq0coj7E
	r+oK8eE2q0+U5HlGkG0QD2i7X2Z/kCHqikXUbx/AldXiEQc8UZuqYw2iQ4uOa4M=
X-Gm-Gg: ASbGnctPXDW32oYn8JaaLSM+u1VHPsZmgkCD5u8vB0OxTv5ymaG4oj95oEi60MjXY2C
	5R9w/H92wU90HFemMedzEJ7u+asXAaGjhGBTRGYM5nf0GgEp8bWAvMTXMeBmOVw+FfRRYt8xbks
	f7b+Hm1SxWRMXT2y0egCrhI9WaQ/CErTosG3esKoW+gnXs8+O7DpMK+yBfWTn8CDiGny1anLImN
	4J2m2InB3zOucNLBGtYEr9nsyHZQ+6cujBf5DCOsvscMOGdrqpm9OYn
X-Google-Smtp-Source: AGHT+IGYBCH61RKlTG9lkoFWiyGMe6exY5OKDG7Opi27JjRz3QS+q+QxKENJfYtPEqBwzJBVByTGvA==
X-Received: by 2002:a05:600c:1d03:b0:434:a0bf:98ea with SMTP id 5b1f17b1804b1-436e2699e91mr225375155e9.9.1736863525942;
        Tue, 14 Jan 2025 06:05:25 -0800 (PST)
Received: from localhost ([2a01:e0a:3c5:5fb1:317c:3d93:b7d4:96cd])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2ddc5f5sm210760595e9.18.2025.01.14.06.05.25
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 14 Jan 2025 06:05:25 -0800 (PST)
From: Jerome Brunet <jbrunet@baylibre.com>
To: Jiebing Chen <jiebing.chen@amlogic.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
  Liam Girdwood <lgirdwood@gmail.com>,  Mark Brown <broonie@kernel.org>,
  Rob Herring <robh@kernel.org>,  Krzysztof Kozlowski <krzk+dt@kernel.org>,
  Conor Dooley <conor+dt@kernel.org>,  Jaroslav Kysela <perex@perex.cz>,
  Takashi Iwai <tiwai@suse.com>,  Neil Armstrong
 <neil.armstrong@linaro.org>,  Kevin Hilman <khilman@baylibre.com>,  Martin
 Blumenstingl <martin.blumenstingl@googlemail.com>,
  linux-sound@vger.kernel.org,  devicetree@vger.kernel.org,
  linux-kernel@vger.kernel.org,  linux-arm-kernel@lists.infradead.org,
  linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
In-Reply-To: <e69cd38e-898c-4cbc-a327-14148a71c764@amlogic.com> (Jiebing
	Chen's message of "Tue, 14 Jan 2025 19:20:00 +0800")
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
	<20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
	<1jwmey9451.fsf@starbuckisacylon.baylibre.com>
	<e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
	<e69cd38e-898c-4cbc-a327-14148a71c764@amlogic.com>
User-Agent: mu4e 1.12.7; emacs 29.4
Date: Tue, 14 Jan 2025 15:05:24 +0100
Message-ID: <1j8qrd7aor.fsf@starbuckisacylon.baylibre.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue 14 Jan 2025 at 19:20, Jiebing Chen <jiebing.chen@amlogic.com> wrote:

>>>> +
>>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>>> +MODULE_LICENSE("GPL");
>>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>>> index
>>>> 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e=
03d953586648
>>>> 100644
>>>> --- a/sound/soc/meson/t9015.c
>>>> +++ b/sound/soc/meson/t9015.c
>>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai =3D {
>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 .channels_min =3D 1,
>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 .channels_max =3D 2,
>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 .rates =3D SNDRV_PCM_RATE_8000_96000,
>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 .formats =3D (SNDRV_PCM_FMTBIT_S8 |
>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 SNDRV_PCM_FMTBIT_S16_LE |
>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 SNDRV_PCM_FMTBIT_S20_LE |
>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 SNDRV_PCM_FMTBIT_S24_LE),
>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 .formats =3D (SNDRV_PCM_FMTBIT_S16_LE |
>>>> SNDRV_PCM_FMTBIT_S32_LE),
>>> Again, mixed up changes with zero justification.
>>>
>>> This drops S8 and S16 format support for the existing SoCs (such as GXL)
>>> which is known to work and add S32 support on an HW documented as 24bits
>>> only. Can you explain ?
>
> for g12a, sm1 etc, it is use new audio ip, GXL is old ip,

If there are chips difference we did not know about, then you should
introduce those difference, without breaking existing support -
including for GXL, which is what you did IIUC.

> the new ip not support 24 bit,

Are sure about that ? that code has been there for a while.

If sm1 does not support SNDRV_PCM_FMTBIT_S24_LE, you should a fix up patch =
for
that, with the proper "Fixes:" tag, how to reproduce the problem and
explaining the fix.

>
> usually support 16/32 bit for new audio ip , for SNDRV_PCM_FMTBIT_S24_LE,
> it width =3D24, phy =3D32

Yes physical of SNDRV_PCM_FMTBIT_S24_LE, so most chip supporting 32 bits
width would support this S24_LE, unless there is something odd.

>
> it was=C2=A0 treated as 32 bit to send for tdm, so we can only add the S3=
2LE
> base on it , right ?

You are asking me ? How am I suppose to know ?

> but if the gxl not support the 32bit

I don't see a problem with a DAC taking input on 32bits physical
interface and ignoring some bit on processing.

If that's not the case, please send a proper fix change with some explanati=
on

>
> we need add new snd_soc_dai_driver t9015_dai_s4 ?
>

If I understood correctly format depends on the chip and needs to
adjusted including for sm1.=20

>>>
>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 },
>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .ops =3D &t9015_dai_ops,
>>>> =C2=A0 };
>>> -- Jerome

--=20
Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53])
	(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 D6F88146590
	for <linux-kernel@vger.kernel.org>; Tue, 14 Jan 2025 14:15:18 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736864122; cv=none; b=ea0n+7RgDyJTJowbSXJgoKeP5prETXEs7NLP9AxrB0P0OYzuF4X3DU0tNu4yEyMPjCq+U3ElCpkt4qrdrM2g0NtZgwdW6l67j6QBzp+evp6Efr7lw1ZJ0PB4/xyhCCb8D5M4gLL+FkvIi2yHJm5ztKONKRLJiAYUQKt82rGrCuc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736864122; c=relaxed/simple;
	bh=dPiW9cU8fn/VoVc17fTcJXh78YO+sF2cYqxV4cvtN+I=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=EHO+WWEZroB0+hX+cWNde61xddL+42DOOPypn054CflAKS1XIxuFiwVCcrqEQNS6EdGo/Y2VL9h0HMk52KlSBwXjlw9qpjQgFiz0VzcYd2aPPd/hQqtHzN1xwAF1yuNUoq1h/RvVFp5/MK/r7tvB6Rbh8VI6xlfQylOpfZB5AWw=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=t6xY8MxY; arc=none smtp.client-ip=209.85.128.53
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="t6xY8MxY"
Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso39722115e9.1
        for <linux-kernel@vger.kernel.org>; Tue, 14 Jan 2025 06:15:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736864117; x=1737468917; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=zGnwHZ/nWlYaaxLbV8V6TilY1n8mD+IS7w/R3cun8X8=;
        b=t6xY8MxYWC09SIpnV4L6xwAGo7xXxVUqTJWkHKR2HEPhBnMh3kUdwgb8Jm54iJDle9
         /DTixEXpojcnneH3JvwYwg0+KUc4LDyfWQZPzHud8joDr06l0Z6rIbGVJuxcd/MpqOaa
         HuYlp2sIrTAJZlfn43L+ZOGvzslhAEYcoxeaL9UFyiiIzvMN58f9GQUKObxqZ5Xd9KSx
         KkSyYy9MhIEl3iOKCODjxz4nY7g9flfcoTFPp/Mx4j7vzmluJ99tdqscW/70B9XHi/8l
         p5DGkFX8TieVLwhMkJqqSKQPCGCG3Lt6MRYHa3i/gEoAIpx5nivS64Km8gg7mD8q+X4o
         pZTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1736864117; x=1737468917;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=zGnwHZ/nWlYaaxLbV8V6TilY1n8mD+IS7w/R3cun8X8=;
        b=JfsIH/1TrIfi2jzBM7q3t+LyCgADaWu9IQs6mW73O2+59Pnllusm9AT5DbDB2xuIIM
         XN0ejNC1zY9ks9vangBe6O7SwqYZ5c93hSQb73s/blb2rkaBOktseDgJ+YYRXm7sFNNv
         YZ5NisD6sXp0Dq0plc5KHm8madrGLjAQwx0P3yRf1z41Lwma1wKXMl8PrAYufTH4k3aZ
         42Ds0VbcM+RlbH/ThETrq3Mr+V6n/klnboptYBHZbpJpy2qNJXnsiWRuwAhxiNBeapmI
         jsuJ5smfeytgqxqW1fYYN13uKeWionZjwS99gM8NKj0zVLBhIjfnebehhwFySc7RmYDi
         UEOg==
X-Forwarded-Encrypted: i=1; AJvYcCU0srdo2Imz9vXCRsWcDZUcINGSOKt0mnWRluG03YbXvLYJVch9fsgV3LNv2SFhQCfjDGJnXdoK4XqmKEo=@vger.kernel.org
X-Gm-Message-State: AOJu0Yw7iauqqqycwUv2aqOdMlwTLIoVTdf4unJ9++kynwuljBpa1Ngk
	gYZnDZBpkosQSXXqsi/pxMUINJHrMXjyRLQbQMHOddy3G/2k23rEkc3iU+imoBM9htDyk5eqFTy
	C
X-Gm-Gg: ASbGncs2dGicH0LGNuYLy5XZttvyZLHV29jyqkTw5IEvROIrjRsOqSfgb8jue5xqGMg
	kw9oCwqiNiJkkM0nP+LDxZBItFQ4AWpmaZ52DT0T411+kUX8dV/f70o1uNThufgthcEO0HAJGCc
	5CfYx+VVs7VT0g68ma6EEF35CFbzvvVy3geK3brChn2RAZt76Jx76TuF4zZ9pCXX/GnxK3lumch
	no0CxvgCGCDSE+5UFwF2jtwRQY6VaXHoNTrLsKaW5tRKwa+2HYuKed+
X-Google-Smtp-Source: AGHT+IFBaxtBsbDoGCFuE0KrD/uC8iq93eKLTTc/GgOPTE+++0UVJujouLLyM9aFVx5ULskxQsYJHA==
X-Received: by 2002:a5d:6d8e:0:b0:38a:88be:bcb4 with SMTP id ffacd0b85a97d-38a88bebd23mr21000464f8f.29.1736864117139;
        Tue, 14 Jan 2025 06:15:17 -0800 (PST)
Received: from localhost ([2a01:e0a:3c5:5fb1:317c:3d93:b7d4:96cd])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e62116sm175095835e9.35.2025.01.14.06.15.16
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 14 Jan 2025 06:15:16 -0800 (PST)
From: Jerome Brunet <jbrunet@baylibre.com>
To: Jiebing Chen <jiebing.chen@amlogic.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
  Liam Girdwood <lgirdwood@gmail.com>,  Mark Brown <broonie@kernel.org>,
  Rob Herring <robh@kernel.org>,  Krzysztof Kozlowski <krzk+dt@kernel.org>,
  Conor Dooley <conor+dt@kernel.org>,  Jaroslav Kysela <perex@perex.cz>,
  Takashi Iwai <tiwai@suse.com>,  Neil Armstrong
 <neil.armstrong@linaro.org>,  Kevin Hilman <khilman@baylibre.com>,  Martin
 Blumenstingl <martin.blumenstingl@googlemail.com>,
  linux-sound@vger.kernel.org,  devicetree@vger.kernel.org,
  linux-kernel@vger.kernel.org,  linux-arm-kernel@lists.infradead.org,
  linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
In-Reply-To: <0e8b78c1-5c56-40e7-a2d8-41a7f49d52bc@amlogic.com> (Jiebing
	Chen's message of "Tue, 14 Jan 2025 20:34:01 +0800")
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
	<20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
	<1jldve939f.fsf@starbuckisacylon.baylibre.com>
	<813e2564-8c4c-4adb-8184-ab88156e3e4c@amlogic.com>
	<1jmsft7ihz.fsf@starbuckisacylon.baylibre.com>
	<0e8b78c1-5c56-40e7-a2d8-41a7f49d52bc@amlogic.com>
User-Agent: mu4e 1.12.7; emacs 29.4
Date: Tue, 14 Jan 2025 15:15:16 +0100
Message-ID: <1j34hl7a8b.fsf@starbuckisacylon.baylibre.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue 14 Jan 2025 at 20:34, Jiebing Chen <jiebing.chen@amlogic.com> wrote:

> =E5=9C=A8 2025/1/14 19:16, Jerome Brunet =E5=86=99=E9=81=93:
>> [ EXTERNAL EMAIL ]
>>
>> On Tue 14 Jan 2025 at 16:52, Jiebing Chen <jiebing.chen@amlogic.com> wro=
te:
>>
>>> =E5=9C=A8 2025/1/13 22:50, Jerome Brunet =E5=86=99=E9=81=93:
>>>> [ EXTERNAL EMAIL ]
>>>>
>>>> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay <devnull+jiebin=
g.chen.amlogic.com@kernel.org> wrote:
>>>>
>>>>> From: jiebing chen <jiebing.chen@amlogic.com>
>>>>>
>>>>> Add basic audio driver support for the Amlogic S4 based Amlogic
>>>>> AQ222 board.
>>>>>
>>>>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>>>>> ---
>>>>>    .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts     | 226 +++++++++=
+++
>>>>>    arch/arm64/boot/dts/amlogic/meson-s4.dtsi          | 385 +++++++++=
+++++++++++-
>>>>>    2 files changed, 610 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
> b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>> index 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c5=
528b43422b705b20130 100644
>>>>> --- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>> @@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
>>>>>                regulator-always-on;
>>>>>         };
>>>>>
>>>>> +     vcc5v_reg: regulator-vcc-5v {
>>>>> +             compatible =3D "regulator-fixed";
>>>>> +             vin-supply =3D <&main_12v>;
>>>>> +             regulator-name =3D "VCC5V";
>>>>> +             regulator-min-microvolt =3D <5000000>;
>>>>> +             regulator-max-microvolt =3D <5000000>;
>>>>> +             gpio =3D <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
>>>>> +             startup-delay-us =3D <7000>;
>>>>> +             enable-active-high;
>>>>> +             regulator-boot-on;
>>>>> +             regulator-always-on;
>>>>> +     };
>>>>> +
>>>>>         /* SY8120B1ABC DC/DC Regulator. */
>>>>>         vddcpu: regulator-vddcpu {
>>>>>                 compatible =3D "pwm-regulator";
>>>>> @@ -129,6 +142,219 @@ vddcpu: regulator-vddcpu {
>>>>>                                 <699000 98>,
>>>>>                                 <689000 100>;
>>>>>         };
>>>>> +     dmics: audio-codec-1 {
>>>>> +             compatible =3D "dmic-codec";
>>>>> +             #sound-dai-cells =3D <0>;
>>>>> +             num-channels =3D <2>;
>>>>> +             wakeup-delay-ms =3D <50>;
>>>>> +             sound-name-prefix =3D "MIC";
>>>>> +     };
>>>>> +
>>>>> +     dioo2133: audio-amplifier-0 {
>>>>> +             compatible =3D "simple-audio-amplifier";
>>>>> +             enable-gpios =3D <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
>>>>> +             VCC-supply =3D <&vcc5v_reg>;
>>>>> +             #sound-dai-cells =3D <0>;
>>>>> +             sound-name-prefix =3D "10U2";
>>>>> +     };
>>>>> +
>>>>> +     spdif_dir: audio-spdif-in {
>>>>> +             compatible =3D "linux,spdif-dir";
>>>>> +             #sound-dai-cells =3D <0>;
>>>>> +             sound-name-prefix =3D "DIR";
>>>>> +     };
>>>>> +
>>>>> +     spdif_dit: audio-spdif-out {
>>>>> +             compatible =3D "linux,spdif-dit";
>>>>> +             #sound-dai-cells =3D <0>;
>>>>> +             sound-name-prefix =3D "DIT";
>>>>> +     };
>>>>> +
>>>>> +     sound {
>>>>> +             compatible =3D "amlogic,axg-sound-card";
>>>>> +             model =3D "aq222";
>>>>> +             audio-widgets =3D "Line", "Lineout";
>>>>> +             audio-aux-devs =3D <&tdmout_a>, <&tdmout_b>, <&tdmout_c=
>,
>>>>> +                              <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
>>>>> +                              <&tdmin_lb>, <&dioo2133>, <&tdmout_pad=
>, <&toacodec>;
>>>>> +             audio-routing =3D "TDMOUT_A IN 0", "FRDDR_A OUT 0",
>>>>> +                             "TDMOUT_A IN 1", "FRDDR_B OUT 0",
>>>>> +                             "TDMOUT_A IN 2", "FRDDR_C OUT 0",
>>>>> +                             "TDM_A Playback", "TDMOUT_A OUT",
>>>>> +                             "TDMA_OUT SEL",   "TDM_A Playback",
>>>>> +                             "TDMOUT_B IN 0", "FRDDR_A OUT 1",
>>>>> +                             "TDMOUT_B IN 1", "FRDDR_B OUT 1",
>>>>> +                             "TDMOUT_B IN 2", "FRDDR_C OUT 1",
>>>>> +                             "TDM_B Playback", "TDMOUT_B OUT",
>>>>> +                             "TDMB_OUT SEL",   "TDM_B Playback",
>>>>> +                             "TDMOUT_C IN 0", "FRDDR_A OUT 2",
>>>>> +                             "TDMOUT_C IN 1", "FRDDR_B OUT 2",
>>>>> +                             "TDMOUT_C IN 2", "FRDDR_C OUT 2",
>>>>> +                             "TDM_C Playback", "TDMOUT_C OUT",
>>>>> +                             "TDMC_OUT SEL",   "TDM_C Playback",
>>>>> +                             "TOACODEC TDMA", "TDM_A Playback",
>>>>> +                             "TOACODEC TDMB", "TDM_B Playback",
>>>>> +                             "TOACODEC TDMC", "TDM_C Playback",
>>>>> +                             "SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
>>>>> +                             "SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
>>>>> +                             "SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
>>>>> +                             "SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
>>>>> +                             "SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
>>>>> +                             "SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
>>>>> +                             "TDMIN_A IN 0", "TDM_A Capture",
>>>>> +                             "TDMIN_A IN 1", "TDM_B Capture",
>>>>> +                             "TDMIN_A IN 2", "TDM_C Capture",
>>>>> +                             "TDMIN_A IN 3", "TDM_A Loopback",
>>>>> +                             "TDMIN_A IN 4", "TDM_B Loopback",
>>>>> +                             "TDMIN_A IN 5", "TDM_C Loopback",
>>>>> +                             "TDMIN_B IN 0", "TDM_A Capture",
>>>>> +                             "TDMIN_B IN 1", "TDM_B Capture",
>>>>> +                             "TDMIN_B IN 2", "TDM_C Capture",
>>>>> +                             "TDMIN_B IN 3", "TDM_A Loopback",
>>>>> +                             "TDMIN_B IN 4", "TDM_B Loopback",
>>>>> +                             "TDMIN_B IN 5", "TDM_C Loopback",
>>>>> +                             "TDMIN_C IN 0", "TDM_A Capture",
>>>>> +                             "TDMIN_C IN 1", "TDM_B Capture",
>>>>> +                             "TDMIN_C IN 2", "TDM_C Capture",
>>>>> +                             "TDMIN_C IN 3", "TDM_A Loopback",
>>>>> +                             "TDMIN_C IN 4", "TDM_B Loopback",
>>>>> +                             "TDMIN_C IN 5", "TDM_C Loopback",
>>>>> +                             "TDMIN_LB IN 3", "TDM_A Capture",
>>>>> +                             "TDMIN_LB IN 4", "TDM_B Capture",
>>>>> +                             "TDMIN_LB IN 5", "TDM_C Capture",
>>>>> +                             "TDMIN_LB IN 0", "TDM_A Loopback",
>>>>> +                             "TDMIN_LB IN 1", "TDM_B Loopback",
>>>>> +                             "TDMIN_LB IN 2", "TDM_C Loopback",
>>>>> +                             "TODDR_A IN 0", "TDMIN_A OUT",
>>>>> +                             "TODDR_B IN 0", "TDMIN_A OUT",
>>>>> +                             "TODDR_C IN 0", "TDMIN_A OUT",
>>>>> +                             "TODDR_A IN 1", "TDMIN_B OUT",
>>>>> +                             "TODDR_B IN 1", "TDMIN_B OUT",
>>>>> +                             "TODDR_C IN 1", "TDMIN_B OUT",
>>>>> +                             "TODDR_A IN 2", "TDMIN_C OUT",
>>>>> +                             "TODDR_B IN 2", "TDMIN_C OUT",
>>>>> +                             "TODDR_C IN 2", "TDMIN_C OUT",
>>>>> +                             "TODDR_A IN 3", "SPDIFIN Capture",
>>>>> +                             "TODDR_B IN 3", "SPDIFIN Capture",
>>>>> +                             "TODDR_C IN 3", "SPDIFIN Capture",
>>>>> +                             "TODDR_A IN 6", "TDMIN_LB OUT",
>>>>> +                             "TODDR_B IN 6", "TDMIN_LB OUT",
>>>>> +                             "TODDR_C IN 6", "TDMIN_LB OUT",
>>>>> +                             "10U2 INL", "ACODEC LOLP",
>>>>> +                             "10U2 INR", "ACODEC LORP",
>>>>> +                             "Lineout", "10U2 OUTL",
>>>>> +                             "Lineout", "10U2 OUTR";
>>>>> +             assigned-clocks =3D <&clkc_pll CLKID_HIFI_PLL>,
>>>>> +                               <&clkc_pll CLKID_MPLL2>,
>>>>> +                               <&clkc_pll CLKID_MPLL0>,
>>>>> +                               <&clkc_pll CLKID_MPLL1>;
>>>>> +             assigned-clock-rates =3D <491520000>,
>>>>> +                                    <294912000>,
>>>>> +                                    <270950400>,
>>>>> +                                    <393216000>;
>>>> Why do you need 4 base rates ? Which rate family does each provide ?
>>> hifipll 49152000, mpll2 294912000 mpll0 270950400, mpll1 393216000, the
>>> accuracy of hifipll
>>>
>>> is relatively high, for tdm/pdm/spdif 16/48/96/192k we can use it. if t=
he
>>> tdm and spdif work on
>> It is fine to use the HiFi. I'm glad this clock finally got fixed
>>
>>> the same time, for example ,tdm 48k. spdif 44.1k, we can't use the same
>>> pll, so spdif need use the mpll 0
>>>
>>> other pll , only set a default value, at the latest chip, we remove all
>>> mpll for hardware, only two hifipll
>> I'm not sure you understand how this works.
>> There is 3 families of audio rate: 48kHz, 44.1kHz and 32kHz
>>
>> Each family needs a PLL assigned, so you need 3, not 4, unless there is
>> another specific rate family you want to support. If that's the case,
>> document it.
>>
>> Setting the rate of the PLL should follow this principle:
>> * Family rate
>>    - multiplied by (32 x 24): to accomodate different sample sizes
>>    - multiplied by 2 until you reach the maximum rate of selected PLLs
>>      This allows to support rates such 192k or even 768k
>>
>> 491520000 is not dividable by 3, it won't allow 24 bits words. It is a
>> poor choice.
>>
>> Have a look at the s400 for an example using the HiFi PLL. The axg was
>> restricted to a 68 PLL multiplier but the S4 is not so you should be
>> able to use a higher base rate (4 718 592 000 Hz), providing better
>> accuracy in the end
>
> for new soc audio ip, the hardware will not support the 24bit(include g12=
a,
> sm1,axg)

That may be what you chose to support in your BSP but that not how it
works in mainline. 24bits slot width is supported and has been tested on
axg, g12 and sm1. This is not going away.

I would find extremely odd that 24 bits slot width is not supported on s4,
but as long you document this, it is fine by me.

>
> SNDRV_PCM_FMTBIT_S24_3LE, 24 bit in memory

I think you are mixing up slot width and memory representation

>

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from HK3PR03CU002.outbound.protection.outlook.com (mail-eastasiaazon11021132.outbound.protection.outlook.com [52.101.129.132])
	(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 C725322DFA7;
	Wed, 15 Jan 2025 02:56:27 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.129.132
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736909790; cv=fail; b=H6BKsWrRRTuxX1hVmIDtKdPIFehxWJgXmvxnZ8y3BYiITdp00mIKDCB+ALQIdktNGNom3+LBZDeNJzCmmslx9RvhU/LX+DX2RhyidA4LSOyaP3m6PqHwHdWxQDypJrpoTpggH9Pke0O8G/wwU8a8jjTGFCyWVtoSY9G4FFrvc+E=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736909790; c=relaxed/simple;
	bh=eeLYClg5bqB4hyFfBBPFs3Qz9A1Q7XpZ7dXcNnoemBs=;
	h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=erZwWOnXaCGBdNKFj08aurMPS+m63P6yoCMhZtIKYV6pz8oroIFAukCmYSgIGjzt24rIyyHZEDM+UzrP0phcSs4M0Sm3qWTMSTKsuRvWEpjHaif5NLEAgMnjSOWuPEZnRm9ryJjS1mnljTfbizWEYSLqGnYWosIIEvVpOjxY3r4=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=aiawVVm5; arc=fail smtp.client-ip=52.101.129.132
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="aiawVVm5"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=VlUxADU71d3XUgLv57OLaOjvqEY+3WnFb8tCtA4KBX76x5HmITPxertiWJ09hDQKtOMDwfhpvZw4ScLjNUa6n6vSEmmyY8Ful3RYYXWNj9b+LkUnuE5NTIPSoOazGsc+VZOsyxfzyLjXm/GIxlLK65knp3BaH0JeybMQ/B4Cb57OogHKz9kstIxfXSV2Nz5X0AU5E57ZDZvdXB/NKquy4lfjb+J9uWjPRchXO8jFLysTKF6eUM9F5f2TmMaUakiODv5+GWXAuQp7zFYG7Fxw/bEBQZKmLQDyddtcwLShzd87wWyK02yDhzPLsUt9xFmZp1dmHpkqmv9l+br1E9A1hQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=X4REsXvx44bpWisazXvCYeiEnCc7jXtV18i6b9FM6tg=;
 b=iyUuDsRoQA2bSV8h7o8d5XqPzZo6UPag/gzNghisChYkpYmerXBmShQho49+wKTRQqu51pnUN7Ll25bJ5PgFaK3uQb5wlexSFN50GasOvzPTyEsGhTfHUGroj1geum+wbGPMWPx/Lun9ae/iDuv8fIcq4fINRae64Wev/7OGbfNGgHX8ywBLoRX5fVhLRZ0pDE4W/BOfYWUIV/ghqE/Xpo8qMPeuBM+HoU1iJwPaVjDmALPDKUFM8ndYDo5rsMC2mRG3MIimnV4AvegLn3G4znc9KJu3lvFI3kNTXLGeKvOZ4MkcQgvPWnW+77zcRFHVXbSj073O/WvFSpkzrnSvFg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=X4REsXvx44bpWisazXvCYeiEnCc7jXtV18i6b9FM6tg=;
 b=aiawVVm5F8xtHSbbIsStE9jicbMav7t49klom/MjSzCgKZja7ZgZcfazYVhq3SniOkNQ/mSigKHSdvKrN06xgliZ5OjFRiSQBJSNLDcYWFP3BHxsYpA7nNkPEDlQsH61iJIS7zo23IK8CX/3P/DtdxbIW6Eu/meBtJ6G2HVU8uAtF2WwpFKhJs7NueG0SsKbb/N5sJLTqAa1Kuvbk0BYNMYi5NdeamsEID8F9V9s1afLA6LlPaelHl1gUUZ4x63k9NISrdfD/j6ncCf0IFPEkggXBbm9fL/PM2H/tbY2Gp1Kh0lexypGsUPsbJInsQpaksv0Uop0W4GYUnbzURk19A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by SEZPR03MB8444.apcprd03.prod.outlook.com (2603:1096:101:221::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.17; Wed, 15 Jan
 2025 02:56:22 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8356.010; Wed, 15 Jan 2025
 02:56:22 +0000
Message-ID: <e5055b4d-7a10-4a5e-ad85-d94c1f64eb03@amlogic.com>
Date: Wed, 15 Jan 2025 10:56:17 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
 <1jwmey9451.fsf@starbuckisacylon.baylibre.com>
 <e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
 <e69cd38e-898c-4cbc-a327-14148a71c764@amlogic.com>
 <1j8qrd7aor.fsf@starbuckisacylon.baylibre.com>
From: Jiebing Chen <jiebing.chen@amlogic.com>
In-Reply-To: <1j8qrd7aor.fsf@starbuckisacylon.baylibre.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: SG2PR06CA0187.apcprd06.prod.outlook.com (2603:1096:4:1::19)
 To PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|SEZPR03MB8444:EE_
X-MS-Office365-Filtering-Correlation-Id: 93f5e2ca-caf2-45d3-2b6d-08dd35103131
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?cm1MR2RYNmtmMk96NWRCQXB0dGJFanEzZk92Nm9teHRiSVBGcXZDOXBiZ3Bj?=
 =?utf-8?B?T1NXYVhrdytUNWNRN2VELzlOSFFSTnZ3T0RWWEtpOGp0UEQvS3JZR0h6eHgz?=
 =?utf-8?B?WWJIVE9kT3JlU01yWVhKMjUxUEdHSTdTU2E2aUdWS0FHd1VueCtJZkwzYVc3?=
 =?utf-8?B?RkVFSDlpTVVuZ0lLdFdqL2syRGNkWlVGR0E1NWNUZDJCdkVMR3NCOTRYSXIw?=
 =?utf-8?B?TERXS3dBe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FUYVVMNDR3ZlZNcnp4aXQxL0Q0Uzhlb2dSMTF2N1EzRHl3em5wOEtV?=
 =?utf-8?B?UncwcVE0VVU5UXFBYVBvbmRXTDJxcnVyUTh2VCtIekdWSDFqL0dDVXF1YWFX?=
 =?utf-8?B?bjBGc3l5dXBHUWl2eDYrVnJTdGplWHFaSi96UCsvRzBxcXhzSkUxVlBZWjRx?=
 =?utf-8?B?dXRDUnc3em9yNlYxRDVZSW03eDVVVzVYSSs2NXM0NUtlZUcxNTRVd3o5ZEQ0?=
 =?utf-8?B?ZUxWWDNlMUwvdHg0TFB1QWpaRG52NlZtUjlqa3h4ZHoraHdVbzVXMk9ybm03?=
 =?utf-8?B?WWkvdGIyV0JBc0plb1pxS0JWVE9UdFp0NllXb2tsVWtVK3BmdGcvY1hkVmt2?=
 =?utf-8?B?Q2RvWWRHR3RKUm4zZVBid01udEZ5WHB3cWp5Y3pKL2hPZjdmTUY0MDBiYURJ?=
 =?utf-8?B?dzBLSFFxQmVlZ1J2MEhGUlNKb09pTldQNEtOSjhiOE1Xa3l2VnZwVUw3dzhh?=
 =?utf-8?B?enJUWFdLNElOT1hmcldjQytvaExHZ05TcGFQdTdscVV0VW42UTJTeEErNndJ?=
 =?utf-8?B?MkE9PQ==?=
X-OriginatorOrg: amlogic.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 93f5e2ca-caf2-45d3-2b6d-08dd35103131
X-MS-Exchange-CrossTenant-AuthSource: PUZPR03MB7135.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 02:56:21.9410
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: qqgtBe/mXyhGH2k9x7SXH85Ggz80CoBdGQrx0SBd28MexWrnyoYqvWO6IJpnVIMTPXRZGy6tktXh3Mh7LDiIMJG8qtcdC9tHEFQyr9ZHPfE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR03MB8444


在 2025/1/14 22:05, Jerome Brunet 写道:
> [ EXTERNAL EMAIL ]
>
> On Tue 14 Jan 2025 at 19:20, Jiebing Chen <jiebing.chen@amlogic.com> wrote:
>
>>>>> +
>>>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>>>> +MODULE_LICENSE("GPL");
>>>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>>>> index
>>>>> 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648
>>>>> 100644
>>>>> --- a/sound/soc/meson/t9015.c
>>>>> +++ b/sound/soc/meson/t9015.c
>>>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
>>>>>                 .channels_min = 1,
>>>>>                 .channels_max = 2,
>>>>>                 .rates = SNDRV_PCM_RATE_8000_96000,
>>>>> -             .formats = (SNDRV_PCM_FMTBIT_S8 |
>>>>> -                         SNDRV_PCM_FMTBIT_S16_LE |
>>>>> -                         SNDRV_PCM_FMTBIT_S20_LE |
>>>>> -                         SNDRV_PCM_FMTBIT_S24_LE),
>>>>> +             .formats = (SNDRV_PCM_FMTBIT_S16_LE |
>>>>> SNDRV_PCM_FMTBIT_S32_LE),
>>>> Again, mixed up changes with zero justification.
>>>>
>>>> This drops S8 and S16 format support for the existing SoCs (such as GXL)
>>>> which is known to work and add S32 support on an HW documented as 24bits
>>>> only. Can you explain ?
>> for g12a, sm1 etc, it is use new audio ip, GXL is old ip,
> If there are chips difference we did not know about, then you should
> introduce those difference, without breaking existing support -
> including for GXL, which is what you did IIUC.
>
>> the new ip not support 24 bit,
> Are sure about that ? that code has been there for a while.
>
> If sm1 does not support SNDRV_PCM_FMTBIT_S24_LE, you should a fix up patch for
> that, with the proper "Fixes:" tag, how to reproduce the problem and
> explaining the fix.

maybe there are some gap , we support SNDRV_PCM_FMTBIT_S24, not support the

SNDRV_PCM_FMTBIT_S24_3LE,  for SNDRV_PCM_FMTBIT_S24

it is  Signed, 24-bit (32-bit in memory), little endian , the audio dma 
busrt is 64bit

it can get the full data. we send the 32 bit data  mclk = 32bit* 48k 
*4,  use the clk to send

the  SNDRV_PCM_FMTBIT_S24,   the hadware always send the 32bit data

so, i think we only add the SNDRV_PCM_FMTBIT_S32 base on it

we think the 24 bit is the SNDRV_PCM_FMTBIT_S24_3LE, it is 24bit in memroy,

due to the dma busrt 64 bit limit, it can't align the sample bit, if it 
is 24 bit

so the clock configure can't 24bit clock, by the way, We discuss 
internally for gxl,

it also support the SNDRV_PCM_FMTBIT_S32


>
>> usually support 16/32 bit for new audio ip , for SNDRV_PCM_FMTBIT_S24_LE,
>> it width =24, phy =32
> Yes physical of SNDRV_PCM_FMTBIT_S24_LE, so most chip supporting 32 bits
> width would support this S24_LE, unless there is something odd.
>
>> it was  treated as 32 bit to send for tdm, so we can only add the S32LE
>> base on it , right ?
> You are asking me ? How am I suppose to know ?
>
>> but if the gxl not support the 32bit
> I don't see a problem with a DAC taking input on 32bits physical
> interface and ignoring some bit on processing.
>
> If that's not the case, please send a proper fix change with some explanation
>
>> we need add new snd_soc_dai_driver t9015_dai_s4 ?
>>
> If I understood correctly format depends on the chip and needs to
> adjusted including for sm1.
>
>>>>>         },
>>>>>         .ops = &t9015_dai_ops,
>>>>>    };
>>>> -- Jerome
> --
> Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from SEYPR02CU001.outbound.protection.outlook.com (mail-koreacentralazon11023084.outbound.protection.outlook.com [40.107.44.84])
	(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 562CA4C98;
	Wed, 15 Jan 2025 03:38:11 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.44.84
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736912293; cv=fail; b=AUytxrzDLdZYU0MG/GndbXaLaOVAt4i2iEoI+GwSMqRBA4R2mYhtZAyYN4KkLfWOtVRpu0U7UG4AkeVagEkTErHrZf0ZyqjlpWeIOwVEJ5K2IoDWr+gPTtbX9kyBdCz87bl2o9y4EcscdoHTA0SnBs4437nKZrXubFv8eOFkogM=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736912293; c=relaxed/simple;
	bh=FtjJCzBCtTs8Xr2xVowUqCxHnT06y4ydcpIKhX2t0dI=;
	h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=B/ciCNNQKEib8aZLrJvk3ToSZ/+bS4mUDm5scZRI6xL02wExmBvzF79G5kxLu+ldibc0jbVdF26LPagD/VzLH0ERtWuxcUxbG/uc/RTP27PWESB/70sD3teX1QU3M9NGp2w7mp7+27IHJ2Abr6BERI3sKj8N4eYE16pYMagMmBI=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=jBpEwXKq; arc=fail smtp.client-ip=40.107.44.84
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="jBpEwXKq"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=DmKkGrWTM9EuQpyXqePElbr1UVizQCN05Bf4OqOxVxzZMuYOtUB4WUUMPLek8mGEdUGGlkrzvGQr9AubftNMNpem+TFNnENmX+kXJ+mG28Pu7ll6zF7UvRuy3DeZx1sLPV2M+sXitmWoca1zrzOrcvHguiPSTffAk0cX2h/7gDoqLQ7dcJX+lr0eP/Ruln9fAgg+d+IODEveAu7UW0QO8Oj2l/08EFfoccR8qlIJyF/HZIdJhl9I/VJrMtfBiSih47fiphknRh2l1spXdLhj4os4i0jTbIt3i/64Des6L6FnF0iUzLeYR8w9Pbc7bKMQq13gv3HG/RWxyJ3WR72NZg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LRCeVDpPJjrRvbNX7nI8MnQJjOO2BDRW59+681yfLzU=;
 b=ytu7gfb576vP6xnO1dTNC+AClkhdACrDgOuBlCuFOOkIzzYkCzflf209Ma/62zfgEmkzbwBTZgER3gkDHDQv9KzpeuGJYcGXBp2OPhDvGcN2VOnZhNzOddXOLiS4+CXqEcbnz14fwFeu5ThSEc+GkuJ4Tbo2GodS3gFy7OIZ5j13aCUurnT18FHCwM5I/8VI0yaRcfbGlvgIgRLA29ht8b/1FLFIWy+xekogBermH62IfxnNxT6FTMsjGp5ouIDclqt4TR7x7lhR+d659SfDbucvMmeXnb8g3H86cubyo5seFBl1PSqHFqUZnjrLV6i4ojQNzBCFM3M9jODBYRUCew==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LRCeVDpPJjrRvbNX7nI8MnQJjOO2BDRW59+681yfLzU=;
 b=jBpEwXKqlbVfAveivOJt+8Xoy41W4AHhOQoJNY3lBE06lNNkQZC0mVB85EG8sVSqTwAsj1kl6V8eyYvJ7Q44v/FFTUqJgtNX4oXpBjlzSv673RPoxxGSDTVdkpV8iU37C+abZpRxh3d/iCCDn7WZXp+gpmY+d9SrgA7VnAaLHd1l3BZYvxhnYfvq/b4vYyBJPlv53Dn+lj2VDiz+CQTmBbmKhhb/fMCmESYhMURumYc3k96NPId8JRIeuT7pkY2ealDrE+0R97VrdEx3WuUFrxwR+nEmGMD3Wp8edLZib1ctbl7o0Y98Csn15JFqYPRH96zzwlE0II/wBltsFAgL6g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by SEYPR03MB8180.apcprd03.prod.outlook.com (2603:1096:101:1aa::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Wed, 15 Jan
 2025 03:38:06 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8356.010; Wed, 15 Jan 2025
 03:38:05 +0000
Message-ID: <40aca60e-92e7-4344-8f7d-f62a61dd1898@amlogic.com>
Date: Wed, 15 Jan 2025 11:38:00 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
 <1jldve939f.fsf@starbuckisacylon.baylibre.com>
 <813e2564-8c4c-4adb-8184-ab88156e3e4c@amlogic.com>
 <1jmsft7ihz.fsf@starbuckisacylon.baylibre.com>
 <0e8b78c1-5c56-40e7-a2d8-41a7f49d52bc@amlogic.com>
 <1j34hl7a8b.fsf@starbuckisacylon.baylibre.com>
From: Jiebing Chen <jiebing.chen@amlogic.com>
In-Reply-To: <1j34hl7a8b.fsf@starbuckisacylon.baylibre.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: SGBP274CA0019.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::31)
 To PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|SEYPR03MB8180:EE_
X-MS-Office365-Filtering-Correlation-Id: 48cd82d3-7cb9-43cb-2b90-08dd3516052b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|1800799024;
X-Microso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L3FVcVpuUE1mUGdkRVJGTlhvUlorQjlaWkppN0J2QVNU?=
 =?utf-8?B?a1VOWm5vZTY3RklwVHVVVG5STHQrVU5BWUdJWEtsb25hWUUzV2hnY3pVSHFX?=
 =?utf-8?B?dHk0d0Y2ZHR2ZzZGejIzWmswVU5wdmduUDJRa1d6YzhHaCswdE9TUURndENs?=
 =?utf-8?Q?vkN7PopUuMp5J?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR03MB7135.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(1800799024);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OEFISGJBRjNzUmk2R1VLV1grS1ljQ3VYMy9ZTC8rRW9pT1dzT09vOGNQOUFG?=
 =?utf-8?B?d3VlclVCeGtEOFFXZERQNk54NTR0dktqRkN0cnBoNEVsN3J4U1k5NVFzWnJo?=
 =?utf-8?B?c1hsR2NrWS9EU0R0S0NldHFHdk5ERHNyRHFOYk1Tc3czSUlTN1dUSGludEN2?=
 =?utf-8?B?QWlEYkhtOWNLeUh4b0U1VmFLSk0xNXZIV05oeDNIV0tPdXBwVE1ENlUzUjlW?=
 =?utf-8?B?U24vSjVDYkM5bU1CT2I2blFML1YwZWM3bTlyMEFpc2pNRUJORjQxNFZybDJh?=
 =?utf-8?B?Q0libXdhdTdlWnpzSy9SeTZLcEQ2eXJONmxjVHoyaDdXZFRkMmR0Y1QybUMw?=
 =?utf-8?B?ZjVUR0pxUnZublNpL0RUUVlJUytqNXd0emtLd2dwWFZYWEJCNFhnQWxXMzZR?=
 =?utf-8?B?WExIOGV6ajJhVzdEenZvWFZXbFpONmxnUUJXd3BIRE5lemUwd0VsOE1kZE4z?=
 =?utf-8?B?V1Y1UWVnQ3BVMUptMFJlNld4SExvN0Rk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516052b
X-MS-Exchange-CrossTenant-AuthSource: PUZPR03MB7135.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 03:38:05.0607
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JUEz9cTaNuDV0veYX23Aj2P7sXeXjmvICtmbWu0g+FDFYBw6ftKYImXKGMgDW3dJXi2m0iZ5KeZUX9SgUN4wW8uLoZDVlU4JUluhvyefXzM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR03MB8180


在 2025/1/14 22:15, Jerome Brunet 写道:
> [ EXTERNAL EMAIL ]
>
> On Tue 14 Jan 2025 at 20:34, Jiebing Chen <jiebing.chen@amlogic.com> wrote:
>
>> 在 2025/1/14 19:16, Jerome Brunet 写道:
>>> [ EXTERNAL EMAIL ]
>>>
>>> On Tue 14 Jan 2025 at 16:52, Jiebing Chen <jiebing.chen@amlogic.com> wrote:
>>>
>>>> 在 2025/1/13 22:50, Jerome Brunet 写道:
>>>>> [ EXTERNAL EMAIL ]
>>>>>
>>>>> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:
>>>>>
>>>>>> From: jiebing chen <jiebing.chen@amlogic.com>
>>>>>>
>>>>>> Add basic audio driver support for the Amlogic S4 based Amlogic
>>>>>> AQ222 board.
>>>>>>
>>>>>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>>>>>> ---
>>>>>>     .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts     | 226 ++++++++++++
>>>>>>     arch/arm64/boot/dts/amlogic/meson-s4.dtsi          | 385 ++++++++++++++++++++-
>>>>>>     2 files changed, 610 insertions(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>> b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>> index 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c5528b43422b705b20130 100644
>>>>>> --- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>> @@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
>>>>>>                 regulator-always-on;
>>>>>>          };
>>>>>>
>>>>>> +     vcc5v_reg: regulator-vcc-5v {
>>>>>> +             compatible = "regulator-fixed";
>>>>>> +             vin-supply = <&main_12v>;
>>>>>> +             regulator-name = "VCC5V";
>>>>>> +             regulator-min-microvolt = <5000000>;
>>>>>> +             regulator-max-microvolt = <5000000>;
>>>>>> +             gpio = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
>>>>>> +             startup-delay-us = <7000>;
>>>>>> +             enable-active-high;
>>>>>> +             regulator-boot-on;
>>>>>> +             regulator-always-on;
>>>>>> +     };
>>>>>> +
>>>>>>          /* SY8120B1ABC DC/DC Regulator. */
>>>>>>          vddcpu: regulator-vddcpu {
>>>>>>                  compatible = "pwm-regulator";
>>>>>> @@ -129,6 +142,219 @@ vddcpu: regulator-vddcpu {
>>>>>>                                  <699000 98>,
>>>>>>                                  <689000 100>;
>>>>>>          };
>>>>>> +     dmics: audio-codec-1 {
>>>>>> +             compatible = "dmic-codec";
>>>>>> +             #sound-dai-cells = <0>;
>>>>>> +             num-channels = <2>;
>>>>>> +             wakeup-delay-ms = <50>;
>>>>>> +             sound-name-prefix = "MIC";
>>>>>> +     };
>>>>>> +
>>>>>> +     dioo2133: audio-amplifier-0 {
>>>>>> +             compatible = "simple-audio-amplifier";
>>>>>> +             enable-gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
>>>>>> +             VCC-supply = <&vcc5v_reg>;
>>>>>> +             #sound-dai-cells = <0>;
>>>>>> +             sound-name-prefix = "10U2";
>>>>>> +     };
>>>>>> +
>>>>>> +     spdif_dir: audio-spdif-in {
>>>>>> +             compatible = "linux,spdif-dir";
>>>>>> +             #sound-dai-cells = <0>;
>>>>>> +             sound-name-prefix = "DIR";
>>>>>> +     };
>>>>>> +
>>>>>> +     spdif_dit: audio-spdif-out {
>>>>>> +             compatible = "linux,spdif-dit";
>>>>>> +             #sound-dai-cells = <0>;
>>>>>> +             sound-name-prefix = "DIT";
>>>>>> +     };
>>>>>> +
>>>>>> +     sound {
>>>>>> +             compatible = "amlogic,axg-sound-card";
>>>>>> +             model = "aq222";
>>>>>> +             audio-widgets = "Line", "Lineout";
>>>>>> +             audio-aux-devs = <&tdmout_a>, <&tdmout_b>, <&tdmout_c>,
>>>>>> +                              <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
>>>>>> +                              <&tdmin_lb>, <&dioo2133>, <&tdmout_pad>, <&toacodec>;
>>>>>> +             audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
>>>>>> +                             "TDMOUT_A IN 1", "FRDDR_B OUT 0",
>>>>>> +                             "TDMOUT_A IN 2", "FRDDR_C OUT 0",
>>>>>> +                             "TDM_A Playback", "TDMOUT_A OUT",
>>>>>> +                             "TDMA_OUT SEL",   "TDM_A Playback",
>>>>>> +                             "TDMOUT_B IN 0", "FRDDR_A OUT 1",
>>>>>> +                             "TDMOUT_B IN 1", "FRDDR_B OUT 1",
>>>>>> +                             "TDMOUT_B IN 2", "FRDDR_C OUT 1",
>>>>>> +                             "TDM_B Playback", "TDMOUT_B OUT",
>>>>>> +                             "TDMB_OUT SEL",   "TDM_B Playback",
>>>>>> +                             "TDMOUT_C IN 0", "FRDDR_A OUT 2",
>>>>>> +                             "TDMOUT_C IN 1", "FRDDR_B OUT 2",
>>>>>> +                             "TDMOUT_C IN 2", "FRDDR_C OUT 2",
>>>>>> +                             "TDM_C Playback", "TDMOUT_C OUT",
>>>>>> +                             "TDMC_OUT SEL",   "TDM_C Playback",
>>>>>> +                             "TOACODEC TDMA", "TDM_A Playback",
>>>>>> +                             "TOACODEC TDMB", "TDM_B Playback",
>>>>>> +                             "TOACODEC TDMC", "TDM_C Playback",
>>>>>> +                             "SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
>>>>>> +                             "SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
>>>>>> +                             "SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
>>>>>> +                             "SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
>>>>>> +                             "SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
>>>>>> +                             "SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
>>>>>> +                             "TDMIN_A IN 0", "TDM_A Capture",
>>>>>> +                             "TDMIN_A IN 1", "TDM_B Capture",
>>>>>> +                             "TDMIN_A IN 2", "TDM_C Capture",
>>>>>> +                             "TDMIN_A IN 3", "TDM_A Loopback",
>>>>>> +                             "TDMIN_A IN 4", "TDM_B Loopback",
>>>>>> +                             "TDMIN_A IN 5", "TDM_C Loopback",
>>>>>> +                             "TDMIN_B IN 0", "TDM_A Capture",
>>>>>> +                             "TDMIN_B IN 1", "TDM_B Capture",
>>>>>> +                             "TDMIN_B IN 2", "TDM_C Capture",
>>>>>> +                             "TDMIN_B IN 3", "TDM_A Loopback",
>>>>>> +                             "TDMIN_B IN 4", "TDM_B Loopback",
>>>>>> +                             "TDMIN_B IN 5", "TDM_C Loopback",
>>>>>> +                             "TDMIN_C IN 0", "TDM_A Capture",
>>>>>> +                             "TDMIN_C IN 1", "TDM_B Capture",
>>>>>> +                             "TDMIN_C IN 2", "TDM_C Capture",
>>>>>> +                             "TDMIN_C IN 3", "TDM_A Loopback",
>>>>>> +                             "TDMIN_C IN 4", "TDM_B Loopback",
>>>>>> +                             "TDMIN_C IN 5", "TDM_C Loopback",
>>>>>> +                             "TDMIN_LB IN 3", "TDM_A Capture",
>>>>>> +                             "TDMIN_LB IN 4", "TDM_B Capture",
>>>>>> +                             "TDMIN_LB IN 5", "TDM_C Capture",
>>>>>> +                             "TDMIN_LB IN 0", "TDM_A Loopback",
>>>>>> +                             "TDMIN_LB IN 1", "TDM_B Loopback",
>>>>>> +                             "TDMIN_LB IN 2", "TDM_C Loopback",
>>>>>> +                             "TODDR_A IN 0", "TDMIN_A OUT",
>>>>>> +                             "TODDR_B IN 0", "TDMIN_A OUT",
>>>>>> +                             "TODDR_C IN 0", "TDMIN_A OUT",
>>>>>> +                             "TODDR_A IN 1", "TDMIN_B OUT",
>>>>>> +                             "TODDR_B IN 1", "TDMIN_B OUT",
>>>>>> +                             "TODDR_C IN 1", "TDMIN_B OUT",
>>>>>> +                             "TODDR_A IN 2", "TDMIN_C OUT",
>>>>>> +                             "TODDR_B IN 2", "TDMIN_C OUT",
>>>>>> +                             "TODDR_C IN 2", "TDMIN_C OUT",
>>>>>> +                             "TODDR_A IN 3", "SPDIFIN Capture",
>>>>>> +                             "TODDR_B IN 3", "SPDIFIN Capture",
>>>>>> +                             "TODDR_C IN 3", "SPDIFIN Capture",
>>>>>> +                             "TODDR_A IN 6", "TDMIN_LB OUT",
>>>>>> +                             "TODDR_B IN 6", "TDMIN_LB OUT",
>>>>>> +                             "TODDR_C IN 6", "TDMIN_LB OUT",
>>>>>> +                             "10U2 INL", "ACODEC LOLP",
>>>>>> +                             "10U2 INR", "ACODEC LORP",
>>>>>> +                             "Lineout", "10U2 OUTL",
>>>>>> +                             "Lineout", "10U2 OUTR";
>>>>>> +             assigned-clocks = <&clkc_pll CLKID_HIFI_PLL>,
>>>>>> +                               <&clkc_pll CLKID_MPLL2>,
>>>>>> +                               <&clkc_pll CLKID_MPLL0>,
>>>>>> +                               <&clkc_pll CLKID_MPLL1>;
>>>>>> +             assigned-clock-rates = <491520000>,
>>>>>> +                                    <294912000>,
>>>>>> +                                    <270950400>,
>>>>>> +                                    <393216000>;
>>>>> Why do you need 4 base rates ? Which rate family does each provide ?
>>>> hifipll 49152000, mpll2 294912000 mpll0 270950400, mpll1 393216000, the
>>>> accuracy of hifipll
>>>>
>>>> is relatively high, for tdm/pdm/spdif 16/48/96/192k we can use it. if the
>>>> tdm and spdif work on
>>> It is fine to use the HiFi. I'm glad this clock finally got fixed
>>>
>>>> the same time, for example ,tdm 48k. spdif 44.1k, we can't use the same
>>>> pll, so spdif need use the mpll 0
>>>>
>>>> other pll , only set a default value, at the latest chip, we remove all
>>>> mpll for hardware, only two hifipll
>>> I'm not sure you understand how this works.
>>> There is 3 families of audio rate: 48kHz, 44.1kHz and 32kHz
>>>
>>> Each family needs a PLL assigned, so you need 3, not 4, unless there is
>>> another specific rate family you want to support. If that's the case,
>>> document it.
>>>
>>> Setting the rate of the PLL should follow this principle:
>>> * Family rate
>>>     - multiplied by (32 x 24): to accomodate different sample sizes
>>>     - multiplied by 2 until you reach the maximum rate of selected PLLs
>>>       This allows to support rates such 192k or even 768k
>>>
>>> 491520000 is not dividable by 3, it won't allow 24 bits words. It is a
>>> poor choice.
>>>
>>> Have a look at the s400 for an example using the HiFi PLL. The axg was
>>> restricted to a 68 PLL multiplier but the S4 is not so you should be
>>> able to use a higher base rate (4 718 592 000 Hz), providing better
>>> accuracy in the end
>> for new soc audio ip, the hardware will not support the 24bit(include g12a,
>> sm1,axg)
> That may be what you chose to support in your BSP but that not how it
> works in mainline. 24bits slot width is supported and has been tested on
> axg, g12 and sm1. This is not going away.
>
> I would find extremely odd that 24 bits slot width is not supported on s4,
> but as long you document this, it is fine by me.

i understand your meaning, you sad we configure the slot width 24bit for 
tdmout control

if the format the SNDRV_PCM_FMTBIT_S24,  it send the 24bit data, for the 
format, and send the 24bit clock

if tdmout control can cut out [24:0] from the fddr, maybe your right, we 
can send the 24 bit accoring to the slot width

but it can't confirm by us, we are worried that there may be potential 
risks, so we don't use it thay way

so this why i sad can't support the 24bit slot clock, 16/32 sample bit 
is fully validated


>> SNDRV_PCM_FMTBIT_S24_3LE, 24 bit in memory
> I think you are mixing up slot width and memory representation
>

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2096.outbound.protection.outlook.com [40.107.255.96])
	(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 723C61E260C;
	Wed, 15 Jan 2025 06:16:35 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.96
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736921797; cv=fail; b=rGVgaqUrq6C53IgiQj2OhE3E7zdnJII4akmaqyd4cHofBJ8JDmkGh6tN4A3AMwXfHLZYKmaTyj9OXnFVl/kw+KKrShCEXeis73Jp9OCxejzVbf0Bwk4fAcA5p7KGHrPVAI1tOecVvjo1q1cLlgBvTI6hAL4ObQVoSMPEwm0oXIg=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736921797; c=relaxed/simple;
	bh=NtutUx2fwd312HqA5dNC2MHDzEMm/v6msPSuniw8yGs=;
	h=Message-ID:Date:Subject:From:To:Cc:References:In-Reply-To:
	 Content-Type:MIME-Version; b=OIJkuvrS5fMMhWfvdy3vwouqhJIPpU/RFcxrGRQxhUMnOapiB6qiohAxJ7J5S4E82yfR3f7ArRlH5R6b+eTJIa834qSgYDM5rsJ5WIJQ29dbRQ/j9kShDveS7FYGyRSIrjaoSukWSTMQmSLWY0lGemp0y94iOE1N+kSpYBW5rL0=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=eppMObiZ; arc=fail smtp.client-ip=40.107.255.96
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="eppMObiZ"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ulSh09mwBo0vWX2Wovbxo7nd3imJpXkTSnNo1xBfn9ea3+lWvtuwBsfVLZFtw5NemAzs2G5MZr8mQipstw1DSMf4SJccRMT3daiFh7VkJhru+Nz1s7xWcmHLAHzXXPIA8oSyg3rNO81u/lkKW3rJ21v0LxqYBt2ZQs/3A0FWHmfJ2O5g41s4AuULIKxDHRGk0M8xtRSieVEbkUVg7KpKAmRQosfSHT91RK/u7DKKxg9zZ9gUvdswdgwis3i9qVGy06opfk8NrTfdFCuEI4mtGpW4V65hn6N9qI2cMqd0zLhCCoAnKai/oAQGZ1kWHG3l8AShj0CCSITbcz709fYtTw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=C/eQva/DYi9PRBY+HSHYY3bekf0p6/YWGhrFDPczrZY=;
 b=GDgwJjixXnV1bmizvu0d74fy9M2CkQR/KOTQfTGN19mYvN10z+xD4p0fBlv+3DHhvFiyFFSZla338KiNfbp0y5yM41sLp6tA9cxx3kKE2eVcHhGgDwS3uTZFEVBYr6k7XBqyTPFz/9hf9pxpIHaU5lYkJrFX/LJgH/KcGrzAdnG8c8wlqGA+V5BpuEzhWkH6etV279je43crXmjfTqN/8BiREgnQZHNPQa656/WVnjtEEmqv5BC0rh47BIu3wkJ7HLlFwRIEV2DvpHSmIjwgpMjRLmgPvb/B6nXQ1pSmDRPQlU4MwRKTBCIbL/SpLHMAdLH9DtkdBsfgx7O50rd4VA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=C/eQva/DYi9PRBY+HSHYY3bekf0p6/YWGhrFDPczrZY=;
 b=eppMObiZyTdSqHhvO6Jp2O6xLJw3cWObPG2yzooNHEVsIV9jD9gTFKQXIleWHzwd0VOaTMcbFJSG7kE1H/P3JyJc71w/pZfjNBQ5iGAr3KErwHfDaSqOXhpjNSezp8WoauWHiYjOFNeXsVXXLiWm6aGCVm+tNW1YAngzGm5QEcqmd/oZtfWUjTjaRh+9EsO4a8k8bUaKRKrt0KXRP9NJYSJWQNy2Fo2vGdMucAX1cxdA9JlnZqefvJrYumM5KiMdqH610KemnBzBBWb4H8qApsE4cNLmrZBsqLQNJ1dPM9l9MhdF19ABpYFfmNzjd/ByBo/RWZnX+e3qNoR8Ob/d8g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by JH0PR03MB7934.apcprd03.prod.outlook.com (2603:1096:990:30::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Wed, 15 Jan
 2025 06:16:30 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8356.010; Wed, 15 Jan 2025
 06:16:30 +0000
Message-ID: <83a93dfc-2fcd-4166-98ed-e0491645f4e5@amlogic.com>
Date: Wed, 15 Jan 2025 14:16:27 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
From: Jiebing Chen <jiebing.chen@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
 <1jldve939f.fsf@starbuckisacylon.baylibre.com>
 <813e2564-8c4c-4adb-8184-ab88156e3e4c@amlogic.com>
 <1jmsft7ihz.fsf@starbuckisacylon.baylibre.com>
 <0e8b78c1-5c56-40e7-a2d8-41a7f49d52bc@amlogic.com>
 <1j34hl7a8b.fsf@starbuckisacylon.baylibre.com>
 <40aca60e-92e7-4344-8f7d-f62a61dd1898@amlogic.com>
In-Reply-To: <40aca60e-92e7-4344-8f7d-f62a61dd1898@amlogic.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: TYCPR01CA0031.jpnprd01.prod.outlook.com
 (2603:1096:405:1::19) To PUZPR03MB7135.apcprd03.prod.outlook.com
 (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|JH0PR03MB7934:EE_
X-MS-Office365-Filtering-Correlation-Id: 9ff1126c-d43d-4165-bf41-08dd352c26f3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?RkpGMEFHU0FqUXFPVjFuZmltdVo2RlpTdlg4OTVrbUd1cXJ2YzFkS3RQNVBJ?=
 =?utf-8?B?YmRCaW5CMzBuQkI2NHJmcXd5ek9wSUN0M2lWV0ZGenZ1M3I0MStZeU1MQjFj?=
 =?utf-8?B?MUxwUVZZUHgrVzVkdE1sQUdaT3BBSXJYUnBwUDBuOXZhb1FhMysrUnhzRWpO?=
 =?utf-8?B?OStiUThHbllxMUtkZ2NacGJoN2NCMkpNTFUxN1JZV1FjVFJyWnJIVGl3WCtx?=
 =?utf-8?B?TVpacXlLVW1sTW5CeEwrVmpKWDRVZnNWWitBMko0dzhsbGV5N2VlU0N6dDF2?=
 =?utf-8?B?NUg3d0Vha2Y4R0NCYm1aUlFiZ1h2S1F0VXJNMG1BOXlNK0twTFVTNmhzaUsz?=
 =?utf-8?B?UnlMNVpKVTR4VkQ4NERjSjVzZU1uWVo5b2gzc2FZaTREMkJnaVpTN0pQWDY3?=
 =?utf-8?B?RUJnR3BzNUF3S1V1L1QvOCtwcUFrMTZpLzBSajVWaWJ5NnVUUDVFZzZURXFH?=
 =?utf-8?B?SWlJOUZ1Y0pHb1Njd1RzRkxUbGZXd0VLaXdSNUs3QUJrSWd6ZmpoZklMZUtO?=
 =?utf-8?B?Ui9JeVZJSVhKR1hqSGJLUGRYUkZRL0gwcy9MM2hHNTVjcnBGOWIvaT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5L0ljdkRlWHlKOTMwMEg0bnZVREViN1ZCNmhLUjlzcFZZRmZSK1VPRFVT?=
 =?utf-8?B?WHppYmhKdTlUNWtDUGxteEdBTFlGTWNiR1RvekhnUmxOUE84aVd0TmJ4UFFX?=
 =?utf-8?B?UUlwbkttYjdaMVZSM1FLK0R4M3pIY1NYM0pTK3RiT1lhTkVCT2lVYjVjSmRH?=
 =?utf-8?B?THQ0S3dMN1BTYzRRT0dlMDFiKzROTk9rSEtCSmFhRkRHTFVpVWZoVjlmQkoy?=
 =?utf-8?B?M0JTT0F5Smh6MUpWbHBJb3ZoeFpYQkJXQlltV1FINEk1bTZEL1pJK0xYd1FX?=
 =?utf-8?B?a1VtOWZhTDJoRmZDd2RQYS9KY0drZWluRldFbktreVYzOHZHc2NiQXV1WDMy?=
 =?utf-8?B?WllPZGN3aTR0Q1pYSldxa0VYNkhoMEF1RitObnhZbFJQTzBpRDBvZnhRRHFs?=
 =?utf-8?Q?tVs9YsDaoiUkf?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR03MB7135.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(366016);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SUVRQ04wRlVsSnBjZmNqUHl4eHhXQlYzakVhT0VkQkdtem96YWJTclJqS09j?=
 =?utf-8?B?cERRb2hVMVRzK3JnRXp5TUNEcVZ4Z2plWXFwZHJWdUIwMHhoRStBaGowVCtq?=
 =?utf-8?B?T2pNdkpkdnJYWExnbVBDTm1kdzNwSDRsY1I4Yno3ZFlpV1FZNlREWkhuS3Rl?=
 =?utf-8?B?bWhMM1BoR0VkZDRIQlMyYnphMDRsa0N1ei9aOWxVTk40OWtqVFQ4KzdUN3Rz?=
 =?utf-8?B?cnBiNmxQ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SY3J6eHJTelQw?=
 =?utf-8?B?YWxsMW5rZTdlbGpPN1NiZFBKKzNadEQ5eS9MdW5JVlJVYTdvMSt6aU5EUGtH?=
 =?utf-8?B?bWdyenluckNScExGNlp0VmlacWY4eHdXd2ZyWXZ6QlBhbTZ2OGtzdWZYNVJX?=
 =?utf-8?B?TkEwU00rcmJDSTV0Qm90Z0lucE5WU0crVm00NmhLeHVyS0FXREh0eXJFNDMv?=
 =?utf-8?B?aGc9PQ==?=
X-OriginatorOrg: amlogic.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9ff1126c-d43d-4165-bf41-08dd352c26f3
X-MS-Exchange-CrossTenant-AuthSource: PUZPR03MB7135.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 06:16:30.6501
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: OmXYeV7b1Cd2e/CevTZbDOWO3cmGVvRO4sEaH747zu/KFOMBzsPrKHvjIorEaek/PAj3N7vU0ABS8K+/TfI6wi4FmMRfWq9+dGb1vMticIo=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR03MB7934


在 2025/1/15 11:38, Jiebing Chen 写道:
>
> 在 2025/1/14 22:15, Jerome Brunet 写道:
>> [ EXTERNAL EMAIL ]
>>
>> On Tue 14 Jan 2025 at 20:34, Jiebing Chen <jiebing.chen@amlogic.com> 
>> wrote:
>>
>>> 在 2025/1/14 19:16, Jerome Brunet 写道:
>>>> [ EXTERNAL EMAIL ]
>>>>
>>>> On Tue 14 Jan 2025 at 16:52, Jiebing Chen 
>>>> <jiebing.chen@amlogic.com> wrote:
>>>>
>>>>> 在 2025/1/13 22:50, Jerome Brunet 写道:
>>>>>> [ EXTERNAL EMAIL ]
>>>>>>
>>>>>> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay 
>>>>>> <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:
>>>>>>
>>>>>>> From: jiebing chen <jiebing.chen@amlogic.com>
>>>>>>>
>>>>>>> Add basic audio driver support for the Amlogic S4 based Amlogic
>>>>>>> AQ222 board.
>>>>>>>
>>>>>>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>>>>>>> ---
>>>>>>>     .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts | 226 
>>>>>>> ++++++++++++
>>>>>>>     arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 385 
>>>>>>> ++++++++++++++++++++-
>>>>>>>     2 files changed, 610 insertions(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>> b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>>> index 
>>>>>>> 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c5528b43422b705b20130 
>>>>>>> 100644
>>>>>>> --- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>>> @@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
>>>>>>>                 regulator-always-on;
>>>>>>>          };
>>>>>>>
>>>>>>> +     vcc5v_reg: regulator-vcc-5v {
>>>>>>> +             compatible = "regulator-fixed";
>>>>>>> +             vin-supply = <&main_12v>;
>>>>>>> +             regulator-name = "VCC5V";
>>>>>>> +             regulator-min-microvolt = <5000000>;
>>>>>>> +             regulator-max-microvolt = <5000000>;
>>>>>>> +             gpio = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
>>>>>>> +             startup-delay-us = <7000>;
>>>>>>> +             enable-active-high;
>>>>>>> +             regulator-boot-on;
>>>>>>> +             regulator-always-on;
>>>>>>> +     };
>>>>>>> +
>>>>>>>          /* SY8120B1ABC DC/DC Regulator. */
>>>>>>>          vddcpu: regulator-vddcpu {
>>>>>>>                  compatible = "pwm-regulator";
>>>>>>> @@ -129,6 +142,219 @@ vddcpu: regulator-vddcpu {
>>>>>>>                                  <699000 98>,
>>>>>>>                                  <689000 100>;
>>>>>>>          };
>>>>>>> +     dmics: audio-codec-1 {
>>>>>>> +             compatible = "dmic-codec";
>>>>>>> +             #sound-dai-cells = <0>;
>>>>>>> +             num-channels = <2>;
>>>>>>> +             wakeup-delay-ms = <50>;
>>>>>>> +             sound-name-prefix = "MIC";
>>>>>>> +     };
>>>>>>> +
>>>>>>> +     dioo2133: audio-amplifier-0 {
>>>>>>> +             compatible = "simple-audio-amplifier";
>>>>>>> +             enable-gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
>>>>>>> +             VCC-supply = <&vcc5v_reg>;
>>>>>>> +             #sound-dai-cells = <0>;
>>>>>>> +             sound-name-prefix = "10U2";
>>>>>>> +     };
>>>>>>> +
>>>>>>> +     spdif_dir: audio-spdif-in {
>>>>>>> +             compatible = "linux,spdif-dir";
>>>>>>> +             #sound-dai-cells = <0>;
>>>>>>> +             sound-name-prefix = "DIR";
>>>>>>> +     };
>>>>>>> +
>>>>>>> +     spdif_dit: audio-spdif-out {
>>>>>>> +             compatible = "linux,spdif-dit";
>>>>>>> +             #sound-dai-cells = <0>;
>>>>>>> +             sound-name-prefix = "DIT";
>>>>>>> +     };
>>>>>>> +
>>>>>>> +     sound {
>>>>>>> +             compatible = "amlogic,axg-sound-card";
>>>>>>> +             model = "aq222";
>>>>>>> +             audio-widgets = "Line", "Lineout";
>>>>>>> +             audio-aux-devs = <&tdmout_a>, <&tdmout_b>, 
>>>>>>> <&tdmout_c>,
>>>>>>> +                              <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
>>>>>>> +                              <&tdmin_lb>, <&dioo2133>, 
>>>>>>> <&tdmout_pad>, <&toacodec>;
>>>>>>> +             audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
>>>>>>> +                             "TDMOUT_A IN 1", "FRDDR_B OUT 0",
>>>>>>> +                             "TDMOUT_A IN 2", "FRDDR_C OUT 0",
>>>>>>> +                             "TDM_A Playback", "TDMOUT_A OUT",
>>>>>>> +                             "TDMA_OUT SEL",   "TDM_A Playback",
>>>>>>> +                             "TDMOUT_B IN 0", "FRDDR_A OUT 1",
>>>>>>> +                             "TDMOUT_B IN 1", "FRDDR_B OUT 1",
>>>>>>> +                             "TDMOUT_B IN 2", "FRDDR_C OUT 1",
>>>>>>> +                             "TDM_B Playback", "TDMOUT_B OUT",
>>>>>>> +                             "TDMB_OUT SEL",   "TDM_B Playback",
>>>>>>> +                             "TDMOUT_C IN 0", "FRDDR_A OUT 2",
>>>>>>> +                             "TDMOUT_C IN 1", "FRDDR_B OUT 2",
>>>>>>> +                             "TDMOUT_C IN 2", "FRDDR_C OUT 2",
>>>>>>> +                             "TDM_C Playback", "TDMOUT_C OUT",
>>>>>>> +                             "TDMC_OUT SEL",   "TDM_C Playback",
>>>>>>> +                             "TOACODEC TDMA", "TDM_A Playback",
>>>>>>> +                             "TOACODEC TDMB", "TDM_B Playback",
>>>>>>> +                             "TOACODEC TDMC", "TDM_C Playback",
>>>>>>> +                             "SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
>>>>>>> +                             "SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
>>>>>>> +                             "SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
>>>>>>> +                             "SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
>>>>>>> +                             "SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
>>>>>>> +                             "SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
>>>>>>> +                             "TDMIN_A IN 0", "TDM_A Capture",
>>>>>>> +                             "TDMIN_A IN 1", "TDM_B Capture",
>>>>>>> +                             "TDMIN_A IN 2", "TDM_C Capture",
>>>>>>> +                             "TDMIN_A IN 3", "TDM_A Loopback",
>>>>>>> +                             "TDMIN_A IN 4", "TDM_B Loopback",
>>>>>>> +                             "TDMIN_A IN 5", "TDM_C Loopback",
>>>>>>> +                             "TDMIN_B IN 0", "TDM_A Capture",
>>>>>>> +                             "TDMIN_B IN 1", "TDM_B Capture",
>>>>>>> +                             "TDMIN_B IN 2", "TDM_C Capture",
>>>>>>> +                             "TDMIN_B IN 3", "TDM_A Loopback",
>>>>>>> +                             "TDMIN_B IN 4", "TDM_B Loopback",
>>>>>>> +                             "TDMIN_B IN 5", "TDM_C Loopback",
>>>>>>> +                             "TDMIN_C IN 0", "TDM_A Capture",
>>>>>>> +                             "TDMIN_C IN 1", "TDM_B Capture",
>>>>>>> +                             "TDMIN_C IN 2", "TDM_C Capture",
>>>>>>> +                             "TDMIN_C IN 3", "TDM_A Loopback",
>>>>>>> +                             "TDMIN_C IN 4", "TDM_B Loopback",
>>>>>>> +                             "TDMIN_C IN 5", "TDM_C Loopback",
>>>>>>> +                             "TDMIN_LB IN 3", "TDM_A Capture",
>>>>>>> +                             "TDMIN_LB IN 4", "TDM_B Capture",
>>>>>>> +                             "TDMIN_LB IN 5", "TDM_C Capture",
>>>>>>> +                             "TDMIN_LB IN 0", "TDM_A Loopback",
>>>>>>> +                             "TDMIN_LB IN 1", "TDM_B Loopback",
>>>>>>> +                             "TDMIN_LB IN 2", "TDM_C Loopback",
>>>>>>> +                             "TODDR_A IN 0", "TDMIN_A OUT",
>>>>>>> +                             "TODDR_B IN 0", "TDMIN_A OUT",
>>>>>>> +                             "TODDR_C IN 0", "TDMIN_A OUT",
>>>>>>> +                             "TODDR_A IN 1", "TDMIN_B OUT",
>>>>>>> +                             "TODDR_B IN 1", "TDMIN_B OUT",
>>>>>>> +                             "TODDR_C IN 1", "TDMIN_B OUT",
>>>>>>> +                             "TODDR_A IN 2", "TDMIN_C OUT",
>>>>>>> +                             "TODDR_B IN 2", "TDMIN_C OUT",
>>>>>>> +                             "TODDR_C IN 2", "TDMIN_C OUT",
>>>>>>> +                             "TODDR_A IN 3", "SPDIFIN Capture",
>>>>>>> +                             "TODDR_B IN 3", "SPDIFIN Capture",
>>>>>>> +                             "TODDR_C IN 3", "SPDIFIN Capture",
>>>>>>> +                             "TODDR_A IN 6", "TDMIN_LB OUT",
>>>>>>> +                             "TODDR_B IN 6", "TDMIN_LB OUT",
>>>>>>> +                             "TODDR_C IN 6", "TDMIN_LB OUT",
>>>>>>> +                             "10U2 INL", "ACODEC LOLP",
>>>>>>> +                             "10U2 INR", "ACODEC LORP",
>>>>>>> +                             "Lineout", "10U2 OUTL",
>>>>>>> +                             "Lineout", "10U2 OUTR";
>>>>>>> +             assigned-clocks = <&clkc_pll CLKID_HIFI_PLL>,
>>>>>>> +                               <&clkc_pll CLKID_MPLL2>,
>>>>>>> +                               <&clkc_pll CLKID_MPLL0>,
>>>>>>> +                               <&clkc_pll CLKID_MPLL1>;
>>>>>>> +             assigned-clock-rates = <491520000>,
>>>>>>> + <294912000>,
>>>>>>> + <270950400>,
>>>>>>> + <393216000>;
>>>>>> Why do you need 4 base rates ? Which rate family does each provide ?
>>>>> hifipll 49152000, mpll2 294912000 mpll0 270950400, mpll1 
>>>>> 393216000, the
>>>>> accuracy of hifipll
>>>>>
>>>>> is relatively high, for tdm/pdm/spdif 16/48/96/192k we can use it. 
>>>>> if the
>>>>> tdm and spdif work on
>>>> It is fine to use the HiFi. I'm glad this clock finally got fixed
>>>>
>>>>> the same time, for example ,tdm 48k. spdif 44.1k, we can't use the 
>>>>> same
>>>>> pll, so spdif need use the mpll 0
>>>>>
>>>>> other pll , only set a default value, at the latest chip, we 
>>>>> remove all
>>>>> mpll for hardware, only two hifipll
>>>> I'm not sure you understand how this works.
>>>> There is 3 families of audio rate: 48kHz, 44.1kHz and 32kHz
>>>>
>>>> Each family needs a PLL assigned, so you need 3, not 4, unless 
>>>> there is
>>>> another specific rate family you want to support. If that's the case,
>>>> document it.
>>>>
>>>> Setting the rate of the PLL should follow this principle:
>>>> * Family rate
>>>>     - multiplied by (32 x 24): to accomodate different sample sizes
>>>>     - multiplied by 2 until you reach the maximum rate of selected 
>>>> PLLs
>>>>       This allows to support rates such 192k or even 768k
>>>>
>>>> 491520000 is not dividable by 3, it won't allow 24 bits words. It is a
>>>> poor choice.
>>>>
>>>> Have a look at the s400 for an example using the HiFi PLL. The axg was
>>>> restricted to a 68 PLL multiplier but the S4 is not so you should be
>>>> able to use a higher base rate (4 718 592 000 Hz), providing better
>>>> accuracy in the end
>>> for new soc audio ip, the hardware will not support the 
>>> 24bit(include g12a,
>>> sm1,axg)
>> That may be what you chose to support in your BSP but that not how it
>> works in mainline. 24bits slot width is supported and has been tested on
>> axg, g12 and sm1. This is not going away.
>>
>> I would find extremely odd that 24 bits slot width is not supported 
>> on s4,
>> but as long you document this, it is fine by me.
>
> i understand your meaning, you sad we configure the slot width 24bit 
> for tdmout control
>
> if the format the SNDRV_PCM_FMTBIT_S24,  it send the 24bit data, for 
> the format, and send the 24bit clock
>
> if tdmout control can cut out [24:0] from the fddr, maybe your right, 
> we can send the 24 bit accoring to the slot width
>
> but it can't confirm by us, we are worried that there may be potential 
> risks, so we don't use it thay way
>
> so this why i sad can't support the 24bit slot clock, 16/32 sample bit 
> is fully validated
>
>
i did some tests for the S24_LE format use the tdm base drvier

aplay -f S24_LE test.pcm -r48000 -c2

  # cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S24_LE
subformat: STD
channels: 2
rate: 48000 (48000/1)
period_size: 6000
buffer_size: 24000

we dump the mclk

aud_mst_a_mclk       2       2        0        12288000 0          0     
50000      Y audio-controller-0              mclk

according to the base driver

in the api axg_tdm_set_tdm_slots function
switch (slot_width) {
     case 0:
         slot_width = 32;
         fallthrough;
         ...

if dts not configure "dai-tdm-slot-width"

it use the 32 bit slot width

the api -> axg_tdm_iface_set_sclk

srate = iface->slots * iface->slot_width * params_rate(params);

set mclk rate

we dump tdmout control register

# devmem 0xfe330500
0xB001003F

it set 32bit slot width to send

the base driver is the smae behavior that we wound expect,


>>> SNDRV_PCM_FMTBIT_S24_3LE, 24 bit in memory
>> I think you are mixing up slot width and memory representation
>>

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45])
	(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 27C8223F286
	for <linux-kernel@vger.kernel.org>; Wed, 15 Jan 2025 08:36:33 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736930196; cv=none; b=LIT/VVGFv3KhUmTAuYiZ/Ylxfl02H/UNw0/bgIlJMLN0Rkj7Lee7iLNAb6XFPFeH+vw3vpDj5uHpqIyrTz92XgFFyZxGvgoxqAeJEqE4zPWkpJLIRLmbp61Ure1LllI8axRjxs0Ybov2wGSyjO5NTCr1C+v5ajAzgnNNv1ONkHI=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736930196; c=relaxed/simple;
	bh=N+rD8Fc501GUvq0ViLsHtr99/9fGf1D0Vy95kbI29SQ=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=NvrcSNd5zXfns8VoZoQzwKWZ782unoSUTEaUV3KtttmnQ02prwv+nqz8Jr5PDJf6ISTwwZl5zTGQq4dJ6UIZE23a6gcengVDESzZ3En+o/kiU8cKewOtKsrlVuC0M9IHtORb6lO8TMI/gwcjQLgJBP0NcepC8G00eXomnsIsoyE=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=BhZtAVae; arc=none smtp.client-ip=209.85.128.45
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="BhZtAVae"
Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-436a03197b2so45121335e9.2
        for <linux-kernel@vger.kernel.org>; Wed, 15 Jan 2025 00:36:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736930192; x=1737534992; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=lB3rHXjrUs5AJYYMIbdtSlreS8MQ74B9bY+rKil3MA8=;
        b=BhZtAVaeLeAhta1TJwovoWLrvHd6l9PH9FIJiikETLM4MZn6FgRo/Ci6jW2t0aMg7Y
         bTKJd82X7kglPydlRzmJfn43VnSZ05TIOp5P1/lzBAzmB0Cjv1t7+fBaRp0Bhj5Q4VLA
         g3sRrArQqM0fkF1jBN30LeHJAgvaVcJnOteE8z0F3U8SmN+FtQ2+OLqSPPAD4kTA+OC4
         /t/+70Ot6ICChSIeotWOqQHS7iTMH2bZ4YtvCPYZhEpamYyssTloDFqNlUs6jE8WKqgn
         TL+ROyFRaDBdiJOAGXwRxkC5NwqKFanU1CSc+jVlLPiG3SphQNYWUa0pdnOHwyyS/bMU
         0pjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1736930192; x=1737534992;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=lB3rHXjrUs5AJYYMIbdtSlreS8MQ74B9bY+rKil3MA8=;
        b=oSIuu3VuwDdTNXynrqFJgZadTfFy4roJfD/5JXzxwbZIpISk9Blm1ymD2CJdUP+6mC
         fzD50VwVSDDdctFv6TDdT4MslQoZzf96dPIdYYvaiC9j50P+yQyr+qg3gODJx/g7xxVb
         y0UP1Exz3W+XOL1elVbCaXGzMb4iQZ8hWOdU44COWvL17biaiZ+HWmD4uxlLA2cRGVwr
         u9toYEKTaMv6b54YLjhlvstLiM6i4pgE+p1MOqMLJXriU9QGHvcEzdg7q/uya4eg50Fv
         ookrOD+hVJYxb62ByY5Lnrkt9KbkO9MKG2tYxEL5b7QYgQwya95V83Ck1CLRPsym8fx7
         HcnQ==
X-Forwarded-Encrypted: i=1; AJvYcCXEc8pFzw+ZlyYS9NXIbBx2+MWaopQF25OVecl0rBrw2qInO1XcE5EpF/LsWby5vhQWnYD7h6K+ciLGU0c=@vger.kernel.org
X-Gm-Message-State: AOJu0YxJDF2keXYb+WBiaBZz0pJ2F/Crtxhu7iVFaTG0HCYb/eG7+yhY
	HPTboZqIrgVyIytfXWCNGda9pJTvZhrjg+myxjiGYCuZpOcgbp/cz5O6RP3BVmk=
X-Gm-Gg: ASbGncsNycBXV89bpTEgVr7s8QGQi1zBoIqI5vNTKkfPX3wnhA0Gzb9g9LMuQPbWMUj
	bPd6tv0diJHr83DEFcgybo8WsnBdAlG30jS+JYhocuQxsBD2Bbn+PSI7H9XDal3PW96uy0ldhMn
	Os7YuXqxy67zourrrUlYV6GgSmyo5Htus0HDl2ivDnbXR6PA533T9AMJw7esGmbJAevASsi0NtR
	/XMlS0affoxI3GnITVRwBf+1uRGROnwkkE4ueDjen3Ktc1LI8FeVtic
X-Google-Smtp-Source: AGHT+IGHLV3oniHk2tCYLxFndHHL9KG5RVtJRTDpiO1CMzyqcEywc4SzfBdAV2UjsP92dEf3xkAv9g==
X-Received: by 2002:a05:600c:3554:b0:436:1be4:c9b4 with SMTP id 5b1f17b1804b1-436e26ff1b2mr227264435e9.27.1736930192380;
        Wed, 15 Jan 2025 00:36:32 -0800 (PST)
Received: from localhost ([2a01:e0a:3c5:5fb1:e7b8:6186:fc23:f678])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37d447sm16644404f8f.4.2025.01.15.00.36.31
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 15 Jan 2025 00:36:31 -0800 (PST)
From: Jerome Brunet <jbrunet@baylibre.com>
To: Jiebing Chen <jiebing.chen@amlogic.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
  Liam Girdwood <lgirdwood@gmail.com>,  Mark Brown <broonie@kernel.org>,
  Rob Herring <robh@kernel.org>,  Krzysztof Kozlowski <krzk+dt@kernel.org>,
  Conor Dooley <conor+dt@kernel.org>,  Jaroslav Kysela <perex@perex.cz>,
  Takashi Iwai <tiwai@suse.com>,  Neil Armstrong
 <neil.armstrong@linaro.org>,  Kevin Hilman <khilman@baylibre.com>,  Martin
 Blumenstingl <martin.blumenstingl@googlemail.com>,
  linux-sound@vger.kernel.org,  devicetree@vger.kernel.org,
  linux-kernel@vger.kernel.org,  linux-arm-kernel@lists.infradead.org,
  linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
In-Reply-To: <e5055b4d-7a10-4a5e-ad85-d94c1f64eb03@amlogic.com> (Jiebing
	Chen's message of "Wed, 15 Jan 2025 10:56:17 +0800")
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
	<20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
	<1jwmey9451.fsf@starbuckisacylon.baylibre.com>
	<e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
	<e69cd38e-898c-4cbc-a327-14148a71c764@amlogic.com>
	<1j8qrd7aor.fsf@starbuckisacylon.baylibre.com>
	<e5055b4d-7a10-4a5e-ad85-d94c1f64eb03@amlogic.com>
User-Agent: mu4e 1.12.7; emacs 29.4
Date: Wed, 15 Jan 2025 09:36:31 +0100
Message-ID: <1jr0545v8w.fsf@starbuckisacylon.baylibre.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Wed 15 Jan 2025 at 10:56, Jiebing Chen <jiebing.chen@amlogic.com> wrote:

> =E5=9C=A8 2025/1/14 22:05, Jerome Brunet =E5=86=99=E9=81=93:
>> [ EXTERNAL EMAIL ]
>>
>> On Tue 14 Jan 2025 at 19:20, Jiebing Chen <jiebing.chen@amlogic.com> wro=
te:
>>
>>>>>> +
>>>>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>>>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>>>>> +MODULE_LICENSE("GPL");
>>>>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>>>>> index
>>>>>> 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d728205=
4e03d953586648
>>>>>> 100644
>>>>>> --- a/sound/soc/meson/t9015.c
>>>>>> +++ b/sound/soc/meson/t9015.c
>>>>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai =3D {
>>>>>>                 .channels_min =3D 1,
>>>>>>                 .channels_max =3D 2,
>>>>>>                 .rates =3D SNDRV_PCM_RATE_8000_96000,
>>>>>> -             .formats =3D (SNDRV_PCM_FMTBIT_S8 |
>>>>>> -                         SNDRV_PCM_FMTBIT_S16_LE |
>>>>>> -                         SNDRV_PCM_FMTBIT_S20_LE |
>>>>>> -                         SNDRV_PCM_FMTBIT_S24_LE),
>>>>>> +             .formats =3D (SNDRV_PCM_FMTBIT_S16_LE |
>>>>>> SNDRV_PCM_FMTBIT_S32_LE),
>>>>> Again, mixed up changes with zero justification.
>>>>>
>>>>> This drops S8 and S16 format support for the existing SoCs (such as G=
XL)
>>>>> which is known to work and add S32 support on an HW documented as 24b=
its
>>>>> only. Can you explain ?
>>> for g12a, sm1 etc, it is use new audio ip, GXL is old ip,
>> If there are chips difference we did not know about, then you should
>> introduce those difference, without breaking existing support -
>> including for GXL, which is what you did IIUC.
>>
>>> the new ip not support 24 bit,
>> Are sure about that ? that code has been there for a while.
>>
>> If sm1 does not support SNDRV_PCM_FMTBIT_S24_LE, you should a fix up pat=
ch for
>> that, with the proper "Fixes:" tag, how to reproduce the problem and
>> explaining the fix.
>
> maybe there are some gap , we support SNDRV_PCM_FMTBIT_S24, not support t=
he
>
> SNDRV_PCM_FMTBIT_S24_3LE,=C2=A0 for SNDRV_PCM_FMTBIT_S24
>
> it is=C2=A0 Signed, 24-bit (32-bit in memory), little endian , the audio =
dma
> busrt is 64bit

It makes absolutely no sense to discuss memory layout for the codec.

>
> it can get the full data. we send the 32 bit data=C2=A0 mclk =3D 32bit* 4=
8k *4,=C2=A0
> use the clk to send
>
> the=C2=A0 SNDRV_PCM_FMTBIT_S24,=C2=A0=C2=A0 the hadware always send the 3=
2bit data

No it does not. It send 24 bits of data over a 32 bits physical word with
8 bits ignored.

>
> so, i think we only add the SNDRV_PCM_FMTBIT_S32 base on it

That's wrong if the codec does not actually use the full 32bits ... and
I have clear indication that's what the codec is doing, on GXL at least.

>
> we think the 24 bit is the SNDRV_PCM_FMTBIT_S24_3LE, it is 24bit in memro=
y,
>
> due to the dma busrt 64 bit limit, it can't align the sample bit, if it is
> 24 bit

Again, memory layout makes no sense here.

>
> so the clock configure can't 24bit clock,

I disagree and this has been tested. If you have a test case showing
otherwise please share it.

> by the way, We discuss internally for gxl,
>
> it also support the SNDRV_PCM_FMTBIT_S32
>

Does it really ? If it is just to ignore the 8bits LSB, that not a support.

>
>>
>>> usually support 16/32 bit for new audio ip , for SNDRV_PCM_FMTBIT_S24_L=
E,
>>> it width =3D24, phy =3D32
>> Yes physical of SNDRV_PCM_FMTBIT_S24_LE, so most chip supporting 32 bits
>> width would support this S24_LE, unless there is something odd.
>>
>>> it was  treated as 32 bit to send for tdm, so we can only add the S32LE
>>> base on it , right ?
>> You are asking me ? How am I suppose to know ?
>>
>>> but if the gxl not support the 32bit
>> I don't see a problem with a DAC taking input on 32bits physical
>> interface and ignoring some bit on processing.
>>
>> If that's not the case, please send a proper fix change with some explan=
ation
>>
>>> we need add new snd_soc_dai_driver t9015_dai_s4 ?
>>>
>> If I understood correctly format depends on the chip and needs to
>> adjusted including for sm1.
>>
>>>>>>         },
>>>>>>         .ops =3D &t9015_dai_ops,
>>>>>>    };
>>>>> -- Jerome
>> --
>> Jerome

--=20
Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51])
	(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 3E6221DB12F
	for <linux-kernel@vger.kernel.org>; Wed, 15 Jan 2025 08:44:01 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736930645; cv=none; b=QOmv23j7x4OICECj/DaZ9vtvig2OJWEnFehr0DDcLp/OJMg+Izdny1CUhOnDWDc+Z8YQ/gLpeezyMkOxA6S4a7+3L3Mxl2hg0QTzMO2iBeXg3fSVq+MAbeEh482jMj3eCxfxoY7yZBaf+xZM6rN6pJRUvAL+j4Xxu7BVs27TIJo=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736930645; c=relaxed/simple;
	bh=Jlps63D8qXJTe4S2BPohPBcJySEcRf9igXcKjpPSYW8=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=NqdIpY/gmuoo5hUp4FbThpk328PJFk1t00v/ECeIbbAQRyILfj+5RJcyIqszExj4I7S5NDbYNJpTDk0TP/uP0o/8+ihcv89N6EvrDsz0EA4okVYp+nBYIgtCMvcKhw5JODm5BBHV8t1UWtJUSZY+re0iibn0vhLJAx9CrpN3DrM=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=V/iW1UdA; arc=none smtp.client-ip=209.85.221.51
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="V/iW1UdA"
Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3863494591bso3351441f8f.1
        for <linux-kernel@vger.kernel.org>; Wed, 15 Jan 2025 00:44:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736930639; x=1737535439; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Jlps63D8qXJTe4S2BPohPBcJySEcRf9igXcKjpPSYW8=;
        b=V/iW1UdApA2rjTJP3wkyrbDp5WJVYCTsti7LT13tp/1sQRaB67VyIrXPh5NruWw28v
         dO5DrrnZRuS0QvjkBpN4QqSHkJRTBz3Qv9l5hV+REoLyaIhhH7NftsMZOc4pLLsnV9NL
         9RyQKTboRlEnkP9RcgveWSGUxN0yPMX63hALqa9VTaT2jZ/kswwBQy+3KzHxaWXN7ImE
         OCKJtvgrO0+cUtIDoswDSut0gH+ZBymAGp+TRNhodb3aH5KcTuK2NU+ue7bgSyyCNf9O
         r3JcUb3Ef5MhSoC3FGYCRMPXWX0kHgYHvasgbvGVBkLnkG48NmYEL010cG+F5xejj0mF
         MqFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1736930639; x=1737535439;
        h=content-transfer-encoding:mime-version:message-id:date:user-agent
         :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=Jlps63D8qXJTe4S2BPohPBcJySEcRf9igXcKjpPSYW8=;
        b=BtmVh8TE4m7ho+yPRSLh/MY7rp5trBDaQlc5H9oSCSYNBu+L1BDSB8uLqk3ZVOazLE
         NAsTJAEXMuWbTE56BAMh0i/g0L9RUhTDVX8D5Fqb6m2i7I/7aEq5po4XQNIiGmAZI/k7
         whSp2Qi3ZA7sxBX3KLRAsnaZNK2qgIUpC/Purzim5nEiUPnzZj6HVBf6z1FvQdO7q/Ol
         puSyTnOsZ9MW5/ahDxklnoLHJPnafEqPOP4ZG1y/R8DuopowhpET04lVON5GIiVSLdUk
         JfojeLNNQwRjNYTff8ADuRjLO68xWwMD6mClmjzVHwTsFVR54vwXCHZZ0OHIvP5lzyy3
         07PA==
X-Forwarded-Encrypted: i=1; AJvYcCUrEWSWKCtTRTfhLHSMoOCWZXZE6P0O+ktlZQ4vQUCo7YJ9iAulhLyIVdaIX3DJg0EuNYNeZkNNtj2ZwWw=@vger.kernel.org
X-Gm-Message-State: AOJu0YwPUTiTh3burNNpETgcQf0zvrYUHzTJyyeGuIENiqX3vT+4WwmN
	Ke/F68wkxOS3y0a1SgCuQI+bcapA53XQjs18W4gcojJFd7BciZui//rqdCds6L4=
X-Gm-Gg: ASbGncsx/m969Qb986A0qcfyxNErTDIS58tbqPuUZtNHP8n3YXQkNTVDEaH3T7Dj2hl
	VBXB57a95BrBKueHkHf+eoyYn0bAml1EXzMfWIPS83PH8NFxfS0w/vldbpSCjUP0DXcXIBCDnXm
	YNVwF3x3lyJmGIQEkLHpPTLDfltOqme+kdagPsV21ee3fPFTMGTitYf4PQohZTle6zenA2j7eaH
	rgWHF2QJ8AxqQyKDHsHyGfT47Ey0qqSUNcPDi4esfXX4Kj4ErabEpQ+
X-Google-Smtp-Source: AGHT+IG2H+6y0eWpBBPqc/usYlYZ6/zW1u7ml5Q64EmeOJAugzknjFHHXxoi0D7iwJuJ/ZSqnQe5aA==
X-Received: by 2002:a5d:64cc:0:b0:386:366d:5d0b with SMTP id ffacd0b85a97d-38a8732098dmr23603545f8f.55.1736930639403;
        Wed, 15 Jan 2025 00:43:59 -0800 (PST)
Received: from localhost ([2a01:e0a:3c5:5fb1:e7b8:6186:fc23:f678])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38c76esm16696578f8f.47.2025.01.15.00.43.58
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 15 Jan 2025 00:43:58 -0800 (PST)
From: Jerome Brunet <jbrunet@baylibre.com>
To: Jiebing Chen <jiebing.chen@amlogic.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
  Liam Girdwood <lgirdwood@gmail.com>,  Mark Brown <broonie@kernel.org>,
  Rob Herring <robh@kernel.org>,  Krzysztof Kozlowski <krzk+dt@kernel.org>,
  Conor Dooley <conor+dt@kernel.org>,  Jaroslav Kysela <perex@perex.cz>,
  Takashi Iwai <tiwai@suse.com>,  Neil Armstrong
 <neil.armstrong@linaro.org>,  Kevin Hilman <khilman@baylibre.com>,  Martin
 Blumenstingl <martin.blumenstingl@googlemail.com>,
  linux-sound@vger.kernel.org,  devicetree@vger.kernel.org,
  linux-kernel@vger.kernel.org,  linux-arm-kernel@lists.infradead.org,
  linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
In-Reply-To: <83a93dfc-2fcd-4166-98ed-e0491645f4e5@amlogic.com> (Jiebing
	Chen's message of "Wed, 15 Jan 2025 14:16:27 +0800")
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
	<20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
	<1jldve939f.fsf@starbuckisacylon.baylibre.com>
	<813e2564-8c4c-4adb-8184-ab88156e3e4c@amlogic.com>
	<1jmsft7ihz.fsf@starbuckisacylon.baylibre.com>
	<0e8b78c1-5c56-40e7-a2d8-41a7f49d52bc@amlogic.com>
	<1j34hl7a8b.fsf@starbuckisacylon.baylibre.com>
	<40aca60e-92e7-4344-8f7d-f62a61dd1898@amlogic.com>
	<83a93dfc-2fcd-4166-98ed-e0491645f4e5@amlogic.com>
User-Agent: mu4e 1.12.7; emacs 29.4
Date: Wed, 15 Jan 2025 09:43:58 +0100
Message-ID: <1jldvc5uwh.fsf@starbuckisacylon.baylibre.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Wed 15 Jan 2025 at 14:16, Jiebing Chen <jiebing.chen@amlogic.com> wrote:

> =E5=9C=A8 2025/1/15 11:38, Jiebing Chen =E5=86=99=E9=81=93:
>>
>> =E5=9C=A8 2025/1/14 22:15, Jerome Brunet =E5=86=99=E9=81=93:
>>> [ EXTERNAL EMAIL ]
>>>
>>> On Tue 14 Jan 2025 at 20:34, Jiebing Chen <jiebing.chen@amlogic.com>
>>> wrote:
>>>
>>>> =E5=9C=A8 2025/1/14 19:16, Jerome Brunet =E5=86=99=E9=81=93:
>>>>> [ EXTERNAL EMAIL ]
>>>>>
>>>>> On Tue 14 Jan 2025 at 16:52, Jiebing Chen <jiebing.chen@amlogic.com>
>>>>> wrote:
>>>>>
>>>>>> =E5=9C=A8 2025/1/13 22:50, Jerome Brunet =E5=86=99=E9=81=93:
>>>>>>> [ EXTERNAL EMAIL ]
>>>>>>>
>>>>>>> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay
>>>>>>> <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:
>>>>>>>
>>>>>>>> From: jiebing chen <jiebing.chen@amlogic.com>
>>>>>>>>
>>>>>>>> Add basic audio driver support for the Amlogic S4 based Amlogic
>>>>>>>> AQ222 board.
>>>>>>>>
>>>>>>>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>>>>>>>> ---
>>>>>>>> =C2=A0=C2=A0=C2=A0 .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts =
| 226
>>>>>>>> ++++++++++++
>>>>>>>> =C2=A0=C2=A0=C2=A0 arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 385
>>>>>>>> ++++++++++++++++++++-
>>>>>>>> =C2=A0=C2=A0=C2=A0 2 files changed, 610 insertions(+), 1 deletion(=
-)
>>>>>>>>
>>>>>>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>> b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>>>> index
>>>>>>>> 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c5528=
b43422b705b20130
>>>>>>>> 100644
>>>>>>>> --- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>>>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>>>> @@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
>>>>>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 regulator-always-on;
>>>>>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 };
>>>>>>>>
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0 vcc5v_reg: regulator-vcc-5v {
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 compatible =3D "regulator-fixed";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 vin-supply =3D <&main_12v>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 regulator-name =3D "VCC5V";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 regulator-min-microvolt =3D <5000000>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 regulator-max-microvolt =3D <5000000>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 gpio =3D <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 startup-delay-us =3D <7000>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 enable-active-high;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A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C2=A0 dmics: audio-codec-1 {
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 compatible =3D "dmic-codec";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 #sound-dai-cells =3D <0>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 num-channels =3D <2>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 wakeup-delay-ms =3D <50>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 sound-name-prefix =3D "MIC";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0 };
>>>>>>>> +
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0 dioo2133: audio-amplifier-0 {
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 compatible =3D "simple-audio-amplifier";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 enable-gpios =3D <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 VCC-supply =3D <&vcc5v_reg>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 #sound-dai-cells =3D <0>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 sound-name-prefix =3D "10U2";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0 };
>>>>>>>> +
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0 spdif_dir: audio-spdif-in {
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 compatible =3D "linux,spdif-dir";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 #sound-dai-cells =3D <0>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 sound-name-prefix =3D "DIR";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0 };
>>>>>>>> +
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0 spdif_dit: audio-spdif-out {
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 compatible =3D "linux,spdif-dit";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 #sound-dai-cells =3D <0>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 sound-name-prefix =3D "DIT";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0 };
>>>>>>>> +
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0 sound {
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 compatible =3D "amlogic,axg-sound-card";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 model =3D "aq222";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 audio-widgets =3D "Line", "Lineout";
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 audio-aux-devs =3D <&tdmout_a>, <&tdmout_b>,
>>>>>>>> <&tdmout_c>,
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <&tdmin_lb>, <&dioo2133>,
>>>>>>>> <&tdmout_pad>, <&toacodec>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 audio-routing =3D "TDMOUT_A IN 0", "FRDDR_A OUT 0",
>>>>>>>> +=C2=A0=C2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2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <&clkc_pll CLKID_MPLL1>;
>>>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 assigned-clock-rates =3D <491520000>,
>>>>>>>> + <294912000>,
>>>>>>>> + <270950400>,
>>>>>>>> + <393216000>;
>>>>>>> Why do you need 4 base rates ? Which rate family does each provide ?
>>>>>> hifipll 49152000, mpll2 294912000 mpll0 270950400, mpll1 393216000,
>>>>>> the
>>>>>> accuracy of hifipll
>>>>>>
>>>>>> is relatively high, for tdm/pdm/spdif 16/48/96/192k we can use it. if
>>>>>> the
>>>>>> tdm and spdif work on
>>>>> It is fine to use the HiFi. I'm glad this clock finally got fixed
>>>>>
>>>>>> the same time, for example ,tdm 48k. spdif 44.1k, we can't use the
>>>>>> same
>>>>>> pll, so spdif need use the mpll 0
>>>>>>
>>>>>> other pll , only set a default value, at the latest chip, we remove
>>>>>> all
>>>>>> mpll for hardware, only two hifipll
>>>>> I'm not sure you understand how this works.
>>>>> There is 3 families of audio rate: 48kHz, 44.1kHz and 32kHz
>>>>>
>>>>> Each family needs a PLL assigned, so you need 3, not 4, unless there
>>>>> is
>>>>> another specific rate family you want to support. If that's the case,
>>>>> document it.
>>>>>
>>>>> Setting the rate of the PLL should follow this principle:
>>>>> * Family rate
>>>>> =C2=A0=C2=A0=C2=A0 - multiplied by (32 x 24): to accomodate different=
 sample sizes
>>>>> =C2=A0=C2=A0=C2=A0 - multiplied by 2 until you reach the maximum rate=
 of selected
>>>>> PLLs
>>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 This allows to support rates such 192k=
 or even 768k
>>>>>
>>>>> 491520000 is not dividable by 3, it won't allow 24 bits words. It is a
>>>>> poor choice.
>>>>>
>>>>> Have a look at the s400 for an example using the HiFi PLL. The axg was
>>>>> restricted to a 68 PLL multiplier but the S4 is not so you should be
>>>>> able to use a higher base rate (4 718 592 000 Hz), providing better
>>>>> accuracy in the end
>>>> for new soc audio ip, the hardware will not support the 24bit(include
>>>> g12a,
>>>> sm1,axg)
>>> That may be what you chose to support in your BSP but that not how it
>>> works in mainline. 24bits slot width is supported and has been tested on
>>> axg, g12 and sm1. This is not going away.
>>>
>>> I would find extremely odd that 24 bits slot width is not supported on
>>> s4,
>>> but as long you document this, it is fine by me.
>>
>> i understand your meaning, you sad we configure the slot width 24bit for
>> tdmout control
>>
>> if the format the SNDRV_PCM_FMTBIT_S24,=C2=A0 it send the 24bit data, fo=
r the
>> format, and send the 24bit clock
>>
>> if tdmout control can cut out [24:0] from the fddr, maybe your right, we
>> can send the 24 bit accoring to the slot width
>>
>> but it can't confirm by us,=C2=A0we are worried that there may be potent=
ial
>> risks, so we don't use it thay way
>>
>> so this why i sad can't support the 24bit slot clock, 16/32 sample bit is
>> fully validated
>>
>>
> i did some tests for the S24_LE format use the tdm base drvier
>
> aplay -f S24_LE test.pcm -r48000 -c2
>
> =C2=A0# cat /proc/asound/card0/pcm0p/sub0/hw_params
> access: RW_INTERLEAVED
> format: S24_LE
> subformat: STD
> channels: 2
> rate: 48000 (48000/1)
> period_size: 6000
> buffer_size: 24000
>
> we dump the mclk
>
> aud_mst_a_mclk=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 2=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 12288000 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 0=C2=A0=C2=A0=C2=A0=C2=A0
> 50000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Y audio-controller-0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mclk
>
> according to the base driver
>
> in the api axg_tdm_set_tdm_slots function
> switch (slot_width) {
> =C2=A0=C2=A0=C2=A0 case 0:
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 slot_width =3D 32;

32 bits is the default slot width if none is specified, yes. So ?

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fallthrough;
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...
>
> if dts not configure "dai-tdm-slot-width"
>
> it use the 32 bit slot width
>
> the api -> axg_tdm_iface_set_sclk
>
> srate =3D iface->slots * iface->slot_width * params_rate(params);
>
> set mclk rate
>
> we dump tdmout control register
>
> # devmem 0xfe330500
> 0xB001003F
>
> it set 32bit slot width to send
>
> the base driver is the smae behavior that we wound expect,

The driver set a slot width of 32 bits because you did choose any and
then behave as it should.

I don't get your point here or what such test is supposed to show.

You did not test 24bits slot width at all.

>
>
>>>> SNDRV_PCM_FMTBIT_S24_3LE, 24 bit in memory
>>> I think you are mixing up slot width and memory representation
>>>

--=20
Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from SEYPR02CU001.outbound.protection.outlook.com (mail-koreacentralazon11023077.outbound.protection.outlook.com [40.107.44.77])
	(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 49AEF22F3AF;
	Wed, 15 Jan 2025 09:57:03 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.44.77
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736935026; cv=fail; b=eZAaeul6HA2LIb5v5JJ7rD+h2A6g8ZjhOSIKOGwwIsG79eGhvhNaJkPGcxHEXYdFaJAh9LZb6EGF3oCbtR0HOVRd9c5v3HcCvsLWgbXdEik/Y3rpH/Baj0iBkAmDp0c7XtIgACyIoV6CFdLX2LcYuF++EiwgVFtMgkgfOZSlXHw=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736935026; c=relaxed/simple;
	bh=Z08OlI2c0u9dMp4s6qXnwT7JyODE5HZSA1CKKJzYrac=;
	h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=WTwLS77PB9fNFicjB/UruEAJg99cyn/SWBav9rQ1A7EwL9/geIdqUcGdrPwrnWv2g7PdWihPj+Tx8VUWvasc7M6IVpgypdPHLht8M4ue78daT2iw3z7snznaHKjBq/i8IiSr1WpurFUOG13JKymRIaVN2AcwAuwEPZuzBrxkLbs=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=OlhJ9ERT; arc=fail smtp.client-ip=40.107.44.77
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="OlhJ9ERT"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=jaGS0KOba4aIz2BJy+phs6qmUGlgbBY9HynqVkFL2M+SJOgAFSAr7wp8Kb5FG8Sej2FNHwE7PNUIvqQYPRArjk0agd9IHZhkqWyGvkQeIEO2uz+CATIqRKX5gP7dwALddEILEXV5cMs7E97okJOBZGKlsT6j3LPI66hI0CSQ9ajX4VPYTDYALktNENG7DqTtYSAe/iTp9W9ytI06IfLEPPkz91unuorZsisvLNcRk9yrwSErPHdBiKmMsSPOejfMX3eOmbA8Ohb+NsEzIawuZ1PHdg0Zd1CIueauvnuB2xXv3dfCLKz4R1mWlDcR0FELyDCEs+vUvE308e30lZaNtg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iEcS5THoSC8QPG0F4vSstZ5G0V8fYnnTgZOzDeqFLJg=;
 b=hG0hHzDAtNZd+FhcNwf3kjzAGO4e0n6g5p7E7Jlu/H7aqiSKfoTh3QSfFJ8pe6BBuAzsuBIxzq7XZeQt9HSIxaCc0vZBqO8XjIaerjX6CPTPYd59G5tfLTW1wpWwFtkfxp2XokHLRk82jNMQuupg/1wiN4q4luJFhhTrP8eRhISLjAtAyzGYU7DLV4CUusqxtuFj2AmfPGBHi+EpfqDhVsSMfZ7/o2l23ZPlQZEwF/bo2nBYlk7lmhZZPXKo5Ajdyfy3zO0p9PVT+d17Zyn7r5EHs+EuI+NQ9SVASTJoz8BVjLQHqfqiImHur9LIrSpsdwCNFXkXkNcfIEpR4mpJ/w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iEcS5THoSC8QPG0F4vSstZ5G0V8fYnnTgZOzDeqFLJg=;
 b=OlhJ9ERTmnLNdyGLSG0OjwEqhaw18GyuLNXjuT4gaUqGqsRzpp9zrc3Cmj1/yOQ1vp9lFVsk8VkABWZJGd6eISCHCNhgscd4UxeioBktSQl75V0byIqAvxwKv0o9eGhuuwEwGJ2SlYvmdVj2JZK8mlM/ntNEY8EbjDuG6DTgujjZsEIJUkYmsrsJ1em5ouU7vZgkt8+FCL3sM3TswHeJY5KB9+UYzQAgSzXmPGU918BzDjek4NTb0fP6Nx4N1pmMcmZagLdKVAmDCN7F2y3Og2P+XKNC4dauy3h/jgSpTOji74fOlRIeLDDV1uVMwwPwU9IYNYGmlCdmNoujH6iKrg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by KL1PR03MB8195.apcprd03.prod.outlook.com (2603:1096:820:111::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Wed, 15 Jan
 2025 09:56:58 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8356.010; Wed, 15 Jan 2025
 09:56:58 +0000
Message-ID: <550e0461-b564-496c-8fa9-78b2cbe9ba71@amlogic.com>
Date: Wed, 15 Jan 2025 17:56:54 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] arm64: dts: amlogic: Add Amlogic S4 Audio
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-3-8c14770f38a0@amlogic.com>
 <1jldve939f.fsf@starbuckisacylon.baylibre.com>
 <813e2564-8c4c-4adb-8184-ab88156e3e4c@amlogic.com>
 <1jmsft7ihz.fsf@starbuckisacylon.baylibre.com>
 <0e8b78c1-5c56-40e7-a2d8-41a7f49d52bc@amlogic.com>
 <1j34hl7a8b.fsf@starbuckisacylon.baylibre.com>
 <40aca60e-92e7-4344-8f7d-f62a61dd1898@amlogic.com>
 <83a93dfc-2fcd-4166-98ed-e0491645f4e5@amlogic.com>
 <1jldvc5uwh.fsf@starbuckisacylon.baylibre.com>
From: Jiebing Chen <jiebing.chen@amlogic.com>
In-Reply-To: <1jldvc5uwh.fsf@starbuckisacylon.baylibre.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: SI2PR02CA0043.apcprd02.prod.outlook.com
 (2603:1096:4:196::12) To PUZPR03MB7135.apcprd03.prod.outlook.com
 (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|KL1PR03MB8195:EE_
X-MS-Office365-Filtering-Correlation-Id: 2276da6f-8eb4-4496-7a5d-08dd354af335
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?NWF1RGZS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-8?B?Ym4xWkZJc2VHRnE3eEtkMm9pQk1pNTZoZkZXUkRobUNiSFZSMXo5aFllRHM4?=
 =?utf-8?B?T1RpSzI0ZkxITmJHRmhabCt1cTRLQW9JRkRvRDEvbm80clNSRWszZUFSaVBq?=
 =?utf-8?Q?zpmdVi31xB4+k?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR03MB7135.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(366016);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cmlENXZRZWs3NzlXUzZneEhIMVFHY096dWdCRURpNjYvdWZ0ektQTklxb1Uz?=
 =?utf-8?B?MHFWTnNZaDVqTjlKYUNmVXZBM1FiNzNWbmdiQ01XU0xQelo1ZHFjN05Nek53?=
 =?utf-8?B?RXZlYmw2eEFVQVRHeGRqNk5BTSs3R0VCOHlkQi92NlVsYVN5emN5VUFHempq?=
 =?utf-8?B?YzJxMlIwd0s3RERwQit3VWdGeUwvOUNWY2UySE05WEJON08wTGJzazhFajJ3?=
 =?utf-8?B?Q2lIUnB2YlNpN0ZNcjQvWDRqVDZKenpuTlFtVWhnNWZuSnI3YWgxOUVlYW8r?=
 =?utf-8?B?NGNEcVpnSHBnK0dTalBmdnczNzJnZnljYVg4WVFaQUdIeDFIR3VHeWFYc3NX?=
 =?utf-8?B?b0gzNlpXWjgveVpJZnpOWmlYRE4rL1JqbVp6dGJZcXE2SUhIUzM4VStoSVJt?=
 =?utf-8?B?dnREbVd6RU9xdnkwdHgxUWRUNnFhc2lQMElKMWsyVHQycy8rK2xTM3Q3Ky9z?=
 =?utf-8?B?UnpHTEJuMS9VRHl5OHZ3V1VoRUY2UWxBUE9uN2h6b1VmQWE2dDU1TGtaTzZM?=
 =?utf-8?B?TUNxWU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.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 09:56:58.2822
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: BpbKwsRKKwK4y83RX83n5kObvEmSCGf/Pzwsd+sDGlphCnYb5Vlp8VSh+cUAKSNQUfIP2gs9qhRBakkRTp/bEyDGeHjPh/xmFajFLG5vvSI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR03MB8195


在 2025/1/15 16:43, Jerome Brunet 写道:
> [ EXTERNAL EMAIL ]
>
> On Wed 15 Jan 2025 at 14:16, Jiebing Chen <jiebing.chen@amlogic.com> wrote:
>
>> 在 2025/1/15 11:38, Jiebing Chen 写道:
>>> 在 2025/1/14 22:15, Jerome Brunet 写道:
>>>> [ EXTERNAL EMAIL ]
>>>>
>>>> On Tue 14 Jan 2025 at 20:34, Jiebing Chen <jiebing.chen@amlogic.com>
>>>> wrote:
>>>>
>>>>> 在 2025/1/14 19:16, Jerome Brunet 写道:
>>>>>> [ EXTERNAL EMAIL ]
>>>>>>
>>>>>> On Tue 14 Jan 2025 at 16:52, Jiebing Chen <jiebing.chen@amlogic.com>
>>>>>> wrote:
>>>>>>
>>>>>>> 在 2025/1/13 22:50, Jerome Brunet 写道:
>>>>>>>> [ EXTERNAL EMAIL ]
>>>>>>>>
>>>>>>>> On Mon 13 Jan 2025 at 14:35, jiebing chen via B4 Relay
>>>>>>>> <devnull+jiebing.chen.amlogic.com@kernel.org> wrote:
>>>>>>>>
>>>>>>>>> From: jiebing chen <jiebing.chen@amlogic.com>
>>>>>>>>>
>>>>>>>>> Add basic audio driver support for the Amlogic S4 based Amlogic
>>>>>>>>> AQ222 board.
>>>>>>>>>
>>>>>>>>> Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
>>>>>>>>> ---
>>>>>>>>>      .../boot/dts/amlogic/meson-s4-s805x2-aq222.dts | 226
>>>>>>>>> ++++++++++++
>>>>>>>>>      arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 385
>>>>>>>>> ++++++++++++++++++++-
>>>>>>>>>      2 files changed, 610 insertions(+), 1 deletion(-)
>>>>>>>>>
>>>>>>>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>> b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>>>>> index
>>>>>>>>> 6730c44642d2910d42ec0c4adf49fefc3514dbec..32f50a5b860435d50d9c5528b43422b705b20130
>>>>>>>>> 100644
>>>>>>>>> --- a/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>>>>> +++ b/arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts
>>>>>>>>> @@ -75,6 +75,19 @@ vddio_ao1v8: regulator-vddio-ao1v8 {
>>>>>>>>>                  regulator-always-on;
>>>>>>>>>           };
>>>>>>>>>
>>>>>>>>> +     vcc5v_reg: regulator-vcc-5v {
>>>>>>>>> +             compatible = "regulator-fixed";
>>>>>>>>> +             vin-supply = <&main_12v>;
>>>>>>>>> +             regulator-name = "VCC5V";
>>>>>>>>> +             regulator-min-microvolt = <5000000>;
>>>>>>>>> +             regulator-max-microvolt = <5000000>;
>>>>>>>>> +             gpio = <&gpio GPIOH_7 GPIO_ACTIVE_HIGH>;
>>>>>>>>> +             startup-delay-us = <7000>;
>>>>>>>>> +             enable-active-high;
>>>>>>>>> +             regulator-boot-on;
>>>>>>>>> +             regulator-always-on;
>>>>>>>>> +     };
>>>>>>>>> +
>>>>>>>>>           /* SY8120B1ABC DC/DC Regulator. */
>>>>>>>>>           vddcpu: regulator-vddcpu {
>>>>>>>>>                   compatible = "pwm-regulator";
>>>>>>>>> @@ -129,6 +142,219 @@ vddcpu: regulator-vddcpu {
>>>>>>>>>                                   <699000 98>,
>>>>>>>>>                                   <689000 100>;
>>>>>>>>>           };
>>>>>>>>> +     dmics: audio-codec-1 {
>>>>>>>>> +             compatible = "dmic-codec";
>>>>>>>>> +             #sound-dai-cells = <0>;
>>>>>>>>> +             num-channels = <2>;
>>>>>>>>> +             wakeup-delay-ms = <50>;
>>>>>>>>> +             sound-name-prefix = "MIC";
>>>>>>>>> +     };
>>>>>>>>> +
>>>>>>>>> +     dioo2133: audio-amplifier-0 {
>>>>>>>>> +             compatible = "simple-audio-amplifier";
>>>>>>>>> +             enable-gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
>>>>>>>>> +             VCC-supply = <&vcc5v_reg>;
>>>>>>>>> +             #sound-dai-cells = <0>;
>>>>>>>>> +             sound-name-prefix = "10U2";
>>>>>>>>> +     };
>>>>>>>>> +
>>>>>>>>> +     spdif_dir: audio-spdif-in {
>>>>>>>>> +             compatible = "linux,spdif-dir";
>>>>>>>>> +             #sound-dai-cells = <0>;
>>>>>>>>> +             sound-name-prefix = "DIR";
>>>>>>>>> +     };
>>>>>>>>> +
>>>>>>>>> +     spdif_dit: audio-spdif-out {
>>>>>>>>> +             compatible = "linux,spdif-dit";
>>>>>>>>> +             #sound-dai-cells = <0>;
>>>>>>>>> +             sound-name-prefix = "DIT";
>>>>>>>>> +     };
>>>>>>>>> +
>>>>>>>>> +     sound {
>>>>>>>>> +             compatible = "amlogic,axg-sound-card";
>>>>>>>>> +             model = "aq222";
>>>>>>>>> +             audio-widgets = "Line", "Lineout";
>>>>>>>>> +             audio-aux-devs = <&tdmout_a>, <&tdmout_b>,
>>>>>>>>> <&tdmout_c>,
>>>>>>>>> +                              <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
>>>>>>>>> +                              <&tdmin_lb>, <&dioo2133>,
>>>>>>>>> <&tdmout_pad>, <&toacodec>;
>>>>>>>>> +             audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
>>>>>>>>> +                             "TDMOUT_A IN 1", "FRDDR_B OUT 0",
>>>>>>>>> +                             "TDMOUT_A IN 2", "FRDDR_C OUT 0",
>>>>>>>>> +                             "TDM_A Playback", "TDMOUT_A OUT",
>>>>>>>>> +                             "TDMA_OUT SEL",   "TDM_A Playback",
>>>>>>>>> +                             "TDMOUT_B IN 0", "FRDDR_A OUT 1",
>>>>>>>>> +                             "TDMOUT_B IN 1", "FRDDR_B OUT 1",
>>>>>>>>> +                             "TDMOUT_B IN 2", "FRDDR_C OUT 1",
>>>>>>>>> +                             "TDM_B Playback", "TDMOUT_B OUT",
>>>>>>>>> +                             "TDMB_OUT SEL",   "TDM_B Playback",
>>>>>>>>> +                             "TDMOUT_C IN 0", "FRDDR_A OUT 2",
>>>>>>>>> +                             "TDMOUT_C IN 1", "FRDDR_B OUT 2",
>>>>>>>>> +                             "TDMOUT_C IN 2", "FRDDR_C OUT 2",
>>>>>>>>> +                             "TDM_C Playback", "TDMOUT_C OUT",
>>>>>>>>> +                             "TDMC_OUT SEL",   "TDM_C Playback",
>>>>>>>>> +                             "TOACODEC TDMA", "TDM_A Playback",
>>>>>>>>> +                             "TOACODEC TDMB", "TDM_B Playback",
>>>>>>>>> +                             "TOACODEC TDMC", "TDM_C Playback",
>>>>>>>>> +                             "SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
>>>>>>>>> +                             "SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
>>>>>>>>> +                             "SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
>>>>>>>>> +                             "SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
>>>>>>>>> +                             "SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
>>>>>>>>> +                             "SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
>>>>>>>>> +                             "TDMIN_A IN 0", "TDM_A Capture",
>>>>>>>>> +                             "TDMIN_A IN 1", "TDM_B Capture",
>>>>>>>>> +                             "TDMIN_A IN 2", "TDM_C Capture",
>>>>>>>>> +                             "TDMIN_A IN 3", "TDM_A Loopback",
>>>>>>>>> +                             "TDMIN_A IN 4", "TDM_B Loopback",
>>>>>>>>> +                             "TDMIN_A IN 5", "TDM_C Loopback",
>>>>>>>>> +                             "TDMIN_B IN 0", "TDM_A Capture",
>>>>>>>>> +                             "TDMIN_B IN 1", "TDM_B Capture",
>>>>>>>>> +                             "TDMIN_B IN 2", "TDM_C Capture",
>>>>>>>>> +                             "TDMIN_B IN 3", "TDM_A Loopback",
>>>>>>>>> +                             "TDMIN_B IN 4", "TDM_B Loopback",
>>>>>>>>> +                             "TDMIN_B IN 5", "TDM_C Loopback",
>>>>>>>>> +                             "TDMIN_C IN 0", "TDM_A Capture",
>>>>>>>>> +                             "TDMIN_C IN 1", "TDM_B Capture",
>>>>>>>>> +                             "TDMIN_C IN 2", "TDM_C Capture",
>>>>>>>>> +                             "TDMIN_C IN 3", "TDM_A Loopback",
>>>>>>>>> +                             "TDMIN_C IN 4", "TDM_B Loopback",
>>>>>>>>> +                             "TDMIN_C IN 5", "TDM_C Loopback",
>>>>>>>>> +                             "TDMIN_LB IN 3", "TDM_A Capture",
>>>>>>>>> +                             "TDMIN_LB IN 4", "TDM_B Capture",
>>>>>>>>> +                             "TDMIN_LB IN 5", "TDM_C Capture",
>>>>>>>>> +                             "TDMIN_LB IN 0", "TDM_A Loopback",
>>>>>>>>> +                             "TDMIN_LB IN 1", "TDM_B Loopback",
>>>>>>>>> +                             "TDMIN_LB IN 2", "TDM_C Loopback",
>>>>>>>>> +                             "TODDR_A IN 0", "TDMIN_A OUT",
>>>>>>>>> +                             "TODDR_B IN 0", "TDMIN_A OUT",
>>>>>>>>> +                             "TODDR_C IN 0", "TDMIN_A OUT",
>>>>>>>>> +                             "TODDR_A IN 1", "TDMIN_B OUT",
>>>>>>>>> +                             "TODDR_B IN 1", "TDMIN_B OUT",
>>>>>>>>> +                             "TODDR_C IN 1", "TDMIN_B OUT",
>>>>>>>>> +                             "TODDR_A IN 2", "TDMIN_C OUT",
>>>>>>>>> +                             "TODDR_B IN 2", "TDMIN_C OUT",
>>>>>>>>> +                             "TODDR_C IN 2", "TDMIN_C OUT",
>>>>>>>>> +                             "TODDR_A IN 3", "SPDIFIN Capture",
>>>>>>>>> +                             "TODDR_B IN 3", "SPDIFIN Capture",
>>>>>>>>> +                             "TODDR_C IN 3", "SPDIFIN Capture",
>>>>>>>>> +                             "TODDR_A IN 6", "TDMIN_LB OUT",
>>>>>>>>> +                             "TODDR_B IN 6", "TDMIN_LB OUT",
>>>>>>>>> +                             "TODDR_C IN 6", "TDMIN_LB OUT",
>>>>>>>>> +                             "10U2 INL", "ACODEC LOLP",
>>>>>>>>> +                             "10U2 INR", "ACODEC LORP",
>>>>>>>>> +                             "Lineout", "10U2 OUTL",
>>>>>>>>> +                             "Lineout", "10U2 OUTR";
>>>>>>>>> +             assigned-clocks = <&clkc_pll CLKID_HIFI_PLL>,
>>>>>>>>> +                               <&clkc_pll CLKID_MPLL2>,
>>>>>>>>> +                               <&clkc_pll CLKID_MPLL0>,
>>>>>>>>> +                               <&clkc_pll CLKID_MPLL1>;
>>>>>>>>> +             assigned-clock-rates = <491520000>,
>>>>>>>>> + <294912000>,
>>>>>>>>> + <270950400>,
>>>>>>>>> + <393216000>;
>>>>>>>> Why do you need 4 base rates ? Which rate family does each provide ?
>>>>>>> hifipll 49152000, mpll2 294912000 mpll0 270950400, mpll1 393216000,
>>>>>>> the
>>>>>>> accuracy of hifipll
>>>>>>>
>>>>>>> is relatively high, for tdm/pdm/spdif 16/48/96/192k we can use it. if
>>>>>>> the
>>>>>>> tdm and spdif work on
>>>>>> It is fine to use the HiFi. I'm glad this clock finally got fixed
>>>>>>
>>>>>>> the same time, for example ,tdm 48k. spdif 44.1k, we can't use the
>>>>>>> same
>>>>>>> pll, so spdif need use the mpll 0
>>>>>>>
>>>>>>> other pll , only set a default value, at the latest chip, we remove
>>>>>>> all
>>>>>>> mpll for hardware, only two hifipll
>>>>>> I'm not sure you understand how this works.
>>>>>> There is 3 families of audio rate: 48kHz, 44.1kHz and 32kHz
>>>>>>
>>>>>> Each family needs a PLL assigned, so you need 3, not 4, unless there
>>>>>> is
>>>>>> another specific rate family you want to support. If that's the case,
>>>>>> document it.
>>>>>>
>>>>>> Setting the rate of the PLL should follow this principle:
>>>>>> * Family rate
>>>>>>      - multiplied by (32 x 24): to accomodate different sample sizes
>>>>>>      - multiplied by 2 until you reach the maximum rate of selected
>>>>>> PLLs
>>>>>>        This allows to support rates such 192k or even 768k
>>>>>>
>>>>>> 491520000 is not dividable by 3, it won't allow 24 bits words. It is a
>>>>>> poor choice.
>>>>>>
>>>>>> Have a look at the s400 for an example using the HiFi PLL. The axg was
>>>>>> restricted to a 68 PLL multiplier but the S4 is not so you should be
>>>>>> able to use a higher base rate (4 718 592 000 Hz), providing better
>>>>>> accuracy in the end
>>>>> for new soc audio ip, the hardware will not support the 24bit(include
>>>>> g12a,
>>>>> sm1,axg)
>>>> That may be what you chose to support in your BSP but that not how it
>>>> works in mainline. 24bits slot width is supported and has been tested on
>>>> axg, g12 and sm1. This is not going away.
>>>>
>>>> I would find extremely odd that 24 bits slot width is not supported on
>>>> s4,
>>>> but as long you document this, it is fine by me.
>>> i understand your meaning, you sad we configure the slot width 24bit for
>>> tdmout control
>>>
>>> if the format the SNDRV_PCM_FMTBIT_S24,  it send the 24bit data, for the
>>> format, and send the 24bit clock
>>>
>>> if tdmout control can cut out [24:0] from the fddr, maybe your right, we
>>> can send the 24 bit accoring to the slot width
>>>
>>> but it can't confirm by us, we are worried that there may be potential
>>> risks, so we don't use it thay way
>>>
>>> so this why i sad can't support the 24bit slot clock, 16/32 sample bit is
>>> fully validated
>>>
>>>
>> i did some tests for the S24_LE format use the tdm base drvier
>>
>> aplay -f S24_LE test.pcm -r48000 -c2
>>
>>   # cat /proc/asound/card0/pcm0p/sub0/hw_params
>> access: RW_INTERLEAVED
>> format: S24_LE
>> subformat: STD
>> channels: 2
>> rate: 48000 (48000/1)
>> period_size: 6000
>> buffer_size: 24000
>>
>> we dump the mclk
>>
>> aud_mst_a_mclk       2       2        0        12288000 0          0
>> 50000      Y audio-controller-0              mclk
>>
>> according to the base driver
>>
>> in the api axg_tdm_set_tdm_slots function
>> switch (slot_width) {
>>      case 0:
>>          slot_width = 32;
> 32 bits is the default slot width if none is specified, yes. So ?
>
>>          fallthrough;
>>          ...
>>
>> if dts not configure "dai-tdm-slot-width"
>>
>> it use the 32 bit slot width
>>
>> the api -> axg_tdm_iface_set_sclk
>>
>> srate = iface->slots * iface->slot_width * params_rate(params);
>>
>> set mclk rate
>>
>> we dump tdmout control register
>>
>> # devmem 0xfe330500
>> 0xB001003F
>>
>> it set 32bit slot width to send
>>
>> the base driver is the smae behavior that we wound expect,
> The driver set a slot width of 32 bits because you did choose any and
> then behave as it should.
>
> I don't get your point here or what such test is supposed to show.
>
> You did not test 24bits slot width at all.

we focus on why hifipll set 49152000 for S24_LE format, why not to  set 
the slot width = 24

we consider that 24-bit probably hasn't done a lot of testing, suggest  
slot width =32

tdmout cut out fddr[23:0], set slot width = 24, fddr msb = 23

we can support it, but can't sure the tdmout 24bit function can work for 
long time

it need to test for many time , so we just think it can send 24bit with 
8 bit zero for data lane,

if must be send 24 bit data with zero data

we need support the 24 bit clock pll

24 *32* 2 * 768k  = 1179.648M

4 718 592 000 Hz you suggested maybe is out of range hififpll

i think the 1179.648M is more suitable, Do you think so?

if you agree, we ask clk owner to add it




>
>>
>>>>> SNDRV_PCM_FMTBIT_S24_3LE, 24 bit in memory
>>>> I think you are mixing up slot width and memory representation
>>>>
> --
> Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11020115.outbound.protection.outlook.com [52.101.128.115])
	(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 328C1248BB7;
	Wed, 15 Jan 2025 10:36:42 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.115
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736937405; cv=fail; b=ZeUqEMKFsNfbQYbKn3Xj7gOYmbkqO19GQV6nUSkO0zRzcqNIjxkr7xge/yvFI+CLYXLSzJy303Rqb959BRsliANRi8XRmFS/h2QRYc8BpHM4qwKo93IgTqAGFwPrDejLlsT8ZPvAmXESDvCA5zGXXpVfRaB0CGsbpcjTEMkc1mY=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736937405; c=relaxed/simple;
	bh=Sir717Johx1ctBsqd+UW2bmK94/PRqlluOD8OjKQ1Jk=;
	h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=ZvtkQgmBWF11vHJ8KNiUILlabheiLJno0giWEbj0ktBDYu2WRugInwoQY10pBLndyk1pR5mabdNsH8vxpHFgXiyRwrHUh2Wesr7hZHB+cUbnTGeCtgnshl6CeITiOUXLiJy4C6YXEUG4ZuGBdigS7Fq30BRBVMIopJgQV/IC5kc=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=RJATuHTj; arc=fail smtp.client-ip=52.101.128.115
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="RJATuHTj"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=hOJkojCxE3rT4hb5lIA2R12X6WE5MRDl71PWNZ3w19wU/16tD3u5WtJadG7yzRpt4ubF3UfsclVuwWMSGmVoYUQQ93b898kzb0zVaRDOyfuG3NSetDCnjKdvtANKgAwd5wjou7uK9LTMWHI/LpWARXCH2X1ZWXO9diK3N0QTLrcKWQuozm4Sm/HH0WEf3vtBWYnLxU6acRI0EBHYGXKjBanyBmnY+14Ydhm20dzO8gnWLQnRZ+M86/zUXJNZ+ZSTWASnOD2BoLQXpkEAKGvGQHe/HmhoHhs8XAMvNdq1gVHyL6yOslYlNSf5xc8XTAjtRPWnTEps3FVj6192Vl2W/Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eIGObzdz/VD66IyEas38efD8wsz6yh5kycSXh2tBod0=;
 b=WGvD0uNDzNfz1wXoP8E5kotBG6C3HG2DzubpeBqZci/vQ7p7gIwgmocGVVY0KqPhw+KrEAd70u0txypz3p+FO5A3nssyjlMoQ582ZQEtLiEUtfwIK9B/ntXemkfpZe4i716G1jzt+qOJFGxt3AkfJVNhRzB26JwvwjiGWBtWkyFa7kAtmrGSL5BAvw6FWefhIf1yV33f7Cux2Wt30+GP7P8jxkaNK23VQ3qhx+q1U1KsAOPO8M2gms+Kyy71U0MJjZuIV3MDHE/ltGKcae9c0NZ12cZGQ1foCVN+Vhe09oui+Lo1XddtivrXjEYuXJ0RJSt5uRRQSiiRykTz58IvWw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eIGObzdz/VD66IyEas38efD8wsz6yh5kycSXh2tBod0=;
 b=RJATuHTjsXLJw7g05Af2KWPU5MWPXtpT/ib0oEPfoouCBugyGZKWARu9YqVAnmdqK/L+Qt6fbEyg3De1wxj47tq1M/gCbtFgeVsyHyqUWtFyTkCFh2gmoOAV5NXWBVjBWrEQSblcmdPht0q5Y0OtEWgo6WsyQpo2yUtpLcr8MtR8aVoXluogRhd4U93aKh2q8H5WmNJU8SBhB6cJApen26WPVHw3kStijlIxw0IrqyAI7WtInpZ7mPBNQkPD+ABaOsYNAIAywxdRcQMS0ulzjBoqL894H4006nLytCdLA9xrB7hTFnhTNwp11ZsUc31NeQf77WxpXWdl24iRZOuuiQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by TYSPR03MB7888.apcprd03.prod.outlook.com (2603:1096:400:47b::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.17; Wed, 15 Jan
 2025 10:36:37 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8356.010; Wed, 15 Jan 2025
 10:36:37 +0000
Message-ID: <7cf4c53c-7cd2-402c-9e31-f85767ead932@amlogic.com>
Date: Wed, 15 Jan 2025 18:36:32 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
 <1jwmey9451.fsf@starbuckisacylon.baylibre.com>
 <e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
 <e69cd38e-898c-4cbc-a327-14148a71c764@amlogic.com>
 <1j8qrd7aor.fsf@starbuckisacylon.baylibre.com>
 <e5055b4d-7a10-4a5e-ad85-d94c1f64eb03@amlogic.com>
 <1jr0545v8w.fsf@starbuckisacylon.baylibre.com>
From: Jiebing Chen <jiebing.chen@amlogic.com>
In-Reply-To: <1jr0545v8w.fsf@starbuckisacylon.baylibre.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: KL1P15301CA0036.APCP153.PROD.OUTLOOK.COM
 (2603:1096:820:6::24) To PUZPR03MB7135.apcprd03.prod.outlook.com
 (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|TYSPR03MB7888:EE_
X-MS-Office365-Filtering-Correlation-Id: 8d5b5f2e-ab67-46da-f292-08dd35507d24
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024;
X-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MGJOZDFmNnBpQzY4Vnd5ZzIvU2gxakJVRnNlMXlt?=
 =?utf-8?B?M3NiNzB3K2Z3TXFiMHNPakFheGNTOWY3S3lBeS9Lc2w4SGdUZExmVmwzVW01?=
 =?utf-8?B?YWJrRktTSS9ieHpFS2ZETytXV1VCc1NLL2M1dUdUVnJwNit6RTN5cFFSd1dw?=
 =?utf-8?Q?X6T+4l8X45Bc+?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR03MB7135.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?a1N5RzhQRTYrRTlDNWVoS2lsa2ZmMnFiTi9UTWFNOWpwNjZQQ3RZY3IyWDZ4?=
 =?utf-8?B?KzkzNFA0dmR4Z29iUHhiU0RlTjFHVlA0SGRJWHdENFZkMkZvVFhGZENwTzY0?=
 =?utf-8?B?Q0w4QTBQbkR6MlFiL2FWb2duVjIzSVhBaWlIYjVWai9ybERBdXdJQ1Jqa0Uw?=
 =?utf-8?B?enRPbmU3d3hpOVdyelcwYjhOU25KVDk4c3QrNGlyaVNQdFZwYk15akd0SDlp?=
 =?utf-8?B?TjJHS2czTHZkdXNZUExPYm5xWlh6ZW9qcHdLUDAvOGdtWWdqRTJsN2FYZE1q?=
 =?utf-8?B?ZHFKb09Xb2RPanJPejd3dWNVVGVtb29PanBNdXVwdWd4anNjTTM4RHNBTlNj?=
 =?utf-8?B?SkczNkc3c2VPUDd0WEpGbURUU2NQaWRGRFI0ZVRsaEs4LzN1dnRxV3Fic1dm?=
 =?utf-8?B?a1M5WjFqeE81QzBBREtJVUxQS0tqY2J2QnNLWUJIVzlIbnI0WHV0SkJoQmZD?=
 =?utf-8?B?NWlmNDE3SytJVzBGWkR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292-08dd35507d24
X-MS-Exchange-CrossTenant-AuthSource: PUZPR03MB7135.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 10:36:37.2030
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ZO54oIQzz8A2+ZgjA2Gv5aVhQRixKTLJbEz4UUlT+e8cn481mS7I16BCbD99Sw1uSSIKwzstWKOFNuXfTyMHAxwk/D6DsNVGhP0xNT0Ylko=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR03MB7888


在 2025/1/15 16:36, Jerome Brunet 写道:
> [ EXTERNAL EMAIL ]
>
> On Wed 15 Jan 2025 at 10:56, Jiebing Chen <jiebing.chen@amlogic.com> wrote:
>
>> 在 2025/1/14 22:05, Jerome Brunet 写道:
>>> [ EXTERNAL EMAIL ]
>>>
>>> On Tue 14 Jan 2025 at 19:20, Jiebing Chen <jiebing.chen@amlogic.com> wrote:
>>>
>>>>>>> +
>>>>>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>>>>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>>>>>> +MODULE_LICENSE("GPL");
>>>>>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>>>>>> index
>>>>>>> 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648
>>>>>>> 100644
>>>>>>> --- a/sound/soc/meson/t9015.c
>>>>>>> +++ b/sound/soc/meson/t9015.c
>>>>>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
>>>>>>>                  .channels_min = 1,
>>>>>>>                  .channels_max = 2,
>>>>>>>                  .rates = SNDRV_PCM_RATE_8000_96000,
>>>>>>> -             .formats = (SNDRV_PCM_FMTBIT_S8 |
>>>>>>> -                         SNDRV_PCM_FMTBIT_S16_LE |
>>>>>>> -                         SNDRV_PCM_FMTBIT_S20_LE |
>>>>>>> -                         SNDRV_PCM_FMTBIT_S24_LE),
>>>>>>> +             .formats = (SNDRV_PCM_FMTBIT_S16_LE |
>>>>>>> SNDRV_PCM_FMTBIT_S32_LE),
>>>>>> Again, mixed up changes with zero justification.
>>>>>>
>>>>>> This drops S8 and S16 format support for the existing SoCs (such as GXL)
>>>>>> which is known to work and add S32 support on an HW documented as 24bits
>>>>>> only. Can you explain ?
>>>> for g12a, sm1 etc, it is use new audio ip, GXL is old ip,
>>> If there are chips difference we did not know about, then you should
>>> introduce those difference, without breaking existing support -
>>> including for GXL, which is what you did IIUC.
>>>
>>>> the new ip not support 24 bit,
>>> Are sure about that ? that code has been there for a while.
>>>
>>> If sm1 does not support SNDRV_PCM_FMTBIT_S24_LE, you should a fix up patch for
>>> that, with the proper "Fixes:" tag, how to reproduce the problem and
>>> explaining the fix.
>> maybe there are some gap , we support SNDRV_PCM_FMTBIT_S24, not support the
>>
>> SNDRV_PCM_FMTBIT_S24_3LE,  for SNDRV_PCM_FMTBIT_S24
>>
>> it is  Signed, 24-bit (32-bit in memory), little endian , the audio dma
>> busrt is 64bit
> It makes absolutely no sense to discuss memory layout for the codec.
>
>> it can get the full data. we send the 32 bit data  mclk = 32bit* 48k *4,
>> use the clk to send
>>
>> the  SNDRV_PCM_FMTBIT_S24,   the hadware always send the 32bit data
> No it does not. It send 24 bits of data over a 32 bits physical word with
> 8 bits ignored.

The original intention, we play 32bit data from tdmout, it play error, 
so we add the s32_le

for tdmouta ,it can bind Multiple codec, one codec is the internal codec,

other is external codec, tdmout can send the data to internal codec and 
external codec from the output pad

for example, tdmout send 4 ch, 2 ch is send the internal codec, 2 ch 
send the data pad

it aplay error, due to the internal codec fomat parameter limiting condition

There is a contradiction here,  Considering our internal can process 
this it, drop 8bit, 24bit valid

therefore software can set s24_le/s32_le, still  work ok for hardware, 
so Multiple ch can support for internal codec and external codec


>
>> so, i think we only add the SNDRV_PCM_FMTBIT_S32 base on it
> That's wrong if the codec does not actually use the full 32bits ... and
> I have clear indication that's what the codec is doing, on GXL at least.
>
>> we think the 24 bit is the SNDRV_PCM_FMTBIT_S24_3LE, it is 24bit in memroy,
>>
>> due to the dma busrt 64 bit limit, it can't align the sample bit, if it is
>> 24 bit
> Again, memory layout makes no sense here.
>
>> so the clock configure can't 24bit clock,
> I disagree and this has been tested. If you have a test case showing
> otherwise please share it.
>
>> by the way, We discuss internally for gxl,
>>
>> it also support the SNDRV_PCM_FMTBIT_S32
>>
> Does it really ? If it is just to ignore the 8bits LSB, that not a support.
>
>>>> usually support 16/32 bit for new audio ip , for SNDRV_PCM_FMTBIT_S24_LE,
>>>> it width =24, phy =32
>>> Yes physical of SNDRV_PCM_FMTBIT_S24_LE, so most chip supporting 32 bits
>>> width would support this S24_LE, unless there is something odd.
>>>
>>>> it was  treated as 32 bit to send for tdm, so we can only add the S32LE
>>>> base on it , right ?
>>> You are asking me ? How am I suppose to know ?
>>>
>>>> but if the gxl not support the 32bit
>>> I don't see a problem with a DAC taking input on 32bits physical
>>> interface and ignoring some bit on processing.
>>>
>>> If that's not the case, please send a proper fix change with some explanation
>>>
>>>> we need add new snd_soc_dai_driver t9015_dai_s4 ?
>>>>
>>> If I understood correctly format depends on the chip and needs to
>>> adjusted including for sm1.
>>>
>>>>>>>          },
>>>>>>>          .ops = &t9015_dai_ops,
>>>>>>>     };
>>>>>> -- Jerome
>>> --
>>> Jerome
> --
> Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11020135.outbound.protection.outlook.com [52.101.128.135])
	(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 85EE61E98F7;
	Wed, 15 Jan 2025 11:47:40 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.128.135
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736941662; cv=fail; b=pUxnNaCrLTBQfXpP8cokNOxVnTUOtdiU5EhABCRwsgjapS+L9ebK7QW9RKWbRLLBwhcVFNAE9bh2Qoq9eGMC18UQ/qn4eDcV7YaMQypjeSphxZGQlWSIRBw/2wOSGPzYe3hgy1avziW0CM64yalYiyuz09l2B2ODqR9RL9nsJCc=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736941662; c=relaxed/simple;
	bh=YbDRJYquThah9gNbkrG6w9pdrA4yaVOBjlgZCzuVXME=;
	h=Message-ID:Date:Subject:From:To:Cc:References:In-Reply-To:
	 Content-Type:MIME-Version; b=JfrcykRuIufniRoc9sVDuyBU+Sa28d+eXBZoEJqPihrai/JjXoy88eXYBr1JI0nvB3APrpaceqwJLBJkEgrQZhxhtp13k6KUxOz8HbMLu64kSQagJxRe1dklYfHvYh4SemonU4X/SInybmGvo0b58ZmST7+/QZrosVgIF0kebmI=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=AH5RlOjr; arc=fail smtp.client-ip=52.101.128.135
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="AH5RlOjr"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=dHcd2TDGYB6tK6vB3nuijlfm8zzkV+7O0iWpFl5vI2wNoRjl+c61glTrGf1lAOvykjMVyZYfH4C6YFpYdo9AHM0W7WGLrHFmtz50I4SgI1nafmYsEXiIhZrVElejEvSpYmcE7l60VxK4LV1kAp4uBqM3xUwMgZ0ROSYvNG7yHzQe85s2+F8m8Lhxyw5ENJYWyKDzwiFklExwfFBeWtQp4Bd7y+cHGAcPNhkfkltvcguyanPgc90vezbsuZR653t0phJ2Izq3EtTwRUM3dn52wUizgF6smud6djTdhqeQ581MQ/63aXNTdEj8EPBybW3gGH3kmpx4B3LLs6PS0xVxJA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8uUbNfzpqxPt1PcWrOpI2ALqgDvkaqQWav9w9/zNJho=;
 b=YMvjsfUP7BrekJhh3QzqveySkI/4hewQppL1UORIG/wa+SOzfb2YXez+LD6Fz6eyGsZYg+lsheERITaUBSmy0WgEQoN7CYk6LftV9DQ7Z1rns53jBLAQQuTDC51dAMvqEy/oRCw7iYSoXI6GVbJHfHvXFf+sUNVva8QbwlvhuBI/FsSTWSpolA7H+bdeM65RzVHDCQ3oZ097W0SuLoIWFhPaFrI6hMDgmzuUfTpmGvJXq8qDmTxmdmLxb7Q4rGmkfTD/orKL9HgD0o370cCOjiKvB0DUo8bx54ME06er9zVXRYlnlp/Vqf7WCYi6btZnVo4UhnihQLXKQtXJjsEVYg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8uUbNfzpqxPt1PcWrOpI2ALqgDvkaqQWav9w9/zNJho=;
 b=AH5RlOjr0UpADF2vubFDxS5ytAXlyNDjvbONcYDi0Om0Qxicb08R/ZeOmGrYssickKbMoAzm2zi9VZOYJ+tbKGRYNV3PkMoYPVYTiI9GeJqnFgmzUWAInf4nppUM9Zql12IOz+NFyxEQ5b8FU2Hf5C55EyPErghQfDahmoiVu2vPdl2qS72NZJBEjf3j3uzcJwN/UJ/fG3EY6K3MZemVmYL41nDiHH7M/pzXvqldH8WjQbFNYqsffzuYfXZKxF+pHl9p3vXY2Z+jGJZTx/kfhXFTqJXh10mk6iAtqE2L5XoOw4QygaHDOzxBRoHwyvZvSbip+blUwCSRTLiEUI1Lyw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by TYZPR03MB8557.apcprd03.prod.outlook.com (2603:1096:405:6e::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.13; Wed, 15 Jan
 2025 11:47:36 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8356.010; Wed, 15 Jan 2025
 11:47:36 +0000
Message-ID: <af4fde1c-281b-4826-a52c-a4e14727eb67@amlogic.com>
Date: Wed, 15 Jan 2025 19:47:32 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
From: Jiebing Chen <jiebing.chen@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
 <1jwmey9451.fsf@starbuckisacylon.baylibre.com>
 <e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
 <e69cd38e-898c-4cbc-a327-14148a71c764@amlogic.com>
 <1j8qrd7aor.fsf@starbuckisacylon.baylibre.com>
 <e5055b4d-7a10-4a5e-ad85-d94c1f64eb03@amlogic.com>
 <1jr0545v8w.fsf@starbuckisacylon.baylibre.com>
 <7cf4c53c-7cd2-402c-9e31-f85767ead932@amlogic.com>
In-Reply-To: <7cf4c53c-7cd2-402c-9e31-f85767ead932@amlogic.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: SI2PR02CA0002.apcprd02.prod.outlook.com
 (2603:1096:4:194::22) To PUZPR03MB7135.apcprd03.prod.outlook.com
 (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|TYZPR03MB8557:EE_
X-MS-Office365-Filtering-Correlation-Id: 85984c00-af9b-4b4e-9e1e-08dd355a67ac
X-MS-Exchange-SenderAD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FFMW4wNTM4VzlxTDgrYVlUT0FkVU5vZEh3NDE5VkI1dXEvclBzSDdl?=
 =?utf-8?B?WndjdkFsYXRXMUFGeHNrSG5SaXloaDJ5NmZEbldjN080WElmY0ZrTTl0YUJJ?=
 =?utf-8?B?VjhZeW10YUMxTmpDU01NYTYwVVE1LzVZVW55WmtlNmh2ck9oU3UxNXQ2L2FG?=
 =?utf-8?B?bXpjOHZMMG9uS2h2NFRBMmh2WWRRTGxGMHNMOGlJRnNMd3JKKzg5cjZtMnNE?=
 =?utf-8?Q?gPJsf3iopCWYq?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR03MB7135.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bmQrVmpBU2hzRHNPK1U5clAwRDB6aUg3dkhjSG4wdHZvMWs4SlE4cms5Sjd6?=
 =?utf-8?B?TCtsMmJBZkNndDlZbm51bDhZcFdidXg0MFVkS0xFc0dHV2F2Q1hSRE9Vd1po?=
 =?utf-8?B?eUdLSXVnYXNSaE9KUUdiSWtmdGFBUFkyWXZKbjFDazBWcUlPY3RySFBoYm9W?=
 =?utf-8?B?Y1NyMUxqTTBOVktWYVRieVQyNTMxQ01TWi9YMHpyaFAzTTg0Rmx0SVNPYTA2?=
 =?utf-8?B?ZG5mVWlQUVdHYmppa1RrOCtiR3Y0YmxFa0xHK1R5aUNBbStJczhJYWtKamJM?=
 =?utf-8?B?WndkUEJKRzgwbklkaTFEQ2dpZnJodWtqaVNqSnZjQ29qcXpCSkNaVmpuSzF6?=
 =?utf-8?B?QVdyOXZRVXJRMkR0OXlYZnZPcXd1R2dSaEhOVU1oYzB0R1VnVEVLbzBacVFn?=
 =?utf-8?B?Z1Zv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=?utf-8?B?dXc9PQ==?=
X-OriginatorOrg: amlogic.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 85984c00-af9b-4b4e-9e1e-08dd355a67ac
X-MS-Exchange-CrossTenant-AuthSource: PUZPR03MB7135.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 11:47:36.1291
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: G7P3t6V7cSUgRJFMMYoOPdLIqtz/r7+rlN3UUvgqH9sARI61zv2ilm/bfdhB+DjJ+ku1Aa0eYnQjQltACIVk7Yan0F1KERkNshxTclPtbsc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR03MB8557


在 2025/1/15 18:36, Jiebing Chen 写道:
>
> 在 2025/1/15 16:36, Jerome Brunet 写道:
>> [ EXTERNAL EMAIL ]
>>
>> On Wed 15 Jan 2025 at 10:56, Jiebing Chen <jiebing.chen@amlogic.com> 
>> wrote:
>>
>>> 在 2025/1/14 22:05, Jerome Brunet 写道:
>>>> [ EXTERNAL EMAIL ]
>>>>
>>>> On Tue 14 Jan 2025 at 19:20, Jiebing Chen 
>>>> <jiebing.chen@amlogic.com> wrote:
>>>>
>>>>>>>> +
>>>>>>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>>>>>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>>>>>>> +MODULE_LICENSE("GPL");
>>>>>>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>>>>>>> index
>>>>>>>> 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648 
>>>>>>>>
>>>>>>>> 100644
>>>>>>>> --- a/sound/soc/meson/t9015.c
>>>>>>>> +++ b/sound/soc/meson/t9015.c
>>>>>>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
>>>>>>>>                  .channels_min = 1,
>>>>>>>>                  .channels_max = 2,
>>>>>>>>                  .rates = SNDRV_PCM_RATE_8000_96000,
>>>>>>>> -             .formats = (SNDRV_PCM_FMTBIT_S8 |
>>>>>>>> -                         SNDRV_PCM_FMTBIT_S16_LE |
>>>>>>>> -                         SNDRV_PCM_FMTBIT_S20_LE |
>>>>>>>> -                         SNDRV_PCM_FMTBIT_S24_LE),
>>>>>>>> +             .formats = (SNDRV_PCM_FMTBIT_S16_LE |
>>>>>>>> SNDRV_PCM_FMTBIT_S32_LE),
>>>>>>> Again, mixed up changes with zero justification.
>>>>>>>
>>>>>>> This drops S8 and S16 format support for the existing SoCs (such 
>>>>>>> as GXL)
>>>>>>> which is known to work and add S32 support on an HW documented 
>>>>>>> as 24bits
>>>>>>> only. Can you explain ?
>>>>> for g12a, sm1 etc, it is use new audio ip, GXL is old ip,
>>>> If there are chips difference we did not know about, then you should
>>>> introduce those difference, without breaking existing support -
>>>> including for GXL, which is what you did IIUC.
>>>>
>>>>> the new ip not support 24 bit,
>>>> Are sure about that ? that code has been there for a while.
>>>>
>>>> If sm1 does not support SNDRV_PCM_FMTBIT_S24_LE, you should a fix 
>>>> up patch for
>>>> that, with the proper "Fixes:" tag, how to reproduce the problem and
>>>> explaining the fix.
>>> maybe there are some gap , we support SNDRV_PCM_FMTBIT_S24, not 
>>> support the
>>>
>>> SNDRV_PCM_FMTBIT_S24_3LE,  for SNDRV_PCM_FMTBIT_S24
>>>
>>> it is  Signed, 24-bit (32-bit in memory), little endian , the audio dma
>>> busrt is 64bit
>> It makes absolutely no sense to discuss memory layout for the codec.
>>
>>> it can get the full data. we send the 32 bit data  mclk = 32bit* 48k 
>>> *4,
>>> use the clk to send
>>>
>>> the  SNDRV_PCM_FMTBIT_S24,   the hadware always send the 32bit data
>> No it does not. It send 24 bits of data over a 32 bits physical word 
>> with
>> 8 bits ignored.
>
> The original intention, we play 32bit data from tdmout, it play error, 
> so we add the s32_le
>
> for tdmouta ,it can bind Multiple codec, one codec is the internal codec,
>
> other is external codec, tdmout can send the data to internal codec 
> and external codec from the output pad
>
> for example, tdmout send 4 ch, 2 ch is send the internal codec, 2 ch 
> send the data pad
>
> it aplay error, due to the internal codec fomat parameter limiting 
> condition
>
> There is a contradiction here,  Considering our internal codec can 
> process this it, drop 8bit, 24bit valid
>
> therefore software can set s24_le/s32_le, still  work ok for hardware, 
> so Multiple ch can support for internal codec and external codec
>
>
add the s32_le format for the t9015.c,  it can resovle Multiple codec 
s32_le format case,  although hardware only process 24bit of 32bit, but 
it can't affect the acodec hardware work, it still work fine

usually we add the s32_le format support, if not allow to do it, think 
of it as a limitation, we can  remove 32bit test for it

>>
>>> so, i think we only add the SNDRV_PCM_FMTBIT_S32 base on it
>> That's wrong if the codec does not actually use the full 32bits ... and
>> I have clear indication that's what the codec is doing, on GXL at least.
>>
>>> we think the 24 bit is the SNDRV_PCM_FMTBIT_S24_3LE, it is 24bit in 
>>> memroy,
>>>
>>> due to the dma busrt 64 bit limit, it can't align the sample bit, if 
>>> it is
>>> 24 bit
>> Again, memory layout makes no sense here.
>>
>>> so the clock configure can't 24bit clock,
>> I disagree and this has been tested. If you have a test case showing
>> otherwise please share it.
>>
>>> by the way, We discuss internally for gxl,
>>>
>>> it also support the SNDRV_PCM_FMTBIT_S32
>>>
>> Does it really ? If it is just to ignore the 8bits LSB, that not a 
>> support.
>>
>>>>> usually support 16/32 bit for new audio ip , for 
>>>>> SNDRV_PCM_FMTBIT_S24_LE,
>>>>> it width =24, phy =32
>>>> Yes physical of SNDRV_PCM_FMTBIT_S24_LE, so most chip supporting 32 
>>>> bits
>>>> width would support this S24_LE, unless there is something odd.
>>>>
>>>>> it was  treated as 32 bit to send for tdm, so we can only add the 
>>>>> S32LE
>>>>> base on it , right ?
>>>> You are asking me ? How am I suppose to know ?
>>>>
>>>>> but if the gxl not support the 32bit
>>>> I don't see a problem with a DAC taking input on 32bits physical
>>>> interface and ignoring some bit on processing.
>>>>
>>>> If that's not the case, please send a proper fix change with some 
>>>> explanation
>>>>
>>>>> we need add new snd_soc_dai_driver t9015_dai_s4 ?
>>>>>
>>>> If I understood correctly format depends on the chip and needs to
>>>> adjusted including for sm1.
>>>>
>>>>>>>>          },
>>>>>>>>          .ops = &t9015_dai_ops,
>>>>>>>>     };
>>>>>>> -- Jerome
>>>> -- 
>>>> Jerome
>> -- 
>> Jerome

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sg2apc01on2107.outbound.protection.outlook.com [40.107.215.107])
	(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 501782475C9;
	Wed, 15 Jan 2025 12:09:20 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.107
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1736942963; cv=fail; b=lNd1Ly7yiCRII6pq427fTsMFavED6xyDNys321BxLMqLRgzZTdOx6VbTWslPYXf39M+V0uwuDfkX1dBb9frWtmoMzzhPxDLbr59qrk4sRRfPL8NFChcWQliVKuW3gJNZXMdrMw6jYIGFt8sNSPSYTMY2o+a71pQUS4AWtHlBeJg=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1736942963; c=relaxed/simple;
	bh=hDJ0y46N4ALKAAdKpkd5Nf1BYgxubEd766XLswmpBNE=;
	h=Message-ID:Date:Subject:From:To:Cc:References:In-Reply-To:
	 Content-Type:MIME-Version; b=KWDCk0UvtEWX1JVSCl7UzUPnbPCiuBi9VspPCNZ5VkUnu+J06p7w2qUGqREx5yyzmMrUJwBf8AlXPX7DL0ZGobtF1JBBuv4MZrNZPGsITqO5ZI8Nkw6nFo4+b3o2nknhKRU/luMRN2CHbu8E4ha01ju+cz2SK2fLH6bwJE+diCM=
ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com; spf=pass smtp.mailfrom=amlogic.com; dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b=jhgOHlLk; arc=fail smtp.client-ip=40.107.215.107
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amlogic.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amlogic.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=amlogic.com header.i=@amlogic.com header.b="jhgOHlLk"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ms4IK10xaGMUQBxtOuMCy0FnBagIgoRc+RaVVGNp1nuMmpg1y/vYJ7+vOam/UpANN4iO+kEOKzXvFqI1wygAySuEwRkPkNZHF5RItNspSy7Zy79QNB62+Qk0gtmsitwHZkX1y3c8+ONQfwnNtLBc2luXk6AByZJH676q8F05+2NmGervyx/uxHgJw+ClnyEBriP/NLC0fIGMnr034VoCNe1lpfUX7iHrG66KSSTSTRYYXtAPvB8a2zkfbGt9QSfYBzjXLYZUpjgYSrIxyBSQuzQAEwIf6HEp8NgXyWutg6cGoCU/eGgQNa++ZUm9XmRlpd8sR7blCQSnPt/ZqBFzeA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=m/Ofh4zGlpRsoJdspWCOf3dHzqaLgcdfbC0x7ZqCCEs=;
 b=ZAmj6o4frOtIhUqUmxoxwLjD8isxGaRSK1QT9ONrqlss0q/m4YmumQDyfsr9vCWvouK3juWndMSddKWG7gu5nJ9J7v04Sh/ZCZ3UKVc8dmw8nlncORgITr3b1p9BMA3Ve6wp1OPKxfhf4ZdF/zPC2D+/QirWVTQaO4H1tx69xKJBlmw03wYJGDeZA1SeChe+mwBlqXd1BxxLzUDMrEuspC69/ZpecgckWJGVciqEqGRqzK3HIRWxMUwzAGq/qxxx2vveXietoLYCBY4am+M9WrQimwH0o7VJ3gjKrI3Y0SR3YzWt5PfsMExlV4NqvZUW/NCUA6YtRwccwOAAorTXpA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amlogic.com; dmarc=pass action=none header.from=amlogic.com;
 dkim=pass header.d=amlogic.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amlogic.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=m/Ofh4zGlpRsoJdspWCOf3dHzqaLgcdfbC0x7ZqCCEs=;
 b=jhgOHlLkVlM189hYIeDnHrWOjSKBQAeDDrNpMRD4BxxFJdwnkhO4XiRLBhHZjjmPryhvfFj7EvIeVJ5kf2w7cIuNJVMwrW9cxGpRj9ZEz3/NMM/bAIf+nwnRWTgl22XmgYoYcPCuS/Hqw4sMI+OdcX+eLSK0sxXLVF0NfRZJvLYLwd6D7QHOKBYV7yjzZXddQNFEmOkYPcwhNt3jXaIuBNjUcZD6KL2Q7euD/aToa0+lsabPUzM8aulm88GwW4C+SKPFt4hYu6i5E8yA32kkWmsydogo3/fo2oyzyej3kI8pd1TQeC375hu4MFJMe7tADbMFfBuJbsVJwqJEoWpbug==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amlogic.com;
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com (2603:1096:301:113::15)
 by SEZPR03MB7124.apcprd03.prod.outlook.com (2603:1096:101:e1::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Wed, 15 Jan
 2025 12:09:15 +0000
Received: from PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d]) by PUZPR03MB7135.apcprd03.prod.outlook.com
 ([fe80::ecac:a387:36d8:144d%3]) with mapi id 15.20.8356.010; Wed, 15 Jan 2025
 12:09:14 +0000
Message-ID: <b3b60ec4-ae88-4110-9839-449ee7477d9b@amlogic.com>
Date: Wed, 15 Jan 2025 20:09:10 +0800
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] ASoC: meson: s4:support for the on-chip audio
From: Jiebing Chen <jiebing.chen@amlogic.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: jiebing chen via B4 Relay <devnull+jiebing.chen.amlogic.com@kernel.org>,
 Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
 Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
 Conor Dooley <conor+dt@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
 Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>,
 Kevin Hilman <khilman@baylibre.com>,
 Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
 linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
 linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-amlogic@lists.infradead.org
References: <20250113-audio_drvier-v1-0-8c14770f38a0@amlogic.com>
 <20250113-audio_drvier-v1-2-8c14770f38a0@amlogic.com>
 <1jwmey9451.fsf@starbuckisacylon.baylibre.com>
 <e2f26ca2-4c38-4b07-bf17-95544588a2f2@amlogic.com>
 <e69cd38e-898c-4cbc-a327-14148a71c764@amlogic.com>
 <1j8qrd7aor.fsf@starbuckisacylon.baylibre.com>
 <e5055b4d-7a10-4a5e-ad85-d94c1f64eb03@amlogic.com>
 <1jr0545v8w.fsf@starbuckisacylon.baylibre.com>
 <7cf4c53c-7cd2-402c-9e31-f85767ead932@amlogic.com>
 <af4fde1c-281b-4826-a52c-a4e14727eb67@amlogic.com>
In-Reply-To: <af4fde1c-281b-4826-a52c-a4e14727eb67@amlogic.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: TY2PR04CA0013.apcprd04.prod.outlook.com
 (2603:1096:404:f6::25) To PUZPR03MB7135.apcprd03.prod.outlook.com
 (2603:1096:301:113::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR03MB7135:EE_|SEZPR03MB7124:EE_
X-MS-Office365-Filtering-Correlation-Id: 5e498b03-161d-4e38-441a-08dd355d6db5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?bzNWaFVxU0JoQVZXbm5QNnI4TWlIbmlocVBaeXc5empXRjMzeTZQY1YrLzZM?=
 =?utf-8?B?c0VXV1RTZm1vcDg3aGlDR1k1Nnd6TWlIQmR1WU9YZ25EN1BVaHlTV2FwNXp5?=
 =?utf-8?B?MmxORUg1SVQvc2t5Wndia1ZOQWVPTm5EOXpSSmxLQmVlSENDc1VoR2xHajh5?=
 =?utf-8?B?RExOMDNabXdSNEUxUElaMkc0UmhGUVk5aW96cmUxWEVjZy9tQXVFM2owNFRE?=
 =?utf-8?B?YnlFQ0pWNE1ZMHZiL0ZWUWhhcklCMjhHZGtiNjl5YjhvTUlEL3BQejdvSDRv?=
 =?utf-8?B?bzZRTFZXeVRJOVMvbVIxdTVDTEE4d0xIL1Z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Go0blFn?=
 =?utf-8?B?S29nYjliN25NdWpqZGRmM3Q2dVhWYU93dDRHL20yaWZpQUJoR05NWHNoQ1hC?=
 =?utf-8?B?cTl5c3BJM3cxQnZBb1FleitBSHRpb1I2WUpRTkNpRHI3M2NmSGQ3RERDbDd1?=
 =?utf-8?B?Z0RrellHYm52OGFIUi9nazZrbEVDSWF0MmlkQXdIaDNoM1BRWHVnWjZDMlpN?=
 =?utf-8?B?NHcvT1oxQlp0NkdDRXY0bktZNHRrZWRnSzRKZVAwa0hqVTUxaldVWEFKaUI2?=
 =?utf-8?B?djFPTEJzSGQrNm15b0Jld2JvcDFXaGxDbUNWY1d6YndxTjRVMiswQUhUd2FZ?=
 =?utf-8?B?R0RCU0hBdkxQbHdJZkNwc0h3cWMrajQwWFdlaHFBNXVxalpXbVBJRlZiMjZl?=
 =?utf-8?B?VTNiSUhJQ3VlaGI2ZzBJRlZOQTFtQ3FKVjNVQjlwQWZNRnRINXZUQWlhZ0Iw?=
 =?utf-8?B?U3I1QUVYYU1GbDhkVjlsVjFtWHM5MmM5WGg2UDZOL0tWL2s5dU53YlJOVDBm?=
 =?utf-8?B?VXZMWFlycUk0bXpJQ3lObjlOc1RSVW5TdFZJdXQ5UVhReE15VnZHN2tVMS9l?=
 =?utf-8?B?MXplVHBWbDRCUW41b3Y2YlMreDgra3VlODlqUlJodGJwdHc0WXJlaEF2czZI?=
 =?utf-8?B?TTBVeEpFQk1yVVBWMkRSa1NRMk92czZWUW4yUENGUVNsV1ZkaWthaEdCY0k4?=
 =?utf-8?Q?02CKtMnWGZIvJ?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR03MB7135.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0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UxSQmhzVVFBejNPTjJkQVE1?=
 =?utf-8?B?QXh2bGdJR1FJVWphL0lYM0NJRStaYXZaTmVONHpWMGt4T01kM3BzZzBKcUx5?=
 =?utf-8?B?cVpheE9aTndtTzQwVXlKQk9OKzlsZlczVWxzV21IaVhSc2JiUHRZai84QUJq?=
 =?utf-8?B?Z0RsRFp6MGxNL1NhbXBsZHZKOWc5Y3pNV29ISWdITUFtaUx1NUJERFJpSFlI?=
 =?utf-8?B?OVNNTlZoMm1rSHNtc2J2aC9nTHp4cHFlNHg0c2ZFd1VSNEM0UjBtR1dDQ1Nq?=
 =?utf-8?B?dXRMVHYwdEZCS0pRbXdJMjlmK3FVL0xPM3BFbTZXR1h3bTVaL01sQURNYmhQ?=
 =?utf-8?B?RndrUEJneDJOVVppL2RaQXBsNmE0c1VPWHlIeGRJeS9uZ25Pc3lOVy95S05h?=
 =?utf-8?B?bVRXV3pidlEyRlpub3dEYzhXMEFNSXZJTjV2bzNTUmhBRTNaOHYzbFFBY0dW?=
 =?utf-8?B?TGc9PQ==?=
X-OriginatorOrg: amlogic.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5e498b03-161d-4e38-441a-08dd355d6db5
X-MS-Exchange-CrossTenant-AuthSource: PUZPR03MB7135.apcprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2025 12:09:14.6618
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0df2add9-25ca-4b3a-acb4-c99ddf0b1114
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: yWhrHW03Lo2nP4nCYDBkoMtWecYImc0X61S1Q/NCUE0SU13F6UuWwUfo97rstK54oNfPmDVJYtOlC5yGz4Tp4FKnmJPgNzrorm/icFmwGZ4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR03MB7124


在 2025/1/15 19:47, Jiebing Chen 写道:
>
> 在 2025/1/15 18:36, Jiebing Chen 写道:
>>
>> 在 2025/1/15 16:36, Jerome Brunet 写道:
>>> [ EXTERNAL EMAIL ]
>>>
>>> On Wed 15 Jan 2025 at 10:56, Jiebing Chen <jiebing.chen@amlogic.com> 
>>> wrote:
>>>
>>>> 在 2025/1/14 22:05, Jerome Brunet 写道:
>>>>> [ EXTERNAL EMAIL ]
>>>>>
>>>>> On Tue 14 Jan 2025 at 19:20, Jiebing Chen 
>>>>> <jiebing.chen@amlogic.com> wrote:
>>>>>
>>>>>>>>> +
>>>>>>>>> +MODULE_DESCRIPTION("Amlogic to codec driver");
>>>>>>>>> +MODULE_AUTHOR("jiebing.chen@amlogic.com");
>>>>>>>>> +MODULE_LICENSE("GPL");
>>>>>>>>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>>>>>>>>> index
>>>>>>>>> 571f65788c592050abdca264f5656d4d1a9d99f6..2db1cd18cf2cea507f3d7282054e03d953586648 
>>>>>>>>>
>>>>>>>>> 100644
>>>>>>>>> --- a/sound/soc/meson/t9015.c
>>>>>>>>> +++ b/sound/soc/meson/t9015.c
>>>>>>>>> @@ -89,10 +89,7 @@ static struct snd_soc_dai_driver t9015_dai = {
>>>>>>>>>                  .channels_min = 1,
>>>>>>>>>                  .channels_max = 2,
>>>>>>>>>                  .rates = SNDRV_PCM_RATE_8000_96000,
>>>>>>>>> -             .formats = (SNDRV_PCM_FMTBIT_S8 |
>>>>>>>>> -                         SNDRV_PCM_FMTBIT_S16_LE |
>>>>>>>>> -                         SNDRV_PCM_FMTBIT_S20_LE |
>>>>>>>>> - SNDRV_PCM_FMTBIT_S24_LE),
>>>>>>>>> +             .formats = (SNDRV_PCM_FMTBIT_S16_LE |
>>>>>>>>> SNDRV_PCM_FMTBIT_S32_LE),
>>>>>>>> Again, mixed up changes with zero justification.
>>>>>>>>
>>>>>>>> This drops S8 and S16 format support for the existing SoCs 
>>>>>>>> (such as GXL)
>>>>>>>> which is known to work and add S32 support on an HW documented 
>>>>>>>> as 24bits
>>>>>>>> only. Can you explain ?
>>>>>> for g12a, sm1 etc, it is use new audio ip, GXL is old ip,
>>>>> If there are chips difference we did not know about, then you should
>>>>> introduce those difference, without breaking existing support -
>>>>> including for GXL, which is what you did IIUC.
>>>>>
>>>>>> the new ip not support 24 bit,
>>>>> Are sure about that ? that code has been there for a while.
>>>>>
>>>>> If sm1 does not support SNDRV_PCM_FMTBIT_S24_LE, you should a fix 
>>>>> up patch for
>>>>> that, with the proper "Fixes:" tag, how to reproduce the problem and
>>>>> explaining the fix.

At first I thought you said 24bit is s24_3le, becasue of the fddr can't 
get it,

so  spend a lot of time trying to explain it

I think it may be because of this difference that we are not focused on 
the same problem

yes, we support s24_le,  the internal codec also process it 24 bit of 32 
bit,

if we send valid 32bit data, it only process 24bit, discard 8 bit data, 
if this behavior should be prohibit

we will follow this rule

>>>> maybe there are some gap , we support SNDRV_PCM_FMTBIT_S24, not 
>>>> support the
>>>>
>>>> SNDRV_PCM_FMTBIT_S24_3LE,  for SNDRV_PCM_FMTBIT_S24
>>>>
>>>> it is  Signed, 24-bit (32-bit in memory), little endian , the audio 
>>>> dma
>>>> busrt is 64bit
>>> It makes absolutely no sense to discuss memory layout for the codec.
>>>
>>>> it can get the full data. we send the 32 bit data  mclk = 32bit* 
>>>> 48k *4,
>>>> use the clk to send
>>>>
>>>> the  SNDRV_PCM_FMTBIT_S24,   the hadware always send the 32bit data
>>> No it does not. It send 24 bits of data over a 32 bits physical word 
>>> with
>>> 8 bits ignored.
>>
>> The original intention, we play 32bit data from tdmout, it play 
>> error, so we add the s32_le
>>
>> for tdmouta ,it can bind Multiple codec, one codec is the internal 
>> codec,
>>
>> other is external codec, tdmout can send the data to internal codec 
>> and external codec from the output pad
>>
>> for example, tdmout send 4 ch, 2 ch is send the internal codec, 2 ch 
>> send the data pad
>>
>> it aplay error, due to the internal codec fomat parameter limiting 
>> condition
>>
>> There is a contradiction here,  Considering our internal codec can 
>> process this it, drop 8bit, 24bit valid
>>
>> therefore software can set s24_le/s32_le, still  work ok for 
>> hardware, so Multiple ch can support for internal codec and external 
>> codec
>>
>>
> add the s32_le format for the t9015.c,  it can resovle Multiple codec 
> s32_le format case,  although hardware only process 24bit of 32bit, 
> but it can't affect the acodec hardware work, it still work fine
>
> usually we add the s32_le format support, if not allow to do it, think 
> of it as a limitation, we can  remove 32bit test for it
>
>>>
>>>> so, i think we only add the SNDRV_PCM_FMTBIT_S32 base on it
>>> That's wrong if the codec does not actually use the full 32bits ... and
>>> I have clear indication that's what the codec is doing, on GXL at 
>>> least.
>>>
>>>> we think the 24 bit is the SNDRV_PCM_FMTBIT_S24_3LE, it is 24bit in 
>>>> memroy,
>>>>
>>>> due to the dma busrt 64 bit limit, it can't align the sample bit, 
>>>> if it is
>>>> 24 bit
>>> Again, memory layout makes no sense here.
>>>
>>>> so the clock configure can't 24bit clock,
>>> I disagree and this has been tested. If you have a test case showing
>>> otherwise please share it.
>>>
>>>> by the way, We discuss internally for gxl,
>>>>
>>>> it also support the SNDRV_PCM_FMTBIT_S32
>>>>
>>> Does it really ? If it is just to ignore the 8bits LSB, that not a 
>>> support.
>>>
>>>>>> usually support 16/32 bit for new audio ip , for 
>>>>>> SNDRV_PCM_FMTBIT_S24_LE,
>>>>>> it width =24, phy =32
>>>>> Yes physical of SNDRV_PCM_FMTBIT_S24_LE, so most chip supporting 
>>>>> 32 bits
>>>>> width would support this S24_LE, unless there is something odd.
>>>>>
>>>>>> it was  treated as 32 bit to send for tdm, so we can only add the 
>>>>>> S32LE
>>>>>> base on it , right ?
>>>>> You are asking me ? How am I suppose to know ?
>>>>>
>>>>>> but if the gxl not support the 32bit
>>>>> I don't see a problem with a DAC taking input on 32bits physical
>>>>> interface and ignoring some bit on processing.
>>>>>
>>>>> If that's not the case, please send a proper fix change with some 
>>>>> explanation
>>>>>
>>>>>> we need add new snd_soc_dai_driver t9015_dai_s4 ?
>>>>>>
>>>>> If I understood correctly format depends on the chip and needs to
>>>>> adjusted including for sm1.
>>>>>
>>>>>>>>>          },
>>>>>>>>>          .ops = &t9015_dai_ops,
>>>>>>>>>     };
>>>>>>>> -- Jerome
>>>>> -- 
>>>>> Jerome
>>> -- 
>>> Jerome

