From patchwork Thu Jan 10 01:59:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 1958301 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by patchwork2.kernel.org (Postfix) with ESMTP id 7E922DF2EB for ; Thu, 10 Jan 2013 01:59:26 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0A1tTWx016830; Wed, 9 Jan 2013 19:55:29 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0A1tTr4030141; Wed, 9 Jan 2013 19:55:29 -0600 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Wed, 9 Jan 2013 19:55:28 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0A1tRv9006656; Wed, 9 Jan 2013 19:55:28 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 7BE5680627; Wed, 9 Jan 2013 19:55:27 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id A685780626 for ; Wed, 9 Jan 2013 19:55:25 -0600 (CST) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id r0A1tOFG007039 for ; Wed, 9 Jan 2013 19:55:24 -0600 (CST) Received: from psmtp.com (na3sys009amx187.postini.com [74.125.149.168]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id r0A1tNqR028471 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 9 Jan 2013 19:55:24 -0600 Received: from mail-qc0-f181.google.com ([209.85.216.181]) (using TLSv1) by na3sys009amx187.postini.com ([74.125.148.10]) with SMTP; Wed, 09 Jan 2013 20:55:24 EST Received: by mail-qc0-f181.google.com with SMTP id x40so28148qcp.12 for ; Wed, 09 Jan 2013 17:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=zt6to7eMgsBPRAeKwTX5/5uBJhBhEU7kKyxBY8isJ78=; b=buNuXbLT4O9ip/JuRe+nINizkjZXGUaF4jVdHKc+p0oET7/JYa+DukOw/NXVO1TS7v SaeWfR5lqx7C8hTSyfw9+fO5+SJMcMUZ1xkb7Q69/6PEvdvzfAk1f1AMSUqDS7crspwd UTrKZFdiVHD7QqIjjVUnWuzfMqDbRX1Pr3hkJp2ZbyAC5ZU2MR6Nyo1rQfdLOQZBIikj 05vU5TRHbpHdgkhjJL4L7M3CoB0rWMlhRxYv2XlwuAjtYGDAYwgK2u0qMOWvyKVCDSLW GeQVxq5CIeDVg3krTQUWgdfxtXO61IwzAqQSH/T4Scc8K+WhZ+THwU+xZ91HsoUhmE7v a8ew== X-Received: by 10.224.58.66 with SMTP id f2mr54482853qah.11.1357782923139; Wed, 09 Jan 2013 17:55:23 -0800 (PST) Received: from beef (cpe-24-166-64-7.neo.res.rr.com. [24.166.64.7]) by mx.google.com with ESMTPS id eg9sm422206qab.7.2013.01.09.17.55.21 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 09 Jan 2013 17:55:22 -0800 (PST) Date: Wed, 9 Jan 2013 20:59:56 -0500 From: Matt Porter To: Vinod Koul Subject: Re: [RFC PATCH 1/3] dmaengine: add dma_get_channel_caps() Message-ID: <20130110015956.GA12220@beef> References: <1350615088-14562-1-git-send-email-mporter@ti.com> <1350615088-14562-2-git-send-email-mporter@ti.com> <1351048407.5263.10.camel@vkoul-udesk3> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1351048407.5263.10.camel@vkoul-udesk3> User-Agent: Mutt/1.5.21 (2010-09-15) X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:no-policies X-pstn-settings: 2 (0.5000:0.0050) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: Linux DaVinci Kernel List , , Linux MMC List , Linux Kernel Mailing List , Grant Likely , Dan Williams , Chris Ball X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com On Wed, Oct 24, 2012 at 08:43:27AM +0530, Vinod Koul wrote: > On Tue, 2012-10-23 at 23:49 +0100, Grant Likely wrote: > > > +enum dmaengine_apis { > > > + DMAENGINE_MEMCPY = 0x0001, > > > + DMAENGINE_XOR = 0x0002, > > > + DMAENGINE_XOR_VAL = 0x0004, > > > + DMAENGINE_PQ = 0x0008, > > > + DMAENGINE_PQ_VAL = 0x0010, > > > + DMAENGINE_MEMSET = 0x0020, > > > + DMAENGINE_SLAVE = 0x0040, > > > + DMAENGINE_CYCLIC = 0x0080, > > > + DMAENGINE_INTERLEAVED = 0x0100, > > > + DMAENGINE_SG = 0x0200, > > > +}; > > > > Actually, one more comment. Why the new enum? Why can't the > > dma_transaction_type enum be used directly along with dma_cap_mask_t? > Some of the capabilities above are not there in dma_caps_t like DMA_SG. > Also DMA_INTERRUPT and DMA_PRIVATE would not make much sense here. > > BUT would help to keep things simpler if have one definition which > includes all. All good points. I think we can best eliminate this redundant set of enums by using dma_cap_mask_t and noting in a comment as follows: If that sounds good I'll send an updated series with this change. -Matt diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 0181887..9add5ca 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -391,14 +391,15 @@ enum dmaengine_apis { * a) APIs/ops supported * b) channel physical capabilities * - * @ops: or'ed api capability + * @cap_mask: api/ops capability (DMA_INTERRUPT and DMA_PRIVATE + * are invalid api/ops and will never be set) * @seg_nr: maximum number of SG segments supported on a SG/SLAVE * channel (0 for no maximum or not a SG/SLAVE channel) * @seg_len: maximum length of SG segments supported on a SG/SLAVE * channel (0 for no maximum or not a SG/SLAVE channel) */ struct dmaengine_chan_caps { - enum dmaengine_apis ops; + dma_cap_mask_t cap_mask; int seg_nr; int seg_len; };