Received: by 10.192.165.156 with SMTP id m28csp510547imm; Fri, 13 Apr 2018 03:08:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx48/Hm7n7uaIYddWZc4pYwSI192FN10Mm7CuFYHk9YKN6yK0BGA8nls0iu5SDQZ1Gps1wyph X-Received: by 10.98.226.24 with SMTP id a24mr10914085pfi.223.1523614138391; Fri, 13 Apr 2018 03:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523614138; cv=none; d=google.com; s=arc-20160816; b=fwUD+FVfZBHOuCkMiqhmk9yOUzOybQ7Kr+CZtLIwLhYyQJK9TWNqX9q8WqlTkkTPgc z/rtNy55VDwzBM+HGBKhTFuGk+duxb+IOs+IT8252kup+Z/4BMbc5FpNBKSFJH7VJdeL G0kQWHVURvnrZZQMarYUAwi2rABM2++WnMNmNUCIhQQ6d6P0vyxYjCZzW4XZ1phKMHqY 5E2W/v3q/J+NCWDyTEwXvxMqSwIPzD78TNrXYQ/wdtCVHUzunKH+lrTOYKXtpMFYiCDw nvxVSvx06EkdNs+Y0YINwfu716j7rlb73i4kgmt8Tqmz5DvHKROotiD5cPP9w6V9gXPH fURQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=qC2Cz5OZOu9Qe8o/EqGmFtm2hmfIZ4gNDyl/ny3x5H8=; b=OSJPYRGg43yRBKvDtuYyaXW/rdhYEwgVWr1+i6iJaLlrnnT3Gep920u8zybprSa9FC 3VHDSDGRL8xtPSs6zasrZgTnMrkN35JNNAUIVJKsHoPoGAfgdbMkAyMlCgu04AsX2Ddm a6ftwhjSB1rzP0AUAljXvz6SPM4rZmc1kUCg6LzeRMYbIsoP0mTy8fMvXNQQ7y8pU3db X3mQGcRbJI2zmcXUNuyXM+64W5q94/goypCuOZFEYnUgHQ7F7jTGY8IvVJJfZhXE3qIZ g2mWkBm1zkiv9WglMCLyPIGCQNOGmhbNCDRnKTA5iASgzQfg5vbDg1k/vyOJHhFtYd3K Rhuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1-v6si5033086plb.101.2018.04.13.03.08.44; Fri, 13 Apr 2018 03:08:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754192AbeDMKHO (ORCPT + 99 others); Fri, 13 Apr 2018 06:07:14 -0400 Received: from mga05.intel.com ([192.55.52.43]:53241 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753931AbeDMKHM (ORCPT ); Fri, 13 Apr 2018 06:07:12 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2018 03:07:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,444,1517904000"; d="scan'208";a="41698014" Received: from vkoul-udesk7.iind.intel.com (HELO localhost) ([10.223.84.143]) by FMSMGA003.fm.intel.com with ESMTP; 13 Apr 2018 03:07:09 -0700 Date: Fri, 13 Apr 2018 15:41:41 +0530 From: Vinod Koul To: Baolin Wang Cc: Dan Williams , Eric Long , Mark Brown , dmaengine@vger.kernel.org, LKML Subject: Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration Message-ID: <20180413101140.GN6014@localhost> References: <0c2b76aba6a49e583f920ae582d6815fa9cc4361.1523346135.git.baolin.wang@linaro.org> <20180411093634.GC6014@localhost> <20180412093735.GF6014@localhost> <20180413034332.GI6014@localhost> <20180413063641.GL6014@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 13, 2018 at 02:41:48PM +0800, Baolin Wang wrote: > On 13 April 2018 at 14:36, Vinod Koul wrote: > > On Fri, Apr 13, 2018 at 02:17:34PM +0800, Baolin Wang wrote: > > > >> > Agreed, users only care about grabbing a channel, setting a descriptor and > >> > submitting that. > >> > > >> > I think you need to go back and think about this a bit, please do go thru > >> > dmaengine documentation and see other driver examples. > >> > > >> > We don't typically expose these to users, they give us a transfer and we set > >> > that up in hardware for efficient. Its DMA so people expect us to use fastest > >> > mechanism available. > >> > >> But there are some configuration are really special for Spreadtrum > >> DMA, and must need user to specify how to configure, especially some > >> scenarios of audio. So I wander if we can add one pointer for > >> 'dma_slave_config' to expand some special DMA configuration > >> requirements, like: > >> > >> struct dma_slave_config { > >> ...... > >> unsigned int slave_id; > >> void *platform_data; > >> }; > >> > >> So if some DMA has some special configuration (such as Spreadtrum > >> DMA), they can user this platform_data pointer. Like xilinx DMA, they > >> also have some special configuration. > > > > Well we all think our HW is special and needs some additional stuff, most of > > the cases turns out not to be the case. > > > > Can you explain how audio in this case additional configuration... > > > > Beside the general configuration, our audio driver will configure the > fragment length, block length, maybe transaction length, and they must > specify the request type and interrupt type, these are what we want to > export for users. First doesn't it use sound dmaengine library, it should :) Second, I think you should calculate the lengths based on given input. Audio is circular buffer so you shall create a circular linked list and submit. See how other driver implement circular prepare callback -- ~Vinod