* [PATCH v2 0/6] Enable audio on Amlogic A1 SoC family
@ 2025-03-09 18:21 Jan Dakinevich
2025-03-09 18:21 ` [PATCH v2 1/6] ASoC: dt-bindings: meson: meson-axg-audio-arb: claim support of " Jan Dakinevich
` (5 more replies)
0 siblings, 6 replies; 11+ messages in thread
From: Jan Dakinevich @ 2025-03-09 18:21 UTC (permalink / raw)
To: Jan Dakinevich, Conor Dooley, devicetree, Jerome Brunet,
Kevin Hilman, Krzysztof Kozlowski, Liam Girdwood, linux-amlogic,
linux-arm-kernel, linux-kernel, linux-sound, Mark Brown,
Martin Blumenstingl, Neil Armstrong, Philipp Zabel, Rob Herring
This series brings up the audio on Amlogic A1 SoC family and on Amlogic AD402
reference board.
Depends on [2][3][4]
Changes v1 [1] -> v2
- detached from v1's series (patches 16, 17, 18, 19, 20, 21, 23, 24, 25)
- use new names from updated clock controller
- don't use A1-specific compatibe for pure software components
- don't use link-name property
Links:
[1] https://lore.kernel.org/lkml/20240314232201.2102178-1-jan.dakinevich@salutedevices.com/
[2] https://lore.kernel.org/all/20250309180940.1322531-1-jan.dakinevich@salutedevices.com/
[3] https://lore.kernel.org/all/20250309181600.1322701-1-jan.dakinevich@salutedevices.com/
[4] https://lore.kernel.org/all/20250309181630.1322745-1-jan.dakinevich@salutedevices.com/
Jan Dakinevich (6):
ASoC: dt-bindings: meson: meson-axg-audio-arb: claim support of A1 SoC
family
ASoC: dt-bindings: meson: axg-fifo: claim support of A1 SoC family
ASoC: dt-bindings: meson: axg-pdm: claim support of A1 SoC family
ASoC: dt-bindings: meson: axg-tdm-formatters: claim support of A1 SoC
family
arm64: dts: meson: a1: add audio devices
arm64: dts: ad402: enable audio
.../reset/amlogic,meson-axg-audio-arb.yaml | 10 +-
.../bindings/sound/amlogic,axg-fifo.yaml | 8 +
.../bindings/sound/amlogic,axg-pdm.yaml | 1 +
.../sound/amlogic,axg-tdm-formatters.yaml | 22 +-
.../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 110 +++++
arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 443 ++++++++++++++++++
6 files changed, 583 insertions(+), 11 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/6] ASoC: dt-bindings: meson: meson-axg-audio-arb: claim support of A1 SoC family
2025-03-09 18:21 [PATCH v2 0/6] Enable audio on Amlogic A1 SoC family Jan Dakinevich
@ 2025-03-09 18:21 ` Jan Dakinevich
2025-03-11 19:28 ` Rob Herring (Arm)
2025-03-09 18:21 ` [PATCH v2 2/6] ASoC: dt-bindings: meson: axg-fifo: " Jan Dakinevich
` (4 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Jan Dakinevich @ 2025-03-09 18:21 UTC (permalink / raw)
To: Jan Dakinevich, Conor Dooley, devicetree, Jerome Brunet,
Kevin Hilman, Krzysztof Kozlowski, Liam Girdwood, linux-amlogic,
linux-arm-kernel, linux-kernel, linux-sound, Mark Brown,
Martin Blumenstingl, Neil Armstrong, Philipp Zabel, Rob Herring
Add "amlogic,meson-a1-audio-arb" compatible string alias to
"amlogic,meson-sm1-audio-arb".
Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
---
.../bindings/reset/amlogic,meson-axg-audio-arb.yaml | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.yaml b/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.yaml
index bc1d284785e1..57e977db029f 100644
--- a/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.yaml
+++ b/Documentation/devicetree/bindings/reset/amlogic,meson-axg-audio-arb.yaml
@@ -15,9 +15,13 @@ description: The Amlogic Audio ARB is a simple device which enables or disables
properties:
compatible:
- enum:
- - amlogic,meson-axg-audio-arb
- - amlogic,meson-sm1-audio-arb
+ oneOf:
+ - enum:
+ - amlogic,meson-axg-audio-arb
+ - amlogic,meson-sm1-audio-arb
+ - items:
+ - const: amlogic,meson-a1-audio-arb
+ - const: amlogic,meson-sm1-audio-arb
reg:
maxItems: 1
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 2/6] ASoC: dt-bindings: meson: axg-fifo: claim support of A1 SoC family
2025-03-09 18:21 [PATCH v2 0/6] Enable audio on Amlogic A1 SoC family Jan Dakinevich
2025-03-09 18:21 ` [PATCH v2 1/6] ASoC: dt-bindings: meson: meson-axg-audio-arb: claim support of " Jan Dakinevich
@ 2025-03-09 18:21 ` Jan Dakinevich
2025-03-11 19:28 ` Rob Herring (Arm)
2025-03-09 18:21 ` [PATCH v2 3/6] ASoC: dt-bindings: meson: axg-pdm: " Jan Dakinevich
` (3 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Jan Dakinevich @ 2025-03-09 18:21 UTC (permalink / raw)
To: Jan Dakinevich, Conor Dooley, devicetree, Jerome Brunet,
Kevin Hilman, Krzysztof Kozlowski, Liam Girdwood, linux-amlogic,
linux-arm-kernel, linux-kernel, linux-sound, Mark Brown,
Martin Blumenstingl, Neil Armstrong, Philipp Zabel, Rob Herring
Add "amlogic,a1-toddr" and "amlogic,a1-frddr" compatible string aliases
to "amlogic,sm1-toddr" and "amlogic,sm1-frddr" respectevely.
Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
---
.../devicetree/bindings/sound/amlogic,axg-fifo.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml b/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml
index b1b48d683101..1e809c7c2179 100644
--- a/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml
+++ b/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml
@@ -25,6 +25,14 @@ properties:
- amlogic,g12a-frddr
- amlogic,sm1-frddr
- const: amlogic,axg-frddr
+ - items:
+ - const: amlogic,a1-toddr
+ - const: amlogic,sm1-toddr
+ - const: amlogic,axg-toddr
+ - items:
+ - const: amlogic,a1-frddr
+ - const: amlogic,sm1-frddr
+ - const: amlogic,axg-frddr
reg:
maxItems: 1
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 3/6] ASoC: dt-bindings: meson: axg-pdm: claim support of A1 SoC family
2025-03-09 18:21 [PATCH v2 0/6] Enable audio on Amlogic A1 SoC family Jan Dakinevich
2025-03-09 18:21 ` [PATCH v2 1/6] ASoC: dt-bindings: meson: meson-axg-audio-arb: claim support of " Jan Dakinevich
2025-03-09 18:21 ` [PATCH v2 2/6] ASoC: dt-bindings: meson: axg-fifo: " Jan Dakinevich
@ 2025-03-09 18:21 ` Jan Dakinevich
2025-03-11 19:29 ` Rob Herring (Arm)
2025-03-09 18:21 ` [PATCH v2 4/6] ASoC: dt-bindings: meson: axg-tdm-formatters: " Jan Dakinevich
` (2 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Jan Dakinevich @ 2025-03-09 18:21 UTC (permalink / raw)
To: Jan Dakinevich, Conor Dooley, devicetree, Jerome Brunet,
Kevin Hilman, Krzysztof Kozlowski, Liam Girdwood, linux-amlogic,
linux-arm-kernel, linux-kernel, linux-sound, Mark Brown,
Martin Blumenstingl, Neil Armstrong, Philipp Zabel, Rob Herring
Add "amlogic,a1-pdm" compatible string alias to "amlogic,axg-pdm".
Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
---
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml b/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml
index df21dd72fc65..9b6cd9f03a0c 100644
--- a/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml
+++ b/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml
@@ -16,6 +16,7 @@ properties:
- enum:
- amlogic,g12a-pdm
- amlogic,sm1-pdm
+ - amlogic,a1-pdm
- const: amlogic,axg-pdm
- const: amlogic,axg-pdm
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 4/6] ASoC: dt-bindings: meson: axg-tdm-formatters: claim support of A1 SoC family
2025-03-09 18:21 [PATCH v2 0/6] Enable audio on Amlogic A1 SoC family Jan Dakinevich
` (2 preceding siblings ...)
2025-03-09 18:21 ` [PATCH v2 3/6] ASoC: dt-bindings: meson: axg-pdm: " Jan Dakinevich
@ 2025-03-09 18:21 ` Jan Dakinevich
2025-03-11 19:30 ` Rob Herring (Arm)
2025-03-09 18:21 ` [PATCH v2 5/6] arm64: dts: meson: a1: add audio devices Jan Dakinevich
2025-03-09 18:21 ` [PATCH v2 6/6] arm64: dts: ad402: enable audio Jan Dakinevich
5 siblings, 1 reply; 11+ messages in thread
From: Jan Dakinevich @ 2025-03-09 18:21 UTC (permalink / raw)
To: Jan Dakinevich, Conor Dooley, devicetree, Jerome Brunet,
Kevin Hilman, Krzysztof Kozlowski, Liam Girdwood, linux-amlogic,
linux-arm-kernel, linux-kernel, linux-sound, Mark Brown,
Martin Blumenstingl, Neil Armstrong, Philipp Zabel, Rob Herring
Add "amlogic,a1-tdmout" and "amlogic,a1-tdmin" compatible string aliases
to "amlogic,sm1-tdmout" and "amlogic,sm1-tdmin" respectevely.
Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
---
.../sound/amlogic,axg-tdm-formatters.yaml | 22 ++++++++++++-------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml b/Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml
index 719ca8fc98c7..154522488020 100644
--- a/Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml
+++ b/Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml
@@ -11,14 +11,20 @@ maintainers:
properties:
compatible:
- enum:
- - amlogic,g12a-tdmout
- - amlogic,sm1-tdmout
- - amlogic,axg-tdmout
- - amlogic,g12a-tdmin
- - amlogic,sm1-tdmin
- - amlogic,axg-tdmin
-
+ oneOf:
+ - enum:
+ - amlogic,g12a-tdmout
+ - amlogic,sm1-tdmout
+ - amlogic,axg-tdmout
+ - amlogic,g12a-tdmin
+ - amlogic,sm1-tdmin
+ - amlogic,axg-tdmin
+ - items:
+ - const: amlogic,a1-tdmout
+ - const: amlogic,sm1-tdmout
+ - items:
+ - const: amlogic,a1-tdmin
+ - const: amlogic,sm1-tdmin
clocks:
items:
- description: Peripheral clock
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 5/6] arm64: dts: meson: a1: add audio devices
2025-03-09 18:21 [PATCH v2 0/6] Enable audio on Amlogic A1 SoC family Jan Dakinevich
` (3 preceding siblings ...)
2025-03-09 18:21 ` [PATCH v2 4/6] ASoC: dt-bindings: meson: axg-tdm-formatters: " Jan Dakinevich
@ 2025-03-09 18:21 ` Jan Dakinevich
2025-03-09 18:21 ` [PATCH v2 6/6] arm64: dts: ad402: enable audio Jan Dakinevich
5 siblings, 0 replies; 11+ messages in thread
From: Jan Dakinevich @ 2025-03-09 18:21 UTC (permalink / raw)
To: Jan Dakinevich, Conor Dooley, devicetree, Jerome Brunet,
Kevin Hilman, Krzysztof Kozlowski, Liam Girdwood, linux-amlogic,
linux-arm-kernel, linux-kernel, linux-sound, Mark Brown,
Martin Blumenstingl, Neil Armstrong, Philipp Zabel, Rob Herring
This commit adds the declarartion of currently supported audio devices
and their pins found Amlog A1 SoC family. SPDIF declaration is missing
here becase there are no publicly available boards with it.
Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
---
arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 443 ++++++++++++++++++++++
1 file changed, 443 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index cf0247fce740..b09df1da81c3 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -11,6 +11,9 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/power/meson-a1-power.h>
#include <dt-bindings/reset/amlogic,meson-a1-reset.h>
+#include <dt-bindings/reset/amlogic,meson-a1-audio-reset.h>
+#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
+#include <dt-bindings/sound/meson-g12a-toacodec.h>
/ {
compatible = "amlogic,a1";
@@ -465,6 +468,250 @@ mux {
function = "spif";
};
};
+
+ tdm_a_din0_pins: tdm-a-din0 {
+ mux {
+ groups = "tdm_a_din0";
+ function = "tdm_a";
+ bias-disable;
+ };
+ };
+
+ tdm_a_din1_pins: tdm-a-din1 {
+ mux {
+ groups = "tdm_a_din1";
+ function = "tdm_a";
+ bias-disable;
+ };
+ };
+
+ tdm_a_dout0_pins: tdm-a-dout0 {
+ mux {
+ groups = "tdm_a_dout0";
+ function = "tdm_a";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_a_dout1_pins: tdm-a-dout1 {
+ mux {
+ groups = "tdm_a_dout1";
+ function = "tdm_a";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_a_fs_pins: tdm-a-fs {
+ mux {
+ groups = "tdm_a_fs";
+ function = "tdm_a";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_a_sclk_pins: tdm-a-sclk {
+ mux {
+ groups = "tdm_a_sclk";
+ function = "tdm_a";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_a_slv_fs_pins: tdm-a-slv-fs {
+ mux {
+ groups = "tdm_a_slv_fs";
+ function = "tdm_a";
+ bias-disable;
+ };
+ };
+
+ tdm_a_slv_sclk_pins: tdm-a-slv-sclk {
+ mux {
+ groups = "tdm_a_slv_sclk";
+ function = "tdm_a";
+ bias-disable;
+ };
+ };
+
+ tdm_b_din0_pins: tdm-b-din0 {
+ mux {
+ groups = "tdm_b_din0";
+ function = "tdm_b";
+ bias-disable;
+ };
+ };
+
+ tdm_b_din1_pins: tdm-b-din1 {
+ mux {
+ groups = "tdm_b_din1";
+ function = "tdm_b";
+ bias-disable;
+ };
+ };
+
+ tdm_b_din2_pins: tdm-b-din2 {
+ mux {
+ groups = "tdm_b_din2";
+ function = "tdm_b";
+ bias-disable;
+ };
+ };
+
+ tdm_b_dout0_pins: tdm-b-dout0 {
+ mux {
+ groups = "tdm_b_dout0";
+ function = "tdm_b";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_b_dout1_pins: tdm-b-dout1 {
+ mux {
+ groups = "tdm_b_dout1";
+ function = "tdm_b";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_b_dout2_pins: tdm-b-dout2 {
+ mux {
+ groups = "tdm_b_dout2";
+ function = "tdm_b";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_b_dout3_pins: tdm-b-dout3 {
+ mux {
+ groups = "tdm_b_dout3";
+ function = "tdm_b";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_b_dout4_pins: tdm-b-dout4 {
+ mux {
+ groups = "tdm_b_dout4";
+ function = "tdm_b";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_b_dout5_pins: tdm-b-dout5 {
+ mux {
+ groups = "tdm_b_dout5";
+ function = "tdm_b";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_b_fs_pins: tdm-b-fs {
+ mux {
+ groups = "tdm_b_fs";
+ function = "tdm_b";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_b_sclk_pins: tdm-b-sclk {
+ mux {
+ groups = "tdm_b_sclk";
+ function = "tdm_b";
+ bias-disable;
+ drive-strength-microamp = <3000>;
+ };
+ };
+
+ tdm_b_slv_fs_pins: tdm-b-slv-fs {
+ mux {
+ groups = "tdm_b_slv_fs";
+ function = "tdm_b";
+ bias-disable;
+ };
+ };
+
+ tdm_b_slv_sclk_pins: tdm-b-slv-sclk {
+ mux {
+ groups = "tdm_b_slv_sclk";
+ function = "tdm_b";
+ bias-disable;
+ };
+ };
+
+ pdm_din0_a_pins: pdm-din0-a {
+ mux {
+ groups = "pdm_din0_a";
+ function = "pdm";
+ bias-disable;
+ };
+ };
+
+ pdm_din0_x_pins: pdm-din0-x {
+ mux {
+ groups = "pdm_din0_x";
+ function = "pdm";
+ bias-disable;
+ };
+ };
+
+ pdm_din1_a_pins: pdm-din1-a {
+ mux {
+ groups = "pdm_din1_a";
+ function = "pdm";
+ bias-disable;
+ };
+ };
+
+ pdm_din1_x_pins: pdm-din1-x {
+ mux {
+ groups = "pdm_din1_x";
+ function = "pdm";
+ bias-disable;
+ };
+ };
+
+ pdm_din2_a_pins: pdm-din2-a {
+ mux {
+ groups = "pdm_din2_a";
+ function = "pdm";
+ bias-disable;
+ };
+ };
+
+ pdm_din2_x_pins: pdm-din2-x {
+ mux {
+ groups = "pdm_din2_x";
+ function = "pdm";
+ bias-disable;
+ };
+ };
+
+ pdm_dclk_a_pins: pdm-dclk-a {
+ mux {
+ groups = "pdm_dclk_a";
+ function = "pdm";
+ bias-disable;
+ };
+ };
+
+ pdm_dclk_x_pins: pdm-dclk-x {
+ mux {
+ groups = "pdm_dclk_x";
+ function = "pdm";
+ bias-disable;
+ };
+ };
};
gpio_intc: interrupt-controller@440 {
@@ -666,6 +913,17 @@ sd_emmc: mmc@10000 {
status = "disabled";
};
+ acodec: audio-controller@4800 {
+ compatible = "amlogic,t9015-a1";
+ reg = <0x0 0x4800 0x0 0x14>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "ACODEC";
+ clocks = <&clkc_periphs CLKID_AUDIO>;
+ clock-names = "pclk";
+ resets = <&reset RESET_ACODEC>;
+ power-domains = <&pwrc PWRC_ACODEC_ID>;
+ };
+
audio: bus@50000 {
compatible = "simple-bus";
#address-cells = <2>;
@@ -712,6 +970,171 @@ clkc_audio_vad: clock-controller@4800 {
"mst_in4";
resets = <&reset RESET_AUDIO_VAD>;
};
+
+ toddr_a: audio-controller@100 {
+ compatible = "amlogic,a1-toddr",
+ "amlogic,sm1-toddr",
+ "amlogic,axg-toddr";
+ reg = <0x0 0x100 0x0 0x2c>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "TODDR_A";
+ interrupts = <GIC_SPI 37 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 = <128>;
+ };
+
+ toddr_b: audio-controller@140 {
+ compatible = "amlogic,a1-toddr",
+ "amlogic,sm1-toddr",
+ "amlogic,axg-toddr";
+ reg = <0x0 0x140 0x0 0x2c>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "TODDR_B";
+ interrupts = <GIC_SPI 38 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 = <128>;
+ };
+
+ frddr_a: audio-controller@1c0 {
+ compatible = "amlogic,a1-frddr",
+ "amlogic,sm1-frddr",
+ "amlogic,axg-frddr";
+ reg = <0x0 0x1c0 0x0 0x2c>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "FRDDR_A";
+ interrupts = <GIC_SPI 40 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 = <128>;
+ };
+
+ frddr_b: audio-controller@200 {
+ compatible = "amlogic,a1-frddr",
+ "amlogic,sm1-frddr",
+ "amlogic,axg-frddr";
+ reg = <0x0 0x200 0x0 0x2c>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "FRDDR_B";
+ interrupts = <GIC_SPI 41 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 = <128>;
+ };
+
+ arb: reset-controller@280 {
+ compatible = "amlogic,meson-a1-audio-arb",
+ "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,a1-tdmin",
+ "amlogic,sm1-tdmin";
+ reg = <0x0 0x300 0x0 0x40>;
+ sound-name-prefix = "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";
+ resets = <&clkc_audio AUD_RESET_TDMIN_A>;
+ };
+
+ tdmin_b: audio-controller@340 {
+ compatible = "amlogic,a1-tdmin",
+ "amlogic,sm1-tdmin";
+ reg = <0x0 0x340 0x0 0x40>;
+ sound-name-prefix = "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";
+ resets = <&clkc_audio AUD_RESET_TDMIN_B>;
+ };
+
+ tdmin_lb: audio-controller@3c0 {
+ compatible = "amlogic,a1-tdmin",
+ "amlogic,sm1-tdmin";
+ reg = <0x0 0x3c0 0x0 0x40>;
+ sound-name-prefix = "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";
+ resets = <&clkc_audio AUD_RESET_TDMIN_LB>;
+ };
+
+ tdmout_a: audio-controller@500 {
+ compatible = "amlogic,a1-tdmout",
+ "amlogic,sm1-tdmout";
+ reg = <0x0 0x500 0x0 0x40>;
+ sound-name-prefix = "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";
+ resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
+ };
+
+ tdmout_b: audio-controller@540 {
+ compatible = "amlogic,a1-tdmout",
+ "amlogic,sm1-tdmout";
+ reg = <0x0 0x540 0x0 0x40>;
+ sound-name-prefix = "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";
+ resets = <&clkc_audio AUD_RESET_TDMOUT_B>;
+ };
+
+ toacodec: audio-controller@740 {
+ compatible = "amlogic,a1-toacodec",
+ "amlogic,g12a-toacodec";
+ reg = <0x0 0x740 0x0 0x4>;
+ #sound-dai-cells = <1>;
+ sound-name-prefix = "TOACODEC";
+ resets = <&clkc_audio AUD_RESET_TOACODEC>;
+ };
+
+ pdm: audio-controller@1000 {
+ compatible = "amlogic,a1-pdm",
+ "amlogic,axg-pdm";
+ reg = <0x0 0x1000 0x0 0x34>;
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "PDM";
+ clocks = <&clkc_audio_vad AUD_VAD_CLKID_PDM>,
+ <&clkc_audio_vad AUD_VAD_CLKID_PDM_DCLK>,
+ <&clkc_audio_vad AUD_VAD_CLKID_PDM_SYSCLK>;
+ clock-names = "pclk", "dclk", "sysclk";
+ power-domains = <&pwrc PWRC_PDMIN_ID>;
+ };
};
};
@@ -794,4 +1217,24 @@ xtal: xtal-clk {
clock-output-names = "xtal";
#clock-cells = <0>;
};
+
+ 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_SCLK>,
+ <&clkc_audio AUD_CLKID_MST_A_LRCLK>,
+ <&clkc_audio AUD_CLKID_MST_A_MCLK>;
+ clock-names = "sclk", "lrclk", "mclk";
+ };
+
+ 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_SCLK>,
+ <&clkc_audio AUD_CLKID_MST_B_LRCLK>,
+ <&clkc_audio AUD_CLKID_MST_B_MCLK>;
+ clock-names = "sclk", "lrclk", "mclk";
+ };
};
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 6/6] arm64: dts: ad402: enable audio
2025-03-09 18:21 [PATCH v2 0/6] Enable audio on Amlogic A1 SoC family Jan Dakinevich
` (4 preceding siblings ...)
2025-03-09 18:21 ` [PATCH v2 5/6] arm64: dts: meson: a1: add audio devices Jan Dakinevich
@ 2025-03-09 18:21 ` Jan Dakinevich
5 siblings, 0 replies; 11+ messages in thread
From: Jan Dakinevich @ 2025-03-09 18:21 UTC (permalink / raw)
To: Jan Dakinevich, Conor Dooley, devicetree, Jerome Brunet,
Kevin Hilman, Krzysztof Kozlowski, Liam Girdwood, linux-amlogic,
linux-arm-kernel, linux-kernel, linux-sound, Mark Brown,
Martin Blumenstingl, Neil Armstrong, Philipp Zabel, Rob Herring
* playback to speaker
- setup:
$ amixer set "FRDDR_A SINK 1 SEL" "OUT 0"
$ amixer set "FRDDR_A SRC 1 EN" "on"
$ amixer set "TDMOUT_A SRC SEL" "IN 0"
$ amixer set "TOACODEC Source" "I2S A"
$ amixer set "TOACODEC Lane Select" "0"
$ amixer set "TOACODEC EN" "on"
$ amixer set "ACODEC" "70%"
$ amixer set "ACODEC Playback Channel Mode" "Mono"
- usage:
$ aplay -D hw:0,0 -f S16_LE -r 48000 /path/to/sample.wav
* capture from digital mics
- setup:
$ amixer set "TODDR_B SRC SEL" "IN 4"
- usage:
$ arecord -D hw:0,1 -f S32_LE -r 48000 -c 2 -t wav /path/to/sample.wav
* capture from analog mics
- setup:
$ amixer set "TDMIN_A SRC SEL" "IN 3"
$ amixer set "TODDR_A SRC SEL" "IN 0"
$ amixer set "TOACODEC Source" "I2S A"
$ amixer set "TOACODEC Lane Select" "0"
$ amixer set "TOACODEC EN" "on"
$ amixer set "ACODEC ADC" "70%"
$ amixer set "ACODEC ADC Filter" "on"
$ amixer set "ACODEC ADC Filter Mode" "HiFi"
$ amixer set "ACODEC ADC PGA" "50%"
- usage:
$ arecord -D hw:0,2 -f S16_LE -r 48000 -c 2 -t wav /path/to/sample.wav
* capture from TDM loopback
- setup:
$ amixer set "TDMIN_LB SRC SEL" "IN 0"
$ amixer set "TODDR_B SRC SEL" "IN 6"
- usage:
$ arecord -D hw:0,1 -f S16_LE -r 48000 -c 2 -t wav /path/to/sample.wav
or
- setup:
$ amixer set "TDMIN_LB SRC SEL" "IN 0"
$ amixer set "TODDR_A SRC SEL" "IN 6"
- usage:
$ arecord -D hw:0,2 -f S16_LE -r 48000 -c 2 -t wav /path/to/sample.wav
Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
.../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 110 ++++++++++++++++++
1 file changed, 110 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
index 0d92f5253b64..09a5732f0981 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
@@ -9,6 +9,8 @@
#include "meson-a1.dtsi"
#include <dt-bindings/thermal/thermal.h>
+#include <dt-bindings/gpio/gpio.h>
+
/ {
compatible = "amlogic,ad402", "amlogic,a1";
model = "Amlogic Meson A1 AD402 Development Board";
@@ -128,6 +130,98 @@ map1 {
};
};
};
+
+ amplifier: amplifier {
+ compatible = "simple-audio-amplifier";
+ sound-name-prefix = "AMPLIFIER";
+ enable-gpios = <&gpio GPIOF_4 GPIO_ACTIVE_HIGH>;
+ VCC-supply = <&battery_4v2>;
+ };
+
+ dmics: dmics {
+ compatible = "dmic-codec";
+ #sound-dai-cells = <0>;
+ sound-name-prefix = "MIC";
+ num-channels = <4>;
+ wakeup-delay-ms = <50>;
+ };
+
+ sound {
+ compatible = "amlogic,axg-sound-card";
+ model = "AD402";
+ audio-aux-devs = <&tdmout_a>,
+ <&lifier>,
+ <&tdmin_lb>,
+ <&tdmin_a>;
+ audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
+ "TDM_A Playback", "TDMOUT_A OUT",
+ "AMPLIFIER INL", "ACODEC LOLP",
+ "AMPLIFIER INR", "ACODEC LORP",
+
+ "TODDR_B IN 4", "PDM Capture",
+
+ "TDMIN_LB IN 0", "TDM_A Loopback",
+ "TODDR_A IN 6", "TDMIN_LB OUT",
+ "TODDR_B IN 6", "TDMIN_LB OUT",
+
+ "TDMIN_A IN 3", "TDM_A Capture",
+ "TODDR_A IN 0", "TDMIN_A OUT";
+ assigned-clocks = <&clkc_pll CLKID_HIFI_PLL>;
+ assigned-clock-parents = <0>;
+ assigned-clock-rates = <1536000000>;
+
+ dai-link-0 {
+ sound-dai = <&frddr_a>;
+ };
+
+ dai-link-1 {
+ sound-dai = <&toddr_b>;
+ };
+
+ dai-link-2 {
+ sound-dai = <&toddr_a>;
+ };
+
+ dai-link-3 {
+ sound-dai = <&tdmif_a>;
+ dai-format = "i2s";
+ dai-tdm-slot-tx-mask-0 = <1 1>;
+ dai-tdm-slot-rx-mask-0 = <1 1>;
+ mclk-fs = <256>;
+
+ codec-0 {
+ sound-dai = <&toacodec TOACODEC_IN_A>;
+ };
+
+ codec-1 {
+ sound-dai = <&toacodec TOACODEC_CAPTURE_OUT_A>;
+ };
+ };
+
+ dai-link-4 {
+ sound-dai = <&toacodec TOACODEC_OUT>;
+
+ codec {
+ sound-dai = <&acodec>;
+ };
+ };
+
+ dai-link-5 {
+ sound-dai = <&toacodec TOACODEC_CAPTURE_IN>;
+
+ codec {
+ sound-dai = <&acodec>;
+ };
+ };
+
+ dai-link-6 {
+ sound-dai = <&pdm>;
+
+ codec {
+ sound-dai = <&dmics>;
+ };
+ };
+ };
};
/* Bluetooth HCI H4 */
@@ -190,3 +284,19 @@ &sd_emmc {
vmmc-supply = <&vddao_3v3>;
vqmmc-supply = <&vddio_1v8>;
};
+
+&acodec {
+ AVDD-supply = <&vddio_1v8>;
+ lineout-left = "right-inverted";
+ lineout-right = "right";
+ linein-left = "differential";
+ linein-right = "differential";
+ micbias = "2.5V";
+};
+
+&pdm {
+ pinctrl-0 = <&pdm_din0_a_pins>,
+ <&pdm_din1_a_pins>,
+ <&pdm_dclk_a_pins>;
+ pinctrl-names = "default";
+};
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/6] ASoC: dt-bindings: meson: meson-axg-audio-arb: claim support of A1 SoC family
2025-03-09 18:21 ` [PATCH v2 1/6] ASoC: dt-bindings: meson: meson-axg-audio-arb: claim support of " Jan Dakinevich
@ 2025-03-11 19:28 ` Rob Herring (Arm)
0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring (Arm) @ 2025-03-11 19:28 UTC (permalink / raw)
To: Jan Dakinevich
Cc: Martin Blumenstingl, Liam Girdwood, Neil Armstrong, linux-kernel,
Krzysztof Kozlowski, Mark Brown, linux-sound, Kevin Hilman,
devicetree, Conor Dooley, Philipp Zabel, Jerome Brunet,
linux-amlogic, linux-arm-kernel
On Sun, 09 Mar 2025 21:21:22 +0300, Jan Dakinevich wrote:
> Add "amlogic,meson-a1-audio-arb" compatible string alias to
> "amlogic,meson-sm1-audio-arb".
>
> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
> ---
> .../bindings/reset/amlogic,meson-axg-audio-arb.yaml | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/6] ASoC: dt-bindings: meson: axg-fifo: claim support of A1 SoC family
2025-03-09 18:21 ` [PATCH v2 2/6] ASoC: dt-bindings: meson: axg-fifo: " Jan Dakinevich
@ 2025-03-11 19:28 ` Rob Herring (Arm)
0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring (Arm) @ 2025-03-11 19:28 UTC (permalink / raw)
To: Jan Dakinevich
Cc: Krzysztof Kozlowski, linux-arm-kernel, Conor Dooley,
Martin Blumenstingl, Neil Armstrong, Kevin Hilman, linux-amlogic,
Jerome Brunet, devicetree, linux-sound, linux-kernel,
Philipp Zabel, Liam Girdwood, Mark Brown
On Sun, 09 Mar 2025 21:21:23 +0300, Jan Dakinevich wrote:
> Add "amlogic,a1-toddr" and "amlogic,a1-frddr" compatible string aliases
> to "amlogic,sm1-toddr" and "amlogic,sm1-frddr" respectevely.
>
> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
> ---
> .../devicetree/bindings/sound/amlogic,axg-fifo.yaml | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/6] ASoC: dt-bindings: meson: axg-pdm: claim support of A1 SoC family
2025-03-09 18:21 ` [PATCH v2 3/6] ASoC: dt-bindings: meson: axg-pdm: " Jan Dakinevich
@ 2025-03-11 19:29 ` Rob Herring (Arm)
0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring (Arm) @ 2025-03-11 19:29 UTC (permalink / raw)
To: Jan Dakinevich
Cc: Conor Dooley, linux-arm-kernel, Mark Brown, Liam Girdwood,
Martin Blumenstingl, linux-sound, linux-amlogic, Kevin Hilman,
Jerome Brunet, Neil Armstrong, Philipp Zabel,
Krzysztof Kozlowski, linux-kernel, devicetree
On Sun, 09 Mar 2025 21:21:24 +0300, Jan Dakinevich wrote:
> Add "amlogic,a1-pdm" compatible string alias to "amlogic,axg-pdm".
>
> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
> ---
> Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 4/6] ASoC: dt-bindings: meson: axg-tdm-formatters: claim support of A1 SoC family
2025-03-09 18:21 ` [PATCH v2 4/6] ASoC: dt-bindings: meson: axg-tdm-formatters: " Jan Dakinevich
@ 2025-03-11 19:30 ` Rob Herring (Arm)
0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring (Arm) @ 2025-03-11 19:30 UTC (permalink / raw)
To: Jan Dakinevich
Cc: linux-amlogic, Conor Dooley, Martin Blumenstingl, Jerome Brunet,
devicetree, linux-kernel, Liam Girdwood, Philipp Zabel,
Kevin Hilman, Neil Armstrong, linux-sound, Mark Brown,
linux-arm-kernel, Krzysztof Kozlowski
On Sun, 09 Mar 2025 21:21:25 +0300, Jan Dakinevich wrote:
> Add "amlogic,a1-tdmout" and "amlogic,a1-tdmin" compatible string aliases
> to "amlogic,sm1-tdmout" and "amlogic,sm1-tdmin" respectevely.
>
> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
> ---
> .../sound/amlogic,axg-tdm-formatters.yaml | 22 ++++++++++++-------
> 1 file changed, 14 insertions(+), 8 deletions(-)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-03-11 19:30 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-09 18:21 [PATCH v2 0/6] Enable audio on Amlogic A1 SoC family Jan Dakinevich
2025-03-09 18:21 ` [PATCH v2 1/6] ASoC: dt-bindings: meson: meson-axg-audio-arb: claim support of " Jan Dakinevich
2025-03-11 19:28 ` Rob Herring (Arm)
2025-03-09 18:21 ` [PATCH v2 2/6] ASoC: dt-bindings: meson: axg-fifo: " Jan Dakinevich
2025-03-11 19:28 ` Rob Herring (Arm)
2025-03-09 18:21 ` [PATCH v2 3/6] ASoC: dt-bindings: meson: axg-pdm: " Jan Dakinevich
2025-03-11 19:29 ` Rob Herring (Arm)
2025-03-09 18:21 ` [PATCH v2 4/6] ASoC: dt-bindings: meson: axg-tdm-formatters: " Jan Dakinevich
2025-03-11 19:30 ` Rob Herring (Arm)
2025-03-09 18:21 ` [PATCH v2 5/6] arm64: dts: meson: a1: add audio devices Jan Dakinevich
2025-03-09 18:21 ` [PATCH v2 6/6] arm64: dts: ad402: enable audio Jan Dakinevich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®