From 6bcbe437909d3779111e19774f911c625e98f1b3 Mon Sep 17 00:00:00 2001 From: Faiz Abbas Date: Thu, 10 Feb 2022 17:01:39 +0000 Subject: [PATCH] feat(morello): add support for I2S audio Add support for Morello I2S audio subsystem. This includes adding the audio formatter and I2S transmitter nodes and gluing them together with the hdmi codec using a simple sound card machine node. Change-Id: I3de4b06ef965c8e0555d074118b944fe6b4b78bb Signed-off-by: Anurag Koul Signed-off-by: Faiz Abbas --- fdts/morello-soc.dts | 50 +++++++++++++++++++++++++++++++++++++++++++- fdts/morello.dtsi | 9 +++++++- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/fdts/morello-soc.dts b/fdts/morello-soc.dts index 61b576382..9f996bd63 100644 --- a/fdts/morello-soc.dts +++ b/fdts/morello-soc.dts @@ -194,10 +194,12 @@ interrupts = ; clocks = <&dpu_aclk>; - hdmi-transmitter@70 { + hdmi_tx: hdmi-transmitter@70 { compatible = "nxp,tda998x"; reg = <0x70>; video-ports = <0x234501>; + #sound-dai-cells = <0>; + audio-ports = <2 0x03>; port { tda998x_0_input: endpoint { remote-endpoint = <&dp_pl0_out0>; @@ -255,6 +257,52 @@ }; }; }; + + iofpga_i2s: xlnx-i2s@1c150000 { + #sound-dai-cells = <0>; + compatible = "xlnx,i2s-transmitter-1.0"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x1c150000 0x0 0x10000>; + xlnx,dwidth = <0x18>; + xlnx,num-channels = <1>; + }; + + audio_formatter: audio-formatter@1c100000 { + compatible = "xlnx,audio-formatter-1.0"; + reg = <0x0 0x1c000000 0x0 0x10000>; + #sound-dai-cells = <0>; + interrupt-names = "irq_mm2s"; + interrupts = ; + clock-names = "s_axi_lite_aclk", "aud_mclk", "m_axis_mm2s_aclk"; + clocks = <&soc_refclk85mhz>, <&i2s_audclk>, <&soc_refclk85mhz>; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&audio_master>; + simple-audio-card,frame-master = <&audio_master>; + audio_master: simple-audio-card,cpu { + sound-dai = <&iofpga_i2s>; + clocks = <&i2s_audclk>; + }; + + simple-audio-card,codec { + sound-dai = <&hdmi_tx>; + }; + + simple-audio-card,plat { + sound-dai = <&audio_formatter>; + }; + }; + + i2s_audclk: i2s_audclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12288000>; + clock-output-names = "iofpga:i2s_audclk"; + }; }; &gic { diff --git a/fdts/morello.dtsi b/fdts/morello.dtsi index 20640c5c9..7f39d75e9 100644 --- a/fdts/morello.dtsi +++ b/fdts/morello.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, Arm Limited. All rights reserved. + * Copyright (c) 2020-2023, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -88,6 +88,13 @@ clock-output-names = "apb_pclk"; }; + soc_refclk85mhz: refclk85mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <85000000>; + clock-output-names = "iofpga:aclk"; + }; + soc_uartclk: uartclk { compatible = "fixed-clock"; #clock-cells = <0>;