From patchwork Sat Feb 3 15:50:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Goger X-Patchwork-Id: 10198557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CE6EF60467 for ; Sat, 3 Feb 2018 15:50:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD3EA28FA9 for ; Sat, 3 Feb 2018 15:50:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0C2828FE0; Sat, 3 Feb 2018 15:50:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 16DA728FD7 for ; Sat, 3 Feb 2018 15:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=BaP6bHGa+BNCfmDLd/FNpPBmeaKwpRWwJVS2PH1ii2Q=; b=E+9E/Y9ye40o14H0UKx7H6nAcb x9KRXywxsrqP+Z5cHCrIYoiXZan+uWWIYMdY35/z3OY3elEbxcpgaK/+1XIYN6Eg6G65gRk6XOs6E vvgzU+fDjnc/3cnspWR5hvQlF6r9GTLx/PtaQLje8mUfm3JQJJbCPjBTemWGmKdmk2Cf/XUCv276S cJgEQu/GipNOzibHSwNBjqpiy+G4rdGB3sTURaMijjCFjC7wV9cD79KyS01XIsBAyYkzsOS/O7m5t qbPzL4EmIqwpbUTYmc44vJJsUFHT4riMJQR+P92pQuoiefQh7WQDxNIdvbEIpWmgYvQIwz64UVUN1 YIo8p5Ng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ei05c-0005SX-Oi; Sat, 03 Feb 2018 15:50:52 +0000 Received: from vegas.theobroma-systems.com ([144.76.126.164] helo=mail.theobroma-systems.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ei05Y-0005Qq-H5 for linux-rockchip@lists.infradead.org; Sat, 03 Feb 2018 15:50:50 +0000 Received: from [86.59.122.178] (port=54626 helo=blau.lan) by mail.theobroma-systems.com with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ei05Q-0004MC-Do; Sat, 03 Feb 2018 16:50:40 +0100 From: Klaus Goger To: linux-rockchip@lists.infradead.org Subject: [PATCH v2 2/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Date: Sat, 3 Feb 2018 16:50:16 +0100 Message-Id: <20180203155016.51909-3-klaus.goger@theobroma-systems.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180203155016.51909-1-klaus.goger@theobroma-systems.com> References: <20180203155016.51909-1-klaus.goger@theobroma-systems.com> X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Klaus Goger , linux-kernel@vger.kernel.org, Heiko Stuebner MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Enable the NXP SGTL5000 audio codec on the RK3399-Q7 EVK baseboard Haikou. The i2s0_2ch_bus definition is only done in the SoM dtsi as it is missing the LRCK_RX pin (that is used otherwise) and therefore not generic enough for the SoC dtsi. Signed-off-by: Klaus Goger --- Changes in v2: - reordered entries as suggested in review - removed a conflicting i2s definition in rk3399-puma-haikou.dts i2s0 was already enabled in rk3399-puma.dtsi as it should be, so reuse it and fix the incorrect rockchip,*-channels values - add a patch to the series that definies a generic i2s0-2ch-bus - overwrite the generic pin definition of i2s0-2ch-bus with a specific one used in the Haikou with RK3399-Q7 setup. .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 59 +++++++++++++++++++--- arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 25 +++++++++ 2 files changed, 76 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts index 9a7486058455..0e2fe2ae75ee 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts @@ -61,6 +61,24 @@ }; }; + i2s0_sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + simple-audio-card,name = "Haikou,I2S-codec"; + simple-audio-card,mclk-fs = <512>; + + simple-audio-card,codec { + clocks = <&sgtl5000_clk>; + sound-dai = <&sgtl5000>; + }; + + simple-audio-card,cpu { + bitclock-master; + frame-master; + sound-dai = <&i2s0>; + }; + }; + dc_12v: dc-12v { compatible = "regulator-fixed"; regulator-name = "dc_12v"; @@ -89,6 +107,28 @@ regulator-name = "vcc5v0_otg"; regulator-always-on; }; + + vdda_codec: vdda-codec { + compatible = "regulator-fixed"; + regulator-name = "vdda_codec"; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + vddd_codec: vddd-codec { + compatible = "regulator-fixed"; + regulator-name = "vddd_codec"; + regulator-boot-on; + regulator-min-microvolt = <1600000>; + regulator-max-microvolt = <1600000>; + }; + + sgtl5000_clk: sgtl5000-oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24576000>; + }; }; &i2c1 { @@ -110,6 +150,17 @@ &i2c4 { status = "okay"; clock-frequency = <400000>; + + sgtl5000: codec@0a { + compatible = "fsl,sgtl5000"; + reg = <0x0a>; + clocks = <&sgtl5000_clk>; + #sound-dai-cells = <0>; + VDDA-supply = <&vdda_codec>; + VDDIO-supply = <&vdda_codec>; + VDDD-supply = <&vddd_codec>; + status = "okay"; + }; }; &i2c6 { @@ -117,14 +168,6 @@ clock-frequency = <400000>; }; -&i2s0 { - status = "okay"; - rockchip,playback-channels = <8>; - rockchip,capture-channels = <8>; - #sound-dai-cells = <0>; - status = "okay"; -}; - &pcie_phy { status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi index 1fc5060d7027..fb57da126169 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi @@ -435,6 +435,14 @@ }; }; +&i2s0 { + pinctrl-0 = <&i2s0_2ch_bus>; + rockchip,playback-channels = <2>; + rockchip,capture-channels = <2>; + #sound-dai-cells = <0>; + status = "okay"; +}; + &io_domains { status = "okay"; bt656-supply = <&vcc_1v8>; @@ -461,6 +469,23 @@ }; }; + i2s0 { + /* + * As Q7 does not specify neither a global nor a RX clock for I2S these + * signals are not used. Furthermore I2S0_LRCK_RX is used as GPIO. + * Therefore we have to redefine the i2s0_2ch_bus definition to prevent + * conflicts. + */ + /delete-node/ i2s0_2ch_bus; + i2s0_2ch_bus: i2s0-2ch-bus { + rockchip,pins = + , + , + , + ; + }; + }; + leds { led_pin_module: led-module-gpio { rockchip,pins =