From patchwork Mon Nov 20 13:18:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Reichl X-Patchwork-Id: 10066397 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 A7348603FA for ; Mon, 20 Nov 2017 13:18:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 971E4291A1 for ; Mon, 20 Nov 2017 13:18:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A799291A4; Mon, 20 Nov 2017 13:18:24 +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=ham 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 6029F291A1 for ; Mon, 20 Nov 2017 13:18:23 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EA6BE26701F; Mon, 20 Nov 2017 14:18:21 +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 7A407267021; Mon, 20 Nov 2017 14:18:20 +0100 (CET) Received: from mail.horus.com (mail.horus.com [78.46.148.228]) by alsa0.perex.cz (Postfix) with ESMTP id 185AA266FEC for ; Mon, 20 Nov 2017 14:18:17 +0100 (CET) Received: from [192.168.1.20] (194-118-22-25.adsl.highway.telekom.at [194.118.22.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "E-Mail Matthias Reichl", Issuer "HiassofT CA 2014" (verified OK)) by mail.horus.com (Postfix) with ESMTPS id 6A4FD6408D; Mon, 20 Nov 2017 14:18:17 +0100 (CET) Received: by camel2.lan (Postfix, from userid 1000) id EA8831C72C2; Mon, 20 Nov 2017 14:18:15 +0100 (CET) Date: Mon, 20 Nov 2017 14:18:15 +0100 From: Matthias Reichl To: Stefan Wahren Message-ID: <20171120131815.2oaa7mvksi2h5bip@camel2.lan> References: <1511110827-2726-1-git-send-email-stefan.wahren@i2se.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1511110827-2726-1-git-send-email-stefan.wahren@i2se.com> User-Agent: NeoMutt/20170113 (1.7.2) Cc: Mark Rutland , alsa-devel@alsa-project.org, Florian Fainelli , phil@raspberrypi.org, Liam Girdwood , Rob Herring , Eric Anholt , Mark Brown , linux-rpi-kernel@lists.infradead.org, kernel@martin.sperl.org, linux-arm-kernel@lists.infradead.org Subject: Re: [alsa-devel] [PATCH RFC] ARM: dts: bcm283x: Fix probing of bcm2835-i2s 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Stefan! On Sun, Nov 19, 2017 at 06:00:27PM +0100, Stefan Wahren wrote: > Since 517e7a1537a ("ASoC: bcm2835: move to use the clock framework") > the bcm2835-i2s requires a clock as DT property. Unfortunately > the necessary DT change has never been applied. While we are at it > also fix the first PCM register range to cover the PCM_GRAY register. > > This patch also fixes the dt-bindings accordlingly. > > Signed-off-by: Stefan Wahren > --- > Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- > Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt | 9 ++++----- > arch/arm/boot/dts/bcm283x.dtsi | 4 ++-- > 3 files changed, 8 insertions(+), 9 deletions(-) > > Hi, this is only probe tested with a RPi 1B. I don't have the sound hardware > to test the drivers function. > > diff --git a/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt b/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt > index baf9b34..b6a8cc0 100644 > --- a/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt > +++ b/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt > @@ -74,8 +74,8 @@ Example: > > bcm2835_i2s: i2s@7e203000 { > compatible = "brcm,bcm2835-i2s"; > - reg = < 0x7e203000 0x20>, > - < 0x7e101098 0x02>; > + reg = < 0x7e203000 0x24>; > + clocks = <&clocks BCM2835_CLOCK_PCM>; > > dmas = <&dma 2>, > <&dma 3>; > diff --git a/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt b/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt > index 65783de..7bb0362 100644 > --- a/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt > +++ b/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt > @@ -2,9 +2,8 @@ > > Required properties: > - compatible: "brcm,bcm2835-i2s" > -- reg: A list of base address and size entries: > - * The first entry should cover the PCM registers > - * The second entry should cover the PCM clock registers > +- reg: Should contain PCM registers location and length. > +- clocks: the (PCM) clock to use > - dmas: List of DMA controller phandle and DMA request line ordered pairs. > - dma-names: Identifier string for each DMA request line in the dmas property. > These strings correspond 1:1 with the ordered pairs in dmas. > @@ -16,8 +15,8 @@ Example: > > bcm2835_i2s: i2s@7e203000 { > compatible = "brcm,bcm2835-i2s"; > - reg = <0x7e203000 0x20>, > - <0x7e101098 0x02>; > + reg = <0x7e203000 0x24>; > + clocks = <&clocks BCM2835_CLOCK_PCM>; > > dmas = <&dma 2>, > <&dma 3>; > diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi > index 431dcfc..01733a9 100644 > --- a/arch/arm/boot/dts/bcm283x.dtsi > +++ b/arch/arm/boot/dts/bcm283x.dtsi > @@ -391,8 +391,8 @@ > > i2s: i2s@7e203000 { > compatible = "brcm,bcm2835-i2s"; > - reg = <0x7e203000 0x20>, > - <0x7e101098 0x02>; > + reg = <0x7e203000 0x24>; > + clocks = <&clocks BCM2835_CLOCK_PCM>; > > dmas = <&dma 2>, > <&dma 3>; > -- Thanks a lot for fixing the DT and binding docs, the register range and clock changes look fine to me. While testing with a simple card DT overlay I noticed another issue: the i2s node is missing the #sound-dai-cells property and simple card refuses to load because of that: [ 0.956912] OF: /sound/simple-audio-card,cpu: could not get #sound-dai-cells for /soc/i2s@7e203000 As bcm2835-i2s has only a single DAI I think that property should be set to 0: With this additional change I could successfully test the following overlay with a PCM5102 codec attached to a RPi B+: /dts-v1/; /plugin/; / { compatible = "brcm,bcm2835"; fragment@0 { target = <&i2s>; __overlay__ { status = "okay"; }; }; fragment@1 { target-path = "/"; __overlay__ { spdif_codec: spdif-transmitter { #address-cells = <0>; #size-cells = <0>; #sound-dai-cells = <0>; compatible = "linux,spdif-dit"; }; sound { compatible = "simple-audio-card"; simple-audio-card,name = "simple"; simple-audio-card,format = "i2s"; simple-audio-card,bitclock-master = <&dailink_master>; simple-audio-card,frame-master = <&dailink_master>; dailink_master: simple-audio-card,cpu { sound-dai = <&i2s>; }; simple-audio-card,codec { sound-dai = <&spdif_codec>; }; }; }; }; }; BTW: this overlay will work without any hardware attached, you just need to enable SND_SIMPLE_CARD and SND_SOC_SPDIF (which serves as a generic codec) in your config. so long, Hias diff --git a/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt b/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt index 7bb0362828ec..7349f22bed1b 100644 --- a/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt +++ b/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt @@ -7,6 +7,7 @@ Required properties: - dmas: List of DMA controller phandle and DMA request line ordered pairs. - dma-names: Identifier string for each DMA request line in the dmas property. These strings correspond 1:1 with the ordered pairs in dmas. +- #sound-dai-cells: Must be set to 0. One of the DMA channels will be responsible for transmission (should be named "tx") and one for reception (should be named "rx"). @@ -21,4 +22,5 @@ bcm2835_i2s: i2s@7e203000 { dmas = <&dma 2>, <&dma 3>; dma-names = "tx", "rx"; + #sound-dai-cells = <0>; }; diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi index e08203c1d74a..bbe890d4dbb5 100644 --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi @@ -402,6 +402,7 @@ dmas = <&dma 2>, <&dma 3>; dma-names = "tx", "rx"; + #sound-dai-cells = <0>; status = "disabled"; };