From patchwork Mon Feb 19 08:18:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Klaus Goger X-Patchwork-Id: 10227277 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 B485F60392 for ; Mon, 19 Feb 2018 08:23:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5A6E28930 for ; Mon, 19 Feb 2018 08:23:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9831C28987; Mon, 19 Feb 2018 08:23:21 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 0DA3B28930 for ; Mon, 19 Feb 2018 08:23:21 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=sEM3IIy/HqlenDBLe7bnypm4+H4VyKMfTadtQENKPJI=; b=jEL/QaTvIFDFeA Umz4AuoTIxUK3WjwA8mcDwxK7CeCKYH2nOSL1jrkZCSNti0YKTA9Q4B1lxPs+1ZE4/toQekiTlFPk UTR+oKLAeOb8SH7SpEA8Yw+4fqHkJNlzbkejsGnV846jngu3haaQ+ANhbPtrvu6zZjgUZO3uR7TnB 9H7g6mlRaf4QrwytlV407e83jnYI1xxBXPw/toedMSctIXEa5+Tw774N7e76X9sNfsMpGI+e/tA8E AusqUvvqMKR9CJzAlXM22x5HcIEEz4bAj8Qk5WJIncthwg6fueB2gelbuBg6gqM8AkdODhoIOyU0W rXCL7YLXsDZN9nknIbQQ==; 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 1engjD-0001qM-Jw; Mon, 19 Feb 2018 08:23:15 +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 1engfI-0006m1-Fl for linux-rockchip@lists.infradead.org; Mon, 19 Feb 2018 08:19:29 +0000 Received: from [86.59.122.178] (port=46472 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 1engf6-0001N0-LN; Mon, 19 Feb 2018 09:19:00 +0100 From: Klaus Goger To: linux-rockchip@lists.infradead.org Subject: [PATCH v3 2/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Date: Mon, 19 Feb 2018 09:18:54 +0100 Message-Id: <20180219081855.34400-3-klaus.goger@theobroma-systems.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180219081855.34400-1-klaus.goger@theobroma-systems.com> References: <20180219081855.34400-1-klaus.goger@theobroma-systems.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180219_001912_839166_3E02B216 X-CRM114-Status: GOOD ( 14.88 ) 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 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. Signed-off-by: Klaus Goger --- Changes in v3: - split i2s0 move from rk3399-puma-haikou.dts to rk3399-puma.dtsi into it's own patch - use dasheѕ in node names - added missing vin-supply properties to regulators had to add an additional regulator to model this correctly - simple overwrite pins in i2s0_2ch_bus instead of deleting and redefining the node 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 | 63 ++++++++++++++++++++++ arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 14 +++++ 2 files changed, 77 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts index 8fd0d7ba1dc9..7966f7828504 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"; @@ -80,6 +98,16 @@ vin-supply = <&dc_12v>; }; + vcc5v0_baseboard: vcc5v0-baseboard { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_baseboard"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&dc_12v>; + }; + vcc5v0_otg: vcc5v0-otg-regulator { compatible = "regulator-fixed"; enable-active-high; @@ -89,6 +117,30 @@ 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>; + vin-supply = <&vcc5v0_baseboard>; + }; + + vddd_codec: vddd-codec { + compatible = "regulator-fixed"; + regulator-name = "vddd_codec"; + regulator-boot-on; + regulator-min-microvolt = <1600000>; + regulator-max-microvolt = <1600000>; + vin-supply = <&vcc5v0_baseboard>; + }; + + sgtl5000_clk: sgtl5000-oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24576000>; + }; }; &i2c1 { @@ -110,6 +162,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 { diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi index fc913e2d962f..4a2d06abe9c1 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi @@ -443,6 +443,20 @@ status = "okay"; }; +/* + * 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. + */ +&i2s0_2ch_bus { + rockchip,pins = + , + , + , + ; +}; + &io_domains { status = "okay"; bt656-supply = <&vcc_1v8>;