Received: by 10.223.176.5 with SMTP id f5csp673233wra; Sat, 3 Feb 2018 07:51:48 -0800 (PST) X-Google-Smtp-Source: AH8x226skQECwgRvNao9JGt58DKP9P6NjSKdR21eTbzpPAVb2K2kzTi5ofdAH5/JR2QaJjt42EO/ X-Received: by 2002:a17:902:a985:: with SMTP id bh5-v6mr18497032plb.230.1517673108185; Sat, 03 Feb 2018 07:51:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517673108; cv=none; d=google.com; s=arc-20160816; b=hM7ArRmuYiE9xO64LQGvCosu8lzqVqK+4ivtFLExYeqFNKAKOb7HGVTq4fuFje3Xfl s28GVwop/J5mMh1EUnRgezI2/QB42NeBSVnZ77kv/JCmvuQYvAthaL1eEBZ+XWIaNoOx em0IQ0C8yrC7HYohAs5cSaEXewYRI4nuxKGw/kHOljYt6trMMIss7vvYOrDAHMxF1T5z mQB/nfAKQZvWZ433IRrT4p4fu6OmO8aKSwXo0v7L9ddWuetyFD9ryWiE7JyiZBCowiaI q8WLxmM6cOapMO0hvZorlNJ6LhyazwwumV+MQq3vptSUsL/1HzsmcYYH2LqZlVX277yF C5cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ccRfoTKLmKKqSBeSHe9TvddbqiNg1DImqhJxR+ZjoNw=; b=shPvxLCLgmeNaGebmealuId6/Oj51R4eu6XVFjesxIeHDVwlJAMzLzIBxa7lqspq4C OwNUEr4U0Rl/h65Y+vepxmwp8/chMC/4JAv1eKqsocWck8w94mrTzn0+N0ElmTvXTiVD WR6YUmcK/gilgja0O5KL7w8bJil7QPdJIBJv1/wzb0TqPoToYhfjunNxF79yctczK5RD 5Rov2A3q34foDnOkwU8ab8TioXqlRRRKClHXNgD5pYeItZvHuRTzSox5zsvLaCSIjIlh Nnuyw2JJXlSvd3Yk9ZCj+kuo3pNJxNaekRiUpJ06+hpw6JXUZlObeQTz7ALJROQm3z+2 FxiA== 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 d15-v6si4049258pln.320.2018.02.03.07.51.33; Sat, 03 Feb 2018 07:51:48 -0800 (PST) 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 S1752653AbeBCPuy (ORCPT + 99 others); Sat, 3 Feb 2018 10:50:54 -0500 Received: from vegas.theobroma-systems.com ([144.76.126.164]:56434 "EHLO mail.theobroma-systems.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752103AbeBCPum (ORCPT ); Sat, 3 Feb 2018 10:50:42 -0500 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 Cc: linux-kernel@vger.kernel.org, Heiko Stuebner , Klaus Goger 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = -- 2.11.0