From patchwork Tue Dec 12 08:11:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 10106447 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 185276032B for ; Tue, 12 Dec 2017 08:12:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 072C729AF7 for ; Tue, 12 Dec 2017 08:12:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE0DA29AFE; Tue, 12 Dec 2017 08:12:41 +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, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 397F929AE2 for ; Tue, 12 Dec 2017 08:12:41 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D35EF2676CC; Tue, 12 Dec 2017 09:12:11 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 089E8267137; Tue, 12 Dec 2017 09:12:08 +0100 (CET) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by alsa0.perex.cz (Postfix) with ESMTP id 5F0AF2670F8 for ; Tue, 12 Dec 2017 09:12:00 +0100 (CET) Received: by wens.csie.org (Postfix, from userid 1000) id EBCAB60128; Tue, 12 Dec 2017 16:11:56 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Rob Herring , Mark Rutland , Liam Girdwood , Mark Brown Date: Tue, 12 Dec 2017 16:11:48 +0800 Message-Id: <20171212081148.9194-5-wens@csie.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171212081148.9194-1-wens@csie.org> References: <20171212081148.9194-1-wens@csie.org> Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Marcus Cooper , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 4/4] [DO NOT MERGE] ARM: dts: sun8i: a83t: bpi-m3: Enable PCM5122 codec with I2S1 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch enables a PiFi DAC+ V2.0, which is a PCM5122-based audio output DAC add-on board for the Raspberry Pi B+ and later, connected to the GPIO header of the Bananapi M3 via jumper cables. The power, ground, and I2C pins are in the same position, but the I2S ones are not. The I2C controller used is I2C2, while the I2S controller is I2S1. Signed-off-by: Chen-Yu Tsai --- I'm sure I've asked this before, and IIRC the answer was yes: The I2C controllers available on the GPIO header all have proper, always-on, external pull-ups. Does that mean we can enable them by default, seeing as they are likely intended to be used this way (as I2C pins)? I think we have a few boards where either I2C or UARTs on the GPIO header are enabled by default. --- arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts index 6550bf0e594b..a9a208ebda12 100644 --- a/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts +++ b/arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts @@ -70,6 +70,23 @@ gpio = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ }; + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "PiFi DAC+ v2.0"; + simple-audio-card,format = "i2s"; + simple-audio-card,mclk-fs = <512>; + simple-audio-card,frame-master = <&link_cpu>; + simple-audio-card,bitclock-master = <&link_cpu>; + + link_cpu: simple-audio-card,cpu { + sound-dai = <&i2s1>; + }; + + simple-audio-card,codec { + sound-dai = <&pcm5122>; + }; + }; + wifi_pwrseq: wifi_pwrseq { compatible = "mmc-pwrseq-simple"; clocks = <&ac100_rtc 1>; @@ -100,6 +117,22 @@ status = "okay"; }; +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_ph_pins>; + status = "okay"; + + pcm5122: pcm5122@4d { + #sound-dai-cells = <0>; + compatible = "ti,pcm5122"; + reg = <0x4d>; + }; +}; + +&i2s1 { + status = "okay"; +}; + &mdio { rgmii_phy: ethernet-phy@1 { compatible = "ethernet-phy-ieee802.3-c22";