Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754826AbcJEKDT convert rfc822-to-8bit (ORCPT ); Wed, 5 Oct 2016 06:03:19 -0400 Received: from smtpfb2-g21.free.fr ([212.27.42.10]:33935 "EHLO smtpfb2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752752AbcJEKDR (ORCPT ); Wed, 5 Oct 2016 06:03:17 -0400 Date: Wed, 5 Oct 2016 12:03:03 +0200 From: Jean-Francois Moine To: Code Kipper Cc: =?ISO-8859-1?Q?Myl=E8ne?= Josserand , mark.rutland@arm.com, devicetree , alsa-devel@alsa-project.org, linux-sunxi , thomas.petazzoni@free-electrons.com, vinod.koul@intel.com, linux-kernel@vger.kernel.org, Michael Turquette , Takashi Iwai , sboyd@codeaurora.org, Liam Girdwood , Rob Herring , Jaroslav Kysela , Chen-Yu Tsai , Mark Brown , alexandre.belloni@free-electrons.com, dmaengine@vger.kernel.org, Maxime Ripard , Lee Jones , linux-clk@vger.kernel.org, linux-arm-kernel Subject: Re: [PATCH 07/14] ASoC: Add sun8i audio card Message-Id: <20161005120303.93eb05294d189e04461bb314@free.fr> In-Reply-To: References: <33d641ff43f0c0349cdfa2cdbbfdcdde66205596.1475571575.git.mylene.josserand@free-electrons.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; armv7l-unknown-linux-gnueabihf) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1653 Lines: 42 On Wed, 5 Oct 2016 08:04:26 +0200 Code Kipper wrote: > > +static int sun8i_probe(struct platform_device *pdev) > > +{ > > + struct snd_soc_dai_link *link = &sun8i_dai_link; > > + struct device_node *np = pdev->dev.of_node; > > + int ret; > > + > > + /* register the soc card */ > > + sun8i_card.dev = &pdev->dev; > > + > > + /* Retrieve the audio-codec from DT */ > > + link->codec_of_node = of_parse_phandle(np, "allwinner,audio-codec", 0); > > + if (!link->codec_of_node) { > > + dev_err(&pdev->dev, "Missing audio codec\n"); > > + return -EINVAL; > > + } > > + > > + /* Retrieve DAI from DT */ > > + link->cpu_of_node = of_parse_phandle(np, "allwinner,i2s-controller", 0); > Now that I've spent some time trying to add my changes for the H3 > ontop of your code, I think this file should be more generic and rely > on the dtsi more. It's pretty A33 specific but with little effort it > can be worked to cover all of the sun8i type drivers. I would change > "allwinner,i2s-controller" to "allwinner,audio-dai" for starters and > then maybe pull in some info for the dai-link from the dtsi. > CK [snip] In fact, there should be no audio card driver as proposed here: with such a simple layout CPU DAI (sun4i-a10-i2s) -> CODEC DAI (sun8i-a33-codec) the 'simple-card' does the job. BTW, I have a I2S/PCM/TDM driver for the H3 and A83T. But, as it works with HDMI and contains echanges with the DRM driver, it cannot go yet to the mainline... -- Ken ar c'henta? | ** Breizh ha Linux atav! ** Jef | http://moinejf.free.fr/