From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars-Peter Clausen Subject: Re: simple-audio-card vs. platform question Date: Tue, 27 Jan 2015 19:11:36 +0100 Message-ID: <54C7D4D8.9020301@metafoo.de> References: <54C7848F.6070903@metafoo.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from smtp-out-190.synserver.de (smtp-out-195.synserver.de [212.40.185.195]) by alsa0.perex.cz (Postfix) with ESMTP id 64F542610B9 for ; Tue, 27 Jan 2015 19:11:37 +0100 (CET) In-Reply-To: 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 To: Ricard Wanderlof Cc: "alsa-devel@alsa-project.org" List-Id: alsa-devel@alsa-project.org On 01/27/2015 05:31 PM, Ricard Wanderlof wrote: > > On Tue, 27 Jan 2015, Lars-Peter Clausen wrote: > >> On 01/27/2015 01:01 PM, Ricard Wanderlof wrote: >>> >>> I'm trying to set up a simple device tree framework so I can do some >>> development on an I2S driver. I'm trying to use simple-audio-card, but I >>> keep running into the problem that once soc_bind_dai_link() gets called, >>> dai_link->platform is set to NULL (because it is not initialized by >>> simple-card.c when there is a DT node), while dai_link->platform_of_node >>> has been set to dai_link->cpu_of_node in asoc_simple_card_parse_of(). >>> >> [...] >>> >>> I can't figure out either how to set up a platform (=DMA) driver in this >>> environment. Perhaps the case of having a CPU DAI, DMA driver and codec >>> DAI is not supported by simple-audio-card? >> [...] >> >> Usually in such a setup the CPU DAI driver also register the platform >> component. Which then as the same of_node as the CPU DAI and so the matching >> works. There are plenty of examples e.g. check the drivers using >> devm_snd_dmaengine_pcm_register(). > > Thanks for the hint, that helps me back on track! > > Curious though, wouldn't it be more natural to bind it all together in the > simple-audio-card DT entry, having a "simple-audio-card,platform" > specification? Or is the idea that normally the CPU DAI driver is fairly > tightly coupled to the PCM driver so it makes more sense to make that > connection in the code? Usually there is no representation of the platform object in the devicetree. E.g. typically this is a external shared DMA controller which is referenced by the dmas property in the CPU DAI node. - Lars