Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2078282ybb; Thu, 2 Apr 2020 12:39:30 -0700 (PDT) X-Google-Smtp-Source: APiQypJHgpNu33Vn9uPhg2aldazKej2sEXpMW0IiWoWGrOMcdFkdMJnC99dviSR/ir29Nv1s38ZE X-Received: by 2002:aca:7512:: with SMTP id q18mr510947oic.71.1585856369972; Thu, 02 Apr 2020 12:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585856369; cv=none; d=google.com; s=arc-20160816; b=w7Ubvq17hG6QBZnRRDKU8OI86isRMNCs4Iwd0TG17gh7ZsEq83L44CU4Un5UUdey09 BWk3OfSOx4ISMn4Thd1vHx8coALtbuLqhqxviNvriX3IF3l0QR17NrH0ZU8ck0oijgJB N8xtiM66aB6UJcFBgg1IuGRLvSIYvwXxbrnfxjMWJOkjnRYD2r68lnZ4BnXRm8HHQXKd Qgow1Pm5VnXOcd580Yx+NPWEEiQ/5EwmtuwNHXpLCiM2hrTiuaSNKo8D2mdmmHf1xu07 eD+Kfmt0BHOrUTKhiMgv+fxUrH4QzGzwu0SaviU6633BGqlebn3I+2D5RFImcfEZLmPR Hxrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date; bh=SHjzCIgH41CkAkrZKHArht36WbQHswVxh14aAwYcivg=; b=Uf+s2jGQ1LrIQFcNrwUsj6ZMZA+z9twZxHJLA5lJRVM/hJEqfWXhncBtZlRKB5yx87 X6hV0Npa2w9NQO9qaeOpuy2tBVcTzNgcBxlO5H44KfbKzl5rwi71u1igG5bHpbPq2jiN CG+EJw/ZgiJHSyi9exM+Yx5xWyXD7XQlK4Mh2699QWLYFDkC+sxNNhFuvVO3GGlBe/FW a3ryRU47gAYlT0Of14ZJwROk+NW293PhByLpTSLL3+mliHppi275JSlVlz+v1G9Z7Q2I Q2mg1IDdsyFHiWNApeKcAD2g438OCR4ehb3KRXLVprw+HFwqM5KVrfBgbQ+FLpECoWGg 5f2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 h59si2649272oth.233.2020.04.02.12.39.17; Thu, 02 Apr 2020 12:39:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389726AbgDBTUj (ORCPT + 99 others); Thu, 2 Apr 2020 15:20:39 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:55693 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389674AbgDBTUh (ORCPT ); Thu, 2 Apr 2020 15:20:37 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mwfeu-1j8iRq1ENO-00yAbN for ; Thu, 02 Apr 2020 21:20:36 +0200 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id BB9C46505D2 for ; Thu, 2 Apr 2020 19:20:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at cetitec.com Received: from mail.cetitecgmbh.com ([127.0.0.1]) by pflvmailgateway.corp.cetitec.com (pflvmailgateway.corp.cetitec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8hKHUg1nDWKM for ; Thu, 2 Apr 2020 21:20:35 +0200 (CEST) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id 1CF9564F51F for ; Thu, 2 Apr 2020 21:20:35 +0200 (CEST) Received: from pflmari.corp.cetitec.com (10.8.5.12) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Apr 2020 21:20:34 +0200 Received: by pflmari.corp.cetitec.com (Postfix, from userid 1000) id 4482E80506; Thu, 2 Apr 2020 20:35:13 +0200 (CEST) Date: Thu, 2 Apr 2020 20:35:13 +0200 From: Alex Riesen To: Kieran Bingham CC: Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , "Laurent Pinchart" , Rob Herring , Mark Rutland , Kuninori Morimoto , , , , , Subject: [PATCH v5 9/9] arm64: dts: renesas: salvator: add a connection from adv748x codec (HDMI input) to the R-Car SoC Message-ID: <90f2c14fcbe5d06eefdaeadbe8a6efc8c91523f3.1585852001.git.alexander.riesen@cetitec.com> Mail-Followup-To: Alex Riesen , Kieran Bingham , Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Rob Herring , Mark Rutland , Kuninori Morimoto , devel@driverdev.osuosl.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.8.5.12] X-ClientProxiedBy: PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) To PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) X-EsetResult: clean, is OK X-EsetId: 37303A290D7F536A6C7266 X-Provags-ID: V03:K1:rgq2HY6vGqgdqs5QP8+lY/u+ujAgjWJqNkR8TzEC/GoVPA52kw/ 7pnE3Mde6IiDdD/X1cGWs5xfph4+R0xNS9BFRJJ/SqOCykkF8ArcxVUIVKgl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@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As all known variants of the Salvator board have the HDMI decoder chip (the ADV7482) connected to the SSI4 on R-Car SoC, the ADV7482 endpoint and the connection definitions are placed in the common board file. For the same reason, the CLK_C clock line and I2C configuration (similar to the ak4613, on the same interface) are added into the common file. Signed-off-by: Alexander Riesen -- v5: Add dummy ssi4 node to the rcar sound card in r8a77961, as the devices (Salvator-X 2nd version with R-Car M3 W+) also reference salvator-common.dtsi. Suggested-by: Geert Uytterhoeven v2: Also add ssi4_ctrl pin group in the sound pins. The pins are responsible for SCK4 (sample clock) WS4 and (word boundary input), and are required for SSI audio input over I2S. The adv748x shall provide its own implementation of the output clock (MCLK), connected to the audio_clk_c line of the R-Car SoC. If the frequency of the ADV748x MCLK were fixed, the clock implementation were not necessary, but it does not seem so: the MCLK depends on the value in a speed multiplier register and the input sample rate (48kHz). Remove audio clock C from the clocks of adv7482. The clocks property of the video-receiver node lists the input clocks of the device, which is quite the opposite from the original intention: the adv7482 on Salvator X boards is a provide of the MCLK clock for I2S audio output. Remove old definition of &sound_card.dais and reduce size of changes in the Salvator-X specific device tree source. Declare video-receiver a clock producer, as the adv748x driver implements the master clock used I2S audio output. Suggested-by: Geert Uytterhoeven v2: The driver provides only MCLK clock, not the SCLK and LRCLK, which are part of the I2S protocol. Suggested-by: Laurent Pinchart --- .../boot/dts/renesas/r8a77950-salvator-x.dts | 3 +- arch/arm64/boot/dts/renesas/r8a77961.dtsi | 1 + .../boot/dts/renesas/salvator-common.dtsi | 47 +++++++++++++++++-- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts index 2438825c9b22..e16c146808b6 100644 --- a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts +++ b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts @@ -146,7 +146,8 @@ &sata { &sound_card { dais = <&rsnd_port0 /* ak4613 */ &rsnd_port1 /* HDMI0 */ - &rsnd_port2>; /* HDMI1 */ + &rsnd_port2 /* HDMI1 */ + &rsnd_port3>; /* adv7482 hdmi-in */ }; &usb2_phy2 { diff --git a/arch/arm64/boot/dts/renesas/r8a77961.dtsi b/arch/arm64/boot/dts/renesas/r8a77961.dtsi index be3824bda632..b79907beaf31 100644 --- a/arch/arm64/boot/dts/renesas/r8a77961.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a77961.dtsi @@ -861,6 +861,7 @@ rcar_sound,src { rcar_sound,ssi { ssi0: ssi-0 { }; ssi1: ssi-1 { }; + ssi4: ssi-4 { }; }; }; diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi index 98bbcafc8c0d..ead7f8d7a929 100644 --- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi +++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi @@ -460,7 +460,7 @@ pca9654: gpio@20 { #gpio-cells = <2>; }; - video-receiver@70 { + adv7482_hdmi_in: video-receiver@70 { compatible = "adi,adv7482"; reg = <0x70 0x71 0x72 0x73 0x74 0x75 0x60 0x61 0x62 0x63 0x64 0x65>; @@ -469,6 +469,7 @@ video-receiver@70 { #address-cells = <1>; #size-cells = <0>; + #clock-cells = <0>; /* the MCLK for I2S output */ interrupt-parent = <&gpio6>; interrupt-names = "intrq1", "intrq2"; @@ -510,6 +511,15 @@ adv7482_txb: endpoint { remote-endpoint = <&csi20_in>; }; }; + + port@c { + reg = <12>; + + adv7482_i2s: endpoint { + remote-endpoint = <&rsnd_endpoint3>; + system-clock-direction-out; + }; + }; }; csa_vdd: adc@7c { @@ -684,7 +694,8 @@ sdhi3_pins_uhs: sd3_uhs { }; sound_pins: sound { - groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a"; + groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data_a", + "ssi4_data", "ssi4_ctrl"; function = "ssi"; }; @@ -733,8 +744,8 @@ &rcar_sound { pinctrl-0 = <&sound_pins &sound_clk_pins>; pinctrl-names = "default"; - /* Single DAI */ - #sound-dai-cells = <0>; + /* multi DAI */ + #sound-dai-cells = <1>; /* audio_clkout0/1/2/3 */ #clock-cells = <1>; @@ -758,8 +769,19 @@ &rcar_sound { <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>, <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>, <&audio_clk_a>, <&cs2000>, - <&audio_clk_c>, + <&adv7482_hdmi_in>, <&cpg CPG_CORE CPG_AUDIO_CLK_I>; + clock-names = "ssi-all", + "ssi.9", "ssi.8", "ssi.7", "ssi.6", + "ssi.5", "ssi.4", "ssi.3", "ssi.2", + "ssi.1", "ssi.0", + "src.9", "src.8", "src.7", "src.6", + "src.5", "src.4", "src.3", "src.2", + "src.1", "src.0", + "mix.1", "mix.0", + "ctu.1", "ctu.0", + "dvc.0", "dvc.1", + "clk_a", "clk_b", "clk_c", "clk_i"; ports { #address-cells = <1>; @@ -777,6 +799,21 @@ rsnd_endpoint0: endpoint { capture = <&ssi1 &src1 &dvc1>; }; }; + rsnd_port3: port@3 { + reg = <3>; + rsnd_endpoint3: endpoint { + remote-endpoint = <&adv7482_i2s>; + + dai-tdm-slot-num = <8>; + dai-tdm-slot-width = <32>; + dai-format = "left_j"; + mclk-fs = <256>; + bitclock-master = <&adv7482_i2s>; + frame-master = <&adv7482_i2s>; + + capture = <&ssi4>; + }; + }; }; }; -- 2.25.1.25.g9ecbe7eb18