From patchwork Fri Feb 12 18:43:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 8295381 Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 35586C02AA for ; Fri, 12 Feb 2016 18:44:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86FCB20437 for ; Fri, 12 Feb 2016 18:44:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D390A20434 for ; Fri, 12 Feb 2016 18:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752618AbcBLSn7 (ORCPT ); Fri, 12 Feb 2016 13:43:59 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:41461 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752585AbcBLSn6 (ORCPT ); Fri, 12 Feb 2016 13:43:58 -0500 Received: from penelope.kanocho.kobe.vergenet.net (255-45-71-217.dyn.estpak.ee [217.71.45.255]) by kirsty.vergenet.net (Postfix) with ESMTPSA id B0D1025B78F; Sat, 13 Feb 2016 05:43:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1455302636; bh=MtBUX1V1GBTVPPehQ6LESS4WOcmVqOmU6bEfRpHrHDg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jKsNOxSRpXiksB5KVe1To0UMRqv8eq2dC5TjLG5KWC/9sfT9+zA5j84LX0MrMfudC 7gF0RgwwpZSZ3i9tICyf02xKgRq5slKeNXGZ5JSakqs0GtuVFTaUJBgmIkWok9HznC 10at2Un1NzgV2+B3gi5qqhC7oL24+fNz2n7NDfoQ= Received: by penelope.kanocho.kobe.vergenet.net (Postfix, from userid 7100) id 73CE66044E; Sat, 13 Feb 2016 05:43:43 +1100 (AEDT) Date: Fri, 12 Feb 2016 19:43:43 +0100 From: Simon Horman To: Sergei Shtylyov Cc: Kuninori Morimoto , linux-renesas-soc@vger.kernel.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, devicetree@vger.kernel.org, magnus.damm@gmail.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 5/5] ARM: dts: r8a7794: add sound support Message-ID: <20160212184343.GA31655@verge.net.au> References: <12033353.rt0nolnBmD@wasted.cogentembedded.com> <2543047.yYrDdYb9v5@wasted.cogentembedded.com> <874mdhtn7d.wl%kuninori.morimoto.gx@renesas.com> <20160210171455.GB17671@verge.net.au> <56BE0CB1.4070408@cogentembedded.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <56BE0CB1.4070408@cogentembedded.com> Organisation: Horms Solutions Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Feb 12, 2016 at 07:47:45PM +0300, Sergei Shtylyov wrote: > On 02/10/2016 08:14 PM, Simon Horman wrote: > > >>Sorry for my un-ordered response > >> > >>>Define the generic R8A7794 part of the sound device node. > >>>This sound device is a complex one and comprises the Audio Clock Generator > >>>(ADG), Sampling Rate Converter Unit (SCU), Serial Sound Interface [Unit] > >>>(SSI[U]), and Audio DMAC-Peripheral-Peripheral. > >>>It is up to the board file to enable the device. > >>> > >>>This patch is based on the R8A7791 sound work by Kuninori Morimoto. > >>> > >>>Signed-off-by: Sergei Shtylyov > >>(snip) > >>>+ rcar_sound,src { > >>>+ src1: src@1 { > >>>+ interrupts = ; > >>>+ dmas = <&audma0 0x87>, <&audma0 0x9c>; > >>>+ dma-names = "rx", "tx"; > >>>+ }; > >>>+ src2: src@2 { > >>>+ interrupts = ; > >>>+ dmas = <&audma0 0x89>, <&audma0 0x9e>; > >>>+ dma-names = "rx", "tx"; > >>>+ }; > >>>+ src3: src@3 { > >>>+ interrupts = ; > >>>+ dmas = <&audma0 0x8b>, <&audma0 0xa0>; > >>>+ dma-names = "rx", "tx"; > >>>+ }; > >>>+ src4: src@4 { > >>>+ interrupts = ; > >>>+ dmas = <&audma0 0x8d>, <&audma0 0xb0>; > >>>+ dma-names = "rx", "tx"; > >>>+ }; > >>>+ src5: src@5 { > >>>+ interrupts = ; > >>>+ dmas = <&audma0 0x8f>, <&audma0 0xb2>; > >>>+ dma-names = "rx", "tx"; > >>>+ }; > >>>+ src6: src@6 { > >>>+ interrupts = ; > >>>+ dmas = <&audma0 0x91>, <&audma0 0xb4>; > >>>+ dma-names = "rx", "tx"; > >>>+ }; > >>>+ }; > >> > >>I think this can't work correctly, because driver is assuming > >>DT has all channles (from 0). (see linux/sound/soc/sh/rcar/src.c :: rsnd_src_probe) > >>Can you adds dummy src0 with some comments ? or fix src.c driver ? > > > >I would prefer the driver to be fixed (I had a similar patchset locally > >and I found it doesn't work). > > You mean you had R8A7794 sound patch set too? Yes, I was working on it recently. I suppose we should coordinate these things in future to avoid duplicated effort. > >The reason is that DT should describe > >the hardware rather than the current state of the software. > > Yes, of course. Just tell me do I have to fix the driver *before* this > patch set is accepted? I did not entirely get to the bottom of the problem, but I think that at the very least something needs to be done about the for_each_rsnd_src() loop in rsnd_src_probe. My, obviously not satisfactory, hack around there being no src0 was as follows. diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 68b439ed22d7..58a447b0785b 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -1072,7 +1072,7 @@ int rsnd_src_probe(struct platform_device *pdev, for_each_rsnd_src(src, priv, i) { snprintf(name, RSND_SRC_NAME_SIZE, "%s.%d", - SRC_NAME, i); + SRC_NAME, i + 1); clk = devm_clk_get(dev, name); if (IS_ERR(clk))