From patchwork Fri May 24 14:03:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 165124 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp3630148ili; Fri, 24 May 2019 07:03:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTBW+CEjkUbLizpCHW4BC4wBFhW4DydL28Km9EEzcnPj/OKFH+jTeDb+HSM5yY9z1dI3bJ X-Received: by 2002:a63:f922:: with SMTP id h34mr20086157pgi.230.1558706611292; Fri, 24 May 2019 07:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558706611; cv=none; d=google.com; s=arc-20160816; b=i2sQCPk1O3feAUnHzCX+DRqsXx1cG53xw4+CdsqctNsmT+NsXd9K7gJO/FhKVh0uhG D9IClqL/VHa1uy8Z593ZTniA59KNooyc6cSQaUax6NALjJCT/mcOpYbEQ2eWMpqfSRUA FrNeswRrL+UXPzqf4yW+maSOpkM3zfc4tcnU+3YlUlXSwE7um8mZTYFSOu6isbd6fRqk v3/JCiVvLDIhCoO2LxTRRRepNhrF6CvSrrdYkEI4JMg8aAQb1cE51/Gc0Xf4N/3oLHQn hZJF58r4dOx7Tzxznan45FFzpJihtpV73M/xYZQQiEuhP/636t1wm4X7aS3uikG+mriF BvSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=G/bTQ/ecWQ5ps1+vCCtFklRZsUYqapfXdu2OlnxEmEY=; b=iBIWFXELLrvKFSshIkF3HoaPWtFIUZrV/EaX3b8XbLbUNvh3gKVzlo8vcSHpxe1vEm Gf3Nel2Jt9Rh2fiCj4KfCvX/H3ILd5/APfIrsaKNEIGwsKh7+nRnrwi/rrG5iVjbb7Np fR/ZRsXSmktUo7jQo5gNzSEAZApIPjO3lwX86dhX6EgYo9FxE5lYq0T/IWOPxsYy0DV6 NhNtAO9YZep80307hQ6+OFstfx0oRMUBGGPC1sT+Vsrb9jzrI8Lmcu3XfXvejbnR75dR 1k21R6I1n2EHCs4BvPVkAzFXYShm11xae1nsLcUk0kbwAfrzZZa/rbokdbGj7uVilOGx cZ1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=AQ8NIukI; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si4495147pgt.52.2019.05.24.07.03.31; Fri, 24 May 2019 07:03:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=AQ8NIukI; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403964AbfEXOD2 (ORCPT + 7 others); Fri, 24 May 2019 10:03:28 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53176 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403864AbfEXOD1 (ORCPT ); Fri, 24 May 2019 10:03:27 -0400 Received: by mail-wm1-f65.google.com with SMTP id y3so9544091wmm.2 for ; Fri, 24 May 2019 07:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G/bTQ/ecWQ5ps1+vCCtFklRZsUYqapfXdu2OlnxEmEY=; b=AQ8NIukI4NzDXN4WjG4QXdnvkku3PgVux0BOEKbQf+rTn8OcmysE8CLGZjx+yxLnnd DgMeEzLVukI6CTD5ss+PFrqntLse16+kZ49JmEDnA/Zotg70eiyGFhy9bYbA/Xq5Okge NF3uiVyxD5PaPCig4NVKKOBZV2KAMwgK9s8x0fEVOnuECqgZNOI9jl/m6V+8BD/w6Rzz 3ZZNaQ96iYf/LrRZWph19CUyW7uq7jiRC7gndPszPtwTNcwqrCT7kl5vlFuDl0yAMzaz VPcaj1k0ouuCqWm6w1Xx7vsLoAE/j5Neir+RGucwyUMbKuc/NX+nH6uV/ZvAy+7uwcDI befw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G/bTQ/ecWQ5ps1+vCCtFklRZsUYqapfXdu2OlnxEmEY=; b=AJPm8gk86wa26YlaYlBWeTX0mCOMCHsy7VBdhfx3udorNe/C+xVDhLUJtFEAYJt/OC UTwDw7VkMxNRk7cTf0fZviienEJusFSqGRpFKUCdg4+RAf+w9q+xym71xA3swB4GGzhe B7uGqmmo2rlpXMULob0JtM5ojeXcfl6Kq3Szftr86JyeX2SfIwXCW8isc1zsMK/AQh/M wWMsMU8q7JSQqKz7isAxqinJv6vOZczeGZSwLZarhhQ5yTFqI1WWGdny/LOybCB2a6we k/5ljgxuBrpnp/NZoCSh2BYoR6eacQwF2b9Q8zN3p3hwlI8wz/gAsxXGoLB6vM4b4CpK ZxSA== X-Gm-Message-State: APjAAAX4t35E8ZaQ+idjlJqUDalCjouD92FdXXaRfEWEEwC1PqPtywq3 x0EWR40J86UUnxp9fm89Xx1Caw== X-Received: by 2002:a7b:c118:: with SMTP id w24mr23922wmi.158.1558706605414; Fri, 24 May 2019 07:03:25 -0700 (PDT) Received: from boomer.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id t7sm2797114wrq.76.2019.05.24.07.03.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2019 07:03:24 -0700 (PDT) From: Jerome Brunet To: Kevin Hilman Cc: Jerome Brunet , devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] arm64: dts: meson: sei510: add sound card Date: Fri, 24 May 2019 16:03:18 +0200 Message-Id: <20190524140318.17608-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190524140318.17608-1-jbrunet@baylibre.com> References: <20190524140318.17608-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Enable 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. Signed-off-by: Jerome Brunet --- .../boot/dts/amlogic/meson-g12a-sei510.dts | 202 +++++++++++++++++- 1 file changed, 201 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts index c6d032ed9a8b..9275df73c9f0 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts @@ -9,6 +9,7 @@ #include #include #include +#include / { 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>;