arm64: dts: meson: sei510: add sound card
Subsystems (2)
Jerome Brunet
reviewercover arm64: dts: meson: sei510: add sound card
This patchset adds the sound card of sei510 board.
Note #1:
The patchset (build) depends on the tohdmitx ASoC patch [0] for the dt bindings of the tohdmitx glue. It also (run) depends on the mpll clock series [1] to get a correct clock sources.
Note #2:
I would normaly prefer to use the HIFI pll dedicated to audio to provide the base rate for the 48kHz audio family. HIFI pll rate precision is a little bit better than the MPLL. However, the HIFI pll may sometimes, rarely, take a long time to report a lock. I'm still debugging this. In the mean time, let's use MPLL2 instead.
[0]: e35f5ad6a965 ("ASoC: meson: add tohdmitx DT bindings") [1]: https://lkml.kernel.org/r/[email protected]
Jerome Brunet (1):
arm64: dts: meson: sei510: add sound card
Maxime Jourdan (1):
arm64: dts: meson: sei510: add max98357a DAC
.../boot/dts/amlogic/meson-g12a-sei510.dts | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+)
Signature · 1 line
2.20.1
Jerome Brunet
reviewerPATCH 1/2 arm64: dts: meson: sei510: add max98357a DAC
From: Maxime Jourdan <[email protected]>
The SEI510 board features a max98357a audio codec for built-in speaker
--- arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +7 -0
@@ -32,6 +32,13 @@ ethernet0 = ðmac; }; + mono_dac: audio-codec { + compatible = "maxim,max98357a"; + #sound-dai-cells = <0>; + sound-name-prefix = "U16"; + sdmode-gpios = <&gpio GPIOX_8 GPIO_ACTIVE_HIGH>; + }; + chosen { stdout-path = "serial0:115200n8"; };
Signature · 1 line
2.20.1
Jerome Brunet
reviewerPATCH 2/2 arm64: dts: meson: sei510: add sound card
In reply to Jerome BrunetEnable the sound card on the sei510:
* TDM interface A is connected to an external DAC and a speaker installed on the device.
* HDMI is expected to use TDM B. It can also use TDM A but will be limited to 2 channels, as accepted by the external DAC.
* 2 Built in PDM mics through the PDM interface.
* Both TDM outputs may use HW loopback.
The internal DAC connected to audio jack will be added later on, when driver support is added.
--- .../boot/dts/amlogic/meson-g12a-sei510.dts | 202 +++++++++++++++++- 1 file changed, 201 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +201 -1
@@ -9,6 +9,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/gpio/meson-g12a-gpio.h> +#include <dt-bindings/sound/meson-g12a-tohdmitx.h> / { compatible = "seirobotics,sei510", "amlogic,g12a";
@@ -32,13 +33,22 @@ ethernet0 = ðmac; }; - mono_dac: audio-codec { + mono_dac: audio-codec-0 { compatible = "maxim,max98357a"; #sound-dai-cells = <0>; sound-name-prefix = "U16"; sdmode-gpios = <&gpio GPIOX_8 GPIO_ACTIVE_HIGH>; }; + dmics: audio-codec-1 { + #sound-dai-cells = <0>; + compatible = "dmic-codec"; + num-channels = <2>; + wakeup-delay-ms = <50>; + status = "okay"; + sound-name-prefix = "MIC"; + }; + chosen { stdout-path = "serial0:115200n8"; };
@@ -135,6 +145,124 @@ no-map; }; }; + + sound { + compatible = "amlogic,axg-sound-card"; + model = "G12A-SEI510"; + audio-aux-devs = <&tdmout_a>, <&tdmout_b>, + <&tdmin_a>, <&tdmin_b>; + 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", + "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", + "TODDR_A IN 4", "PDM Capture", + "TODDR_B IN 4", "PDM Capture", + "TODDR_C IN 4", "PDM Capture", + "TDMIN_A IN 0", "TDM_A Capture", + "TDMIN_A IN 3", "TDM_A Loopback", + "TDMIN_B IN 0", "TDM_A Capture", + "TDMIN_B IN 3", "TDM_A Loopback", + "TDMIN_A IN 1", "TDM_B Capture", + "TDMIN_A IN 4", "TDM_B Loopback", + "TDMIN_B IN 1", "TDM_B Capture", + "TDMIN_B IN 4", "TDM_B 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"; + + assigned-clocks = <&clkc CLKID_MPLL2>, + <&clkc CLKID_MPLL0>, + <&clkc CLKID_MPLL1>; + assigned-clock-parents = <0>, <0>, <0>; + assigned-clock-rates = <294912000>, + <270950400>, + <393216000>; + status = "okay"; + + 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>; + }; + + /* internal speaker interface */ + dai-link-6 { + sound-dai = <&tdmif_a>; + dai-format = "i2s"; + dai-tdm-slot-tx-mask-0 = <1 1>; + mclk-fs = <256>; + + codec-0 { + sound-dai = <&mono_dac>; + }; + + codec-1 { + sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>; + }; + }; + + /* 8ch hdmi interface */ + dai-link-7 { + sound-dai = <&tdmif_b>; + 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 = <&tohdmitx TOHDMITX_I2S_IN_B>; + }; + }; + + /* internal digital mics */ + dai-link-8 { + sound-dai = <&pdm>; + + codec { + sound-dai = <&dmics>; + }; + }; + + /* hdmi glue */ + dai-link-9 { + sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; + + codec { + sound-dai = <&hdmi_tx>; + }; + }; + }; +}; + +&arb { + status = "okay"; }; &cec_AO {
@@ -151,6 +279,10 @@ hdmi-phandle = <&hdmi_tx>; }; +&clkc_audio { + status = "okay"; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>;
@@ -163,6 +295,18 @@ phy-mode = "rmii"; }; +&frddr_a { + status = "okay"; +}; + +&frddr_b { + status = "okay"; +}; + +&frddr_c { + status = "okay"; +}; + &hdmi_tx { status = "okay"; pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
@@ -181,6 +325,14 @@ pinctrl-names = "default"; }; +&pdm { + pinctrl-0 = <&pdm_din0_z_pins>, <&pdm_din1_z_pins>, + <&pdm_din2_z_pins>, <&pdm_din3_z_pins>, + <&pdm_dclk_z_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + &saradc { status = "okay"; vref-supply = <&vddio_ao1v8>;
@@ -223,6 +375,54 @@ vqmmc-supply = <&emmc_1v8>; }; +&tdmif_a { + pinctrl-0 = <&tdm_a_dout0_pins>, <&tdm_a_fs_pins>, <&tdm_a_sclk_pins>; + pinctrl-names = "default"; + status = "okay"; + + assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD0>, + <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD0>; + assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_A_SCLK>, + <&clkc_audio AUD_CLKID_MST_A_LRCLK>; + assigned-clock-rates = <0>, <0>; +}; + +&tdmif_b { + status = "okay"; +}; + +&tdmin_a { + status = "okay"; +}; + +&tdmin_b { + status = "okay"; +}; + +&tdmout_a { + status = "okay"; +}; + +&tdmout_b { + status = "okay"; +}; + +&toddr_a { + status = "okay"; +}; + +&toddr_b { + status = "okay"; +}; + +&toddr_c { + status = "okay"; +}; + +&tohdmitx { + status = "okay"; +}; + &uart_A { status = "okay"; pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
Signature · 1 line
2.20.1
Kevin Hilman
maintainerQuoted 14 lines · Jerome Brunet
This patchset adds the sound card of sei510 board.
Note #1:
The patchset (build) depends on the tohdmitx ASoC patch [0] for the dt bindings of the tohdmitx glue. It also (run) depends on the mpll clock series [1] to get a correct clock sources.Note #2:
I would normaly prefer to use the HIFI pll dedicated to audio to provide the base rate for the 48kHz audio family. HIFI pll rate precision is a little bit better than the MPLL. However, the HIFI pll may sometimes, rarely, take a long time to report a lock. I'm still debugging this. In the mean time, let's use MPLL2 instead.
Quoted 2 lines
[0]:
e35f5ad6a965("ASoC: meson: add tohdmitx DT bindings") [1]: https://lkml.kernel.org/r/[email protected]
All dependencies are merged or queued for v5.3, so queuing this for v5.3 also,
Kevin
Kevin Hilman
maintainerQuoted 6 lines · Jerome Brunet
This patchset adds the sound card of sei510 board.
Note #1:
The patchset (build) depends on the tohdmitx ASoC patch [0] for the dt bindings of the tohdmitx glue. It also (run) depends on the mpll clock series [1] to get a correct clock sources.
Queuing this for v5.3, but it's pending a stable tag/branch from ASoC maintainers. If that doesn't work out, I'll queue it up after v5.3-rc1.
Thanks,
Kevin