From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lars-Peter Clausen Subject: Re: [alsa-devel] [PATCH 5/5 v4] ASoC: dwc: Update DOCUMENTATION for I2S Driver Date: Sat, 9 Apr 2016 16:55:37 +0200 Message-ID: <570917E9.8020804@metafoo.de> References: <20160407175326.GX1924@sirena.org.uk> <570782BF.10402@synopsys.com> <5707D3AD.8030308@metafoo.de> <5707D780.4050406@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <5707D780.4050406@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 , Mark Brown Cc: alsa-devel@alsa-project.org, Vineet.Gupta1@synopsys.com, Alexey.Brodkin@synopsys.com, lgirdwood@gmail.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, CARLOS.PALMINHA@synopsys.com, tiwai@suse.com, linux-snps-arc@lists.infradead.org List-Id: alsa-devel@alsa-project.org T24gMDQvMDgvMjAxNiAwNjowOCBQTSwgSm9zZSBBYnJldSB3cm90ZToKPiBIaSBMYXJzLAo+IAo+ IAo+IE9uIDA4LTA0LTIwMTYgMTY6NTIsIExhcnMtUGV0ZXIgQ2xhdXNlbiB3cm90ZToKPj4gT24g MDQvMDgvMjAxNiAxMjowNiBQTSwgSm9zZSBBYnJldSB3cm90ZToKPj4+IEhpIE1hcmssCj4+Pgo+ Pj4KPj4+IE9uIDA3LTA0LTIwMTYgMTg6NTMsIE1hcmsgQnJvd24gd3JvdGU6Cj4+Pj4gT24gVGh1 LCBBcHIgMDcsIDIwMTYgYXQgMDU6NTM6NTlQTSArMDEwMCwgSm9zZSBBYnJldSB3cm90ZToKPj4+ Pgo+Pj4+PiArIE9wdGlvbmFsIHByb3BlcnRpZXM6Cj4+Pj4+ICsgLSBzbnBzLHVzZS1kbWFlbmdp bmU6IElmIHNldCB0aGUgZH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MuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlzdHMuZnJlZWRlc2t0b3Aub3JnL21h aWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== From mboxrd@z Thu Jan 1 00:00:00 1970 From: lars@metafoo.de (Lars-Peter Clausen) Date: Sat, 9 Apr 2016 16:55:37 +0200 Subject: [alsa-devel] [PATCH 5/5 v4] ASoC: dwc: Update DOCUMENTATION for I2S Driver In-Reply-To: <5707D780.4050406@synopsys.com> References: <20160407175326.GX1924@sirena.org.uk> <570782BF.10402@synopsys.com> <5707D3AD.8030308@metafoo.de> <5707D780.4050406@synopsys.com> List-ID: Message-ID: <570917E9.8020804@metafoo.de> To: linux-snps-arc@lists.infradead.org On 04/08/2016 06:08 PM, Jose Abreu wrote: > Hi Lars, > > > On 08-04-2016 16:52, Lars-Peter Clausen wrote: >> On 04/08/2016 12:06 PM, Jose Abreu wrote: >>> Hi Mark, >>> >>> >>> On 07-04-2016 18:53, Mark Brown wrote: >>>> On Thu, Apr 07, 2016@05:53:59PM +0100, Jose Abreu wrote: >>>> >>>>> + Optional properties: >>>>> + - snps,use-dmaengine: If set the driver will use ALSA DMA engine. If set >>>>> + it is required to use the properties 'dmas' and 'dma-names'. >>>> This is not a good interface, it's describing Linux internal APIs. If >>>> the device needs to operate in PIO mode it should just do that. >>> I added this interface because there is no direct way to check if DMA is >>> available on the I2S controller so it is not possible to automatically change >>> between DMA and PIO mode. As the I2S controller can be built with or without DMA >>> support it is necessary to somehow check if DMA is enabled or not and according >>> to that use either ALSA DMA engine or the custom platform driver sent in these >>> patches. I did not want to remove drivers functionality so I added this property >>> to the DT. This way a user can select between DMA and PIO mode. >> That's OK, but you need to describe the hardware, not the indented behavior >> of the software driver. >> > > Is this okay: "snps,use-dmaengine: Set this boolean paramater if I2S controller > has DMA support. If set the properties 'dmas' and 'dma-names' must be also set" ? The description is better. But the name of the property is still imperative rather then descriptive. It tells the software what should be done rather then describing what the hardware looks like. Since there is already the dmas property which is present if a DMA is connected and is absent when no DMA is present it should be enough to just check that property rather than requiring an additional one. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753360AbcDIOzr (ORCPT ); Sat, 9 Apr 2016 10:55:47 -0400 Received: from www381.your-server.de ([78.46.137.84]:49123 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797AbcDIOzq (ORCPT ); Sat, 9 Apr 2016 10:55:46 -0400 Subject: Re: [alsa-devel] [PATCH 5/5 v4] ASoC: dwc: Update DOCUMENTATION for I2S Driver To: Jose Abreu , Mark Brown References: <20160407175326.GX1924@sirena.org.uk> <570782BF.10402@synopsys.com> <5707D3AD.8030308@metafoo.de> <5707D780.4050406@synopsys.com> Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, airlied@linux.ie, Vineet.Gupta1@synopsys.com, Alexey.Brodkin@synopsys.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, CARLOS.PALMINHA@synopsys.com, tiwai@suse.com, linux-snps-arc@lists.infradead.org, architt@codeaurora.org From: Lars-Peter Clausen Message-ID: <570917E9.8020804@metafoo.de> Date: Sat, 9 Apr 2016 16:55:37 +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: <5707D780.4050406@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/08/2016 06:08 PM, Jose Abreu wrote: > Hi Lars, > > > On 08-04-2016 16:52, Lars-Peter Clausen wrote: >> On 04/08/2016 12:06 PM, Jose Abreu wrote: >>> Hi Mark, >>> >>> >>> On 07-04-2016 18:53, Mark Brown wrote: >>>> On Thu, Apr 07, 2016 at 05:53:59PM +0100, Jose Abreu wrote: >>>> >>>>> + Optional properties: >>>>> + - snps,use-dmaengine: If set the driver will use ALSA DMA engine. If set >>>>> + it is required to use the properties 'dmas' and 'dma-names'. >>>> This is not a good interface, it's describing Linux internal APIs. If >>>> the device needs to operate in PIO mode it should just do that. >>> I added this interface because there is no direct way to check if DMA is >>> available on the I2S controller so it is not possible to automatically change >>> between DMA and PIO mode. As the I2S controller can be built with or without DMA >>> support it is necessary to somehow check if DMA is enabled or not and according >>> to that use either ALSA DMA engine or the custom platform driver sent in these >>> patches. I did not want to remove drivers functionality so I added this property >>> to the DT. This way a user can select between DMA and PIO mode. >> That's OK, but you need to describe the hardware, not the indented behavior >> of the software driver. >> > > Is this okay: "snps,use-dmaengine: Set this boolean paramater if I2S controller > has DMA support. If set the properties 'dmas' and 'dma-names' must be also set" ? The description is better. But the name of the property is still imperative rather then descriptive. It tells the software what should be done rather then describing what the hardware looks like. Since there is already the dmas property which is present if a DMA is connected and is absent when no DMA is present it should be enough to just check that property rather than requiring an additional one.