From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Subject: Re: [PATCH 2/3] ASoC: add snd_soc_of_get_port_dai_name() Date: Wed, 13 Feb 2013 16:33:54 -0700 Message-ID: <511C22E2.60701@wwwdotorg.org> References: <87zk11487a.wl%kuninori.morimoto.gx@renesas.com> <87sj6t484z.wl%kuninori.morimoto.gx@renesas.com> <50E71618.8090302@wwwdotorg.org> <20130104193712.GN4627@opensource.wolfsonmicro.com> <87y5fvyy18.wl%kuninori.morimoto.gx@renesas.com> <87vcazyxr1.wl%kuninori.morimoto.gx@renesas.com> <20130127035943.GJ4650@opensource.wolfsonmicro.com> <87vcag3hcj.wl%kuninori.morimoto.gx@renesas.com> <20130129014808.GC4748@opensource.wolfsonmicro.com> <87sj5k3f83.wl%kuninori.morimoto.gx@renesas.com> <87obg8z4u4.wl%kuninori.morimoto.gx@renesas.com> <5107FF97.1070601@wwwdotorg.org> <87halz82bm.wl%kuninori.morimoto.gx@renesas.com> <51097F0F.2030501@wwwdotorg.org> <87halw7sij.wl%kuninori.morimoto.gx@renesas.com> <5110349D.3050308@wwwdotorg.org> <87ehgvrs1h.wl%kuninori.morimoto.gx@renesas.com> <87bobzrry6.wl%kuninori.morimoto.gx@renesas.com> <511963F8.5020107@wwwdotorg.org> <87bobqf5yq.wl%kuninori.morimoto.gx@renesas.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <87bobqf5yq.wl%kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Kuninori Morimoto Cc: Linux-ALSA , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Mark Brown , Liam Girdwood , Simon , Kuninori Morimoto List-Id: devicetree@vger.kernel.org On 02/11/2013 10:37 PM, Kuninori Morimoto wrote: > > Hi Stephen > >> 2) Call an "of_xlate" function on that driver, passing it the "portspec" >> I mentioned above; the driver will interpret the portspec, maps it to >> the ASoC port name, and return it. >> >> The DT binding for each audio component must define the list of valid >> port IDs, and the number of cells used to encode the value. >> >> See for example the GPIO and PWM subsystem's of_xlate functions. > > Hmm... > I guess this means struct snd_soc_dai_driver or similar has .of_xlate() callback ? Yes, something like that. > But, this simple-audio is "independent" from cpu/codec. Well, any driver that could be used with it will need to implement the .of_xlate() callback. The simple-audio code would still be 100% independent from any CPU or CODEC, since of_xlate would be a standard interface/API that any CPU or CODEC driver could implement, and any ASoC machine driver could call. > For example, basically, we can use this simple-audio for FSI-wm8903 matching. > But, this wm8903 is used on tegra too. > Then, FSI-wm8903 (which use simple-audio) needs .of_xlate on wm8903 driver to get interpreted port name, > but tegra-wm8903 don't need it. Yes, .of_xlate() wouldn't have to be implemented by the WM8903 CODEC driver for the tegra-wm8903 machine driver to use the WM8903 CODEC. However, if it /was/ implemented, it wouldn't stop tegra-wm8903 from working. And later, it may help unify all the simple Tegra machine drivers into one, since they could also become CODEC-independent, and hence become unified (or at least mostly unified) code.