From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars-Peter Clausen Subject: Re: [alsa-devel] [PATCH 2/5 v4] drm/i2c/adv7511: Add audio support Date: Mon, 11 Apr 2016 14:23:56 +0200 Message-ID: <570B975C.50702@metafoo.de> References: <5707D249.5040707@metafoo.de> <5707D88A.3010400@synopsys.com> <57091999.4010906@metafoo.de> <570B6DF2.1080008@synopsys.com> <570B6F7B.2020906@metafoo.de> <570B8B59.7000900@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <570B8B59.7000900@synopsys.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Jose Abreu , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org Cc: Vineet.Gupta1@synopsys.com, Alexey.Brodkin@synopsys.com, CARLOS.PALMINHA@synopsys.com, lgirdwood@gmail.com, broonie@kernel.org, tiwai@suse.com List-Id: alsa-devel@alsa-project.org T24gMDQvMTEvMjAxNiAwMTozMiBQTSwgSm9zZSBBYnJldSB3cm90ZToKPiBIaSBMYXJzLAo+IAo+ IAo+IE9uIDExLTA0LTIwMTYgMTA6MzMsIExhcnMtUGV0ZXIgQ2xhdXNlbiB3cm90ZToKPj4gT24g MDQvMTEvMjAxNiAxMToyNyBBTSwgSm9zZSBBYnJldSB3cm90ZToKPj4+IEhpIExhcnMsCj4+Pgo+ Pj4KPj4+IE9uIDA5LTA0LTIwMTYgMTY6MDIsIExhcnMtUGV0ZXIgQ2xhdXNlbiB3cm90ZToKPj4+ PiBPbiAwNC8wOC8yMDE2IDA2OjEyIFBNLCBKb3NlIEFicmV1IHdyb3RlOgo+Pj4+IFsuLi5dCj4+ Pj4+PiBbLi4uXQo+Pj4+Pj4+ICstIGFkaSxlbmFibGUtYXVkaW86IElmIHNldCB0aGUgQURW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XN0aW5mby9kcmktZGV2ZWwK From mboxrd@z Thu Jan 1 00:00:00 1970 From: lars@metafoo.de (Lars-Peter Clausen) Date: Mon, 11 Apr 2016 14:23:56 +0200 Subject: [alsa-devel] [PATCH 2/5 v4] drm/i2c/adv7511: Add audio support In-Reply-To: <570B8B59.7000900@synopsys.com> References: <5707D249.5040707@metafoo.de> <5707D88A.3010400@synopsys.com> <57091999.4010906@metafoo.de> <570B6DF2.1080008@synopsys.com> <570B6F7B.2020906@metafoo.de> <570B8B59.7000900@synopsys.com> List-ID: Message-ID: <570B975C.50702@metafoo.de> To: linux-snps-arc@lists.infradead.org On 04/11/2016 01:32 PM, Jose Abreu wrote: > Hi Lars, > > > On 11-04-2016 10:33, Lars-Peter Clausen wrote: >> On 04/11/2016 11:27 AM, Jose Abreu wrote: >>> Hi Lars, >>> >>> >>> On 09-04-2016 16:02, Lars-Peter Clausen wrote: >>>> On 04/08/2016 06:12 PM, Jose Abreu wrote: >>>> [...] >>>>>> [...] >>>>>>> +- adi,enable-audio: If set the ADV7511 driver will register a codec interface >>>>>>> + into ALSA SoC. >>>>>> This is not a description of the hardware. >>>>> Is this okay: "adi,enable-audio: Set this boolean parameter if ADV7511 >>>>> transmitter routes audio signals" ? >>>> I don't think we need this property. There is no problem with registering >>>> the audio part unconditionally. As long as there is no connection we wont >>>> create a sound card that is exposed to userspace. >>>> >>> This change was suggested by Laurent Pinchart and was introduced in v3. Quoting >>> Laurent: >>> "The idea is that enabling support for ADV7511 audio in the kernel isn't coupled >>> with whether the system includes audio support. It would be confusing, and would >>> also waste resources, to create a Linux sound device when no sound channel is >>> routed on the board." >> I wouldn't care too much about this at this point, the extra amount of >> resources required for registering the CODEC (but not the sound card) is >> just a few bytes (sizeof(struct snd_soc_codec)). >> >> Nevertheless what we should do is describe the hardware and from this >> information infer whether there is a audio connection or not and if there is >> none we might skip registering the CODEC. In my opinion this hardware >> description should be modeled using of-graph, having a connection between >> the SoC side and the adv7511 SPDIF or I2S port. >> > > You mean something like this: > > sound_playback: sound_playback { > compatible = "simple-audio-card"; > [...] > simple-audio-card,format = "i2s"; > [...] > } > > adv7511 at xx { > compatible = "adi,adv7511"; > [...] > > ports { > [...] > /* Audio Output */ > port at x { > reg = ; > endpoint { > remote-endpoint = <&sound_playback>; > } > } > } > } Yes, something like that. Not exactly like that, but similar. One of the core concepts of of-graph is that there is always a description of the connection from both sides, this way each side can independently figure out where it is connected. Currently there is also zero support of of-graph in ASoC, so a bit of work is required to get this integrated properly. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754635AbcDKMYF (ORCPT ); Mon, 11 Apr 2016 08:24:05 -0400 Received: from www381.your-server.de ([78.46.137.84]:59420 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754162AbcDKMYD (ORCPT ); Mon, 11 Apr 2016 08:24:03 -0400 Subject: Re: [alsa-devel] [PATCH 2/5 v4] drm/i2c/adv7511: Add audio support To: Jose Abreu , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org References: <5707D249.5040707@metafoo.de> <5707D88A.3010400@synopsys.com> <57091999.4010906@metafoo.de> <570B6DF2.1080008@synopsys.com> <570B6F7B.2020906@metafoo.de> <570B8B59.7000900@synopsys.com> Cc: architt@codeaurora.org, airlied@linux.ie, Vineet.Gupta1@synopsys.com, Alexey.Brodkin@synopsys.com, lgirdwood@gmail.com, CARLOS.PALMINHA@synopsys.com, broonie@kernel.org, tiwai@suse.com From: Lars-Peter Clausen Message-ID: <570B975C.50702@metafoo.de> Date: Mon, 11 Apr 2016 14:23:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <570B8B59.7000900@synopsys.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Authenticated-Sender: lars@metafoo.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/11/2016 01:32 PM, Jose Abreu wrote: > Hi Lars, > > > On 11-04-2016 10:33, Lars-Peter Clausen wrote: >> On 04/11/2016 11:27 AM, Jose Abreu wrote: >>> Hi Lars, >>> >>> >>> On 09-04-2016 16:02, Lars-Peter Clausen wrote: >>>> On 04/08/2016 06:12 PM, Jose Abreu wrote: >>>> [...] >>>>>> [...] >>>>>>> +- adi,enable-audio: If set the ADV7511 driver will register a codec interface >>>>>>> + into ALSA SoC. >>>>>> This is not a description of the hardware. >>>>> Is this okay: "adi,enable-audio: Set this boolean parameter if ADV7511 >>>>> transmitter routes audio signals" ? >>>> I don't think we need this property. There is no problem with registering >>>> the audio part unconditionally. As long as there is no connection we wont >>>> create a sound card that is exposed to userspace. >>>> >>> This change was suggested by Laurent Pinchart and was introduced in v3. Quoting >>> Laurent: >>> "The idea is that enabling support for ADV7511 audio in the kernel isn't coupled >>> with whether the system includes audio support. It would be confusing, and would >>> also waste resources, to create a Linux sound device when no sound channel is >>> routed on the board." >> I wouldn't care too much about this at this point, the extra amount of >> resources required for registering the CODEC (but not the sound card) is >> just a few bytes (sizeof(struct snd_soc_codec)). >> >> Nevertheless what we should do is describe the hardware and from this >> information infer whether there is a audio connection or not and if there is >> none we might skip registering the CODEC. In my opinion this hardware >> description should be modeled using of-graph, having a connection between >> the SoC side and the adv7511 SPDIF or I2S port. >> > > You mean something like this: > > sound_playback: sound_playback { > compatible = "simple-audio-card"; > [...] > simple-audio-card,format = "i2s"; > [...] > } > > adv7511@xx { > compatible = "adi,adv7511"; > [...] > > ports { > [...] > /* Audio Output */ > port@x { > reg = ; > endpoint { > remote-endpoint = <&sound_playback>; > } > } > } > } Yes, something like that. Not exactly like that, but similar. One of the core concepts of of-graph is that there is always a description of the connection from both sides, this way each side can independently figure out where it is connected. Currently there is also zero support of of-graph in ASoC, so a bit of work is required to get this integrated properly.