From 7f3c06daadf65fdb251a89fc4f6a50b08be34833 Mon Sep 17 00:00:00 2001 From: Chen Jiali Date: Mon, 23 Dec 2024 19:25:39 +0800 Subject: [PATCH] feat: amlogic: add radxa-zero-i2s-hifiberry-dac --- arch/arm64/boot/dts/amlogic/overlays/Makefile | 1 + .../overlays/radxa-zero-i2s-hifiberry-dac.dts | 67 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 arch/arm64/boot/dts/amlogic/overlays/radxa-zero-i2s-hifiberry-dac.dts diff --git a/arch/arm64/boot/dts/amlogic/overlays/Makefile b/arch/arm64/boot/dts/amlogic/overlays/Makefile index 97405af0..89f1621a 100644 --- a/arch/arm64/boot/dts/amlogic/overlays/Makefile +++ b/arch/arm64/boot/dts/amlogic/overlays/Makefile @@ -41,6 +41,7 @@ dtb-$(CONFIG_ARCH_MESON) += \ meson-g12-watchdog.dtbo \ radxa-zero-emmc-full-speed.dtbo \ radxa-zero-enable-vddio_c.dtbo \ + radxa-zero-i2s-hifiberry-dac.dtbo \ radxa-zero-led-8-off.dtbo \ radxa-zero-led-10-off.dtbo \ radxa-zero-spi-b-waveshare13.dtbo \ diff --git a/arch/arm64/boot/dts/amlogic/overlays/radxa-zero-i2s-hifiberry-dac.dts b/arch/arm64/boot/dts/amlogic/overlays/radxa-zero-i2s-hifiberry-dac.dts new file mode 100644 index 00000000..6f2c8c8b --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/overlays/radxa-zero-i2s-hifiberry-dac.dts @@ -0,0 +1,67 @@ +/dts-v1/; +/plugin/; + +#include +#include +#include + +/ { + metadata { + title = "Enable HiFiBerry DAC+ Light on TDMA"; + compatible = "radxa,zero"; + category = "audio"; + description = "Enable HiFiBerry DAC+ Light on TDMA."; + exclusive = "GPIOX_9", "GPIOX_10", "GPIOX_11", "tdmif_a"; + }; +}; + +&{/} { + pcm5102a_codec: pcm5102a-codec { + compatible = "ti,pcm5102a"; + #sound-dai-cells = <0>; + status = "okay"; + }; + + sound { + audio-aux-devs = <&tdmout_a>, <&tdmout_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"; + + dai-link@5 { + sound-dai = <&tdmif_a>; + dai-format = "i2s"; + dai-tdm-slot-tx-mask-0 = <1 1>; + mclk-fs = <256>; + + codec@0 { + sound-dai = <&pcm5102a_codec>; + }; + + codec@1 { + sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>; + }; + }; + }; +}; + +&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>; +}; + +&tdmout_a { + status = "okay"; +};