From patchwork Mon May 17 00:37:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12260755 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EA23C433B4 for ; Mon, 17 May 2021 00:37:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3451061090 for ; Mon, 17 May 2021 00:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229490AbhEQAiT (ORCPT ); Sun, 16 May 2021 20:38:19 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:49826 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229459AbhEQAiS (ORCPT ); Sun, 16 May 2021 20:38:18 -0400 Date: 17 May 2021 09:37:02 +0900 X-IronPort-AV: E=Sophos;i="5.82,306,1613401200"; d="scan'208";a="81491312" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 17 May 2021 09:37:02 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 4FDFA4142DF9; Mon, 17 May 2021 09:37:02 +0900 (JST) Message-ID: <87fsymci1d.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/3] arm64: dts: renesas: r8a77995: draak: Add R-Car Sound support User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Geert Uytterhoeven Cc: Magnus , linux-renesas-soc@vger.kernel.org, kazuya.mizuguchi.ks@renesas.com, yoshihiro.shimoda.uh@renesas.com, hoai.luu.ub@renesas.com, takeshi.kihara.df@renesas.com, harunobu.kurokawa.dn@renesas.com, khiem.nguyen.xt@renesas.com, hien.dang.eb@renesas.com In-Reply-To: <87k0nyci2t.wl-kuninori.morimoto.gx@renesas.com> References: <87k0nyci2t.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Kuninori Morimoto This patch adds R-Car Sound support for D3 draak. One note is that it is using different clock definition style from ulcb/salvator boards to avoid verbose clocks settings on rcar_sound node (see ulcb.dtsi rcar_sound::clocks). cs2000 and ADG are closs connected, and needs each other. ulcb/salvator boards assume drivers are probed cs2000 -> rcar_sound. This draak board assumes drivers are probed rcar_sound -> cs2000. Signed-off-by: Kuninori Morimoto --- .../arm64/boot/dts/renesas/r8a77995-draak.dts | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts index 6783c3ad0856..591fad289802 100644 --- a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts +++ b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts @@ -6,6 +6,11 @@ * Copyright (C) 2017 Glider bvba */ +/* + * This assumes... + * SW60 : 2-1 + */ + /dts-v1/; #include "r8a77995.dtsi" #include @@ -156,11 +161,25 @@ adv7123_out: endpoint { }; }; + sound_card: sound { + compatible = "audio-graph-card"; + + dais = <&rsnd_port0 /* ak4613 */ + /* HDMI is not yet supported */ + >; + }; + x12_clk: x12 { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <74250000>; }; + + x19_clk: x19 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24576000>; + }; }; &avb { @@ -347,6 +366,39 @@ eeprom@50 { reg = <0x50>; pagesize = <8>; }; + + ak4613: codec@10 { + compatible = "asahi-kasei,ak4613"; + #sound-dai-cells = <0>; + reg = <0x10>; + clocks = <&rcar_sound 0>; /* audio_clkout */ + + asahi-kasei,in1-single-end; + asahi-kasei,in2-single-end; + asahi-kasei,out1-single-end; + asahi-kasei,out2-single-end; + asahi-kasei,out3-single-end; + asahi-kasei,out4-single-end; + asahi-kasei,out5-single-end; + asahi-kasei,out6-single-end; + + port { + ak4613_endpoint: endpoint { + remote-endpoint = <&rsnd_for_ak4613>; + }; + }; + }; + + cs2000: clk-multiplier@4f { + #clock-cells = <0>; + compatible = "cirrus,cs2000-cp"; + reg = <0x4f>; + clocks = <&rcar_sound 1>, <&x19_clk>; /* audio_clkout_1, x19 */ + clock-names = "clk_in", "ref_clk"; + + assigned-clocks = <&cs2000>; + assigned-clock-rates = <24576000>; /* 1/1 divide */ + }; }; &i2c1 { @@ -391,6 +443,46 @@ &ohci0 { status = "okay"; }; +&audio_clk_a { + /* same as cs2000 */ + clock-frequency = <24576000>; +}; + +&audio_clk_b { + clock-frequency = <22579200>; +}; + +&rcar_sound { + pinctrl-0 = <&sound_pins>, <&sound_clk_pins>; + pinctrl-names = "default"; + + /* Single DAI */ + #sound-dai-cells = <0>; + + /* audio_clkout0/1 */ + #clock-cells = <1>; + clock-frequency = <12288000 11289600>; + + status = "okay"; + + ports { + rsnd_port0: port { + rsnd_for_ak4613: endpoint { + remote-endpoint = <&ak4613_endpoint>; + dai-format = "left_j"; + bitclock-master = <&rsnd_for_ak4613>; + frame-master = <&rsnd_for_ak4613>; + playback = <&ssi3>, <&src5>, <&dvc0>; + capture = <&ssi4>, <&src6>, <&dvc1>; + }; + }; + }; +}; + +&ssi4 { + shared-pin; +}; + &pfc { avb0_pins: avb { groups = "avb0_link", "avb0_mdio", "avb0_mii"; @@ -449,6 +541,17 @@ sdhi2_pins_uhs: sd2_uhs { power-source = <1800>; }; + sound_pins: sound { + groups = "ssi34_ctrl", "ssi3_data", "ssi4_data_a"; + function = "ssi"; + }; + + sound_clk_pins: sound-clk { + groups = "audio_clk_a", "audio_clk_b", + "audio_clkout", "audio_clkout1"; + function = "audio_clk"; + }; + usb0_pins: usb0 { groups = "usb0"; function = "usb0";