Received: by 10.192.165.156 with SMTP id m28csp551825imm; Fri, 13 Apr 2018 03:58:28 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/yJ6NyqJk4LvJlz4yV/JCIOIrwytEVr8XDrrOERLXUnwAlroAEiiG5CuFhmbJHIMP/9Wzb X-Received: by 10.99.49.84 with SMTP id x81mr3689307pgx.38.1523617108293; Fri, 13 Apr 2018 03:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523617108; cv=none; d=google.com; s=arc-20160816; b=f8JEu/iZAw+ckz1+XmlT/oyVqo2FH0s63/bRhL1Y9rTfO4l9b9n5vxTD5VSz8iQgx4 P/Hm6jRKRJIve+5YlsCTIQ0d4GijeV3fCkyHdvkH8gshcmDQI72Del9/tPM9Nv3mjhza 4AzfLVW8ma+5OjJtQLTmbWAUIXrAwYxRvRv0lFC41l4x2YhaqlYRaR/eR77ZtyOgRkEP IzSN3v9BDSbrKkAhXRblYjwYMPPliHD7K+PNXDaO+aXm9L58Xe8jN7ebZFpXxk/0LUkk qv5PQe5N5DGz7NHmDxqtOvFgWyMo2loIAWT6CkMHmahkK9LnqqPBuk55WzfBLIdw5Qa3 Ks3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=vh37Z6yloE9FOM0w2IROvaZ1CdbiwD6yeS0UvCXlC9o=; b=jo2X85rterh4czCvAQs59K4IgMIczD7SpQms/kBtQGHPi2awW2IQ3C1YGxc27p7ZwW 1TX6kOZNf/nfTN37IVgLRgRhIv4SyC1Y4QScZL2jbPg/UbHxM+CKoPeunpNkz1fmln76 v+FAoQZ39gSAByar00iLbrS2tKOcq2pE6jLOPjrDYuK/hp/0lSK0bGCjQTs2BTYNCIZ3 asgbhtpHI1qabEyPgErq7WaHVWNvf7Zb9vhKIjJb2Vmab/2KEF/H6RmsX75sn8tVm4Xw 3EVdtjr2yw+BzaEpl3VauLVQ7p/4LnLyYwASp3iX6oTs339XI2MRsf392tsglcejtYri mygw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AiHYmrxb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5-v6si4956291plz.58.2018.04.13.03.58.13; Fri, 13 Apr 2018 03:58:28 -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; dkim=pass header.i=@linaro.org header.s=google header.b=AiHYmrxb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754158AbeDMKsr (ORCPT + 99 others); Fri, 13 Apr 2018 06:48:47 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:34167 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752410AbeDMKsp (ORCPT ); Fri, 13 Apr 2018 06:48:45 -0400 Received: by mail-oi0-f49.google.com with SMTP id u141-v6so7969593oif.1 for ; Fri, 13 Apr 2018 03:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vh37Z6yloE9FOM0w2IROvaZ1CdbiwD6yeS0UvCXlC9o=; b=AiHYmrxbjYCh3sV8Es176dbqOjmk5uklaCn3+wJWhEAQVigmftrjSzm3r21RRR2hzK FMHi3/asR5UyJj4Z1RnmSNs1qUKVUZkgWtmZMlZcTZSIG78/PFq1/k//fY0STVbE99hm o6uYX5yTP0pKD9hrtDFUDNyCiDVEjOpe+0O20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vh37Z6yloE9FOM0w2IROvaZ1CdbiwD6yeS0UvCXlC9o=; b=J2cwxvXiDHpoy1KFpuq13pOtmH3F8U++rc7F6HZEt/dFuS0vggfHHdTusYTx7lx1JI XjQLjQfSGjRybi5Gsa5FDUdMpbYs0zblmuJaKS3MnpR50On6fKq9UiQadVd/2SYaPNF3 HFo1Z+RTDJyH1Gl0JLV2Lxk9S6BN9H03VM+g8NR7XkvMph/f2njLrGnqK7DyrBWU6kxn mTGufXA8J/GG3cTMesup2kfjhk+/xhgC3UfL9dhzGtLEefM4u7eSZPkVGcCsCN4JV3OU uqZTNhw8hUA3Diqcp2tBlJ1BJlXJpXBz8sfsQ2KQUq9ae0RaKrxXTOeJMIGIB2X4Fchd X6DA== X-Gm-Message-State: ALQs6tA9TQidQaDvHuU6V/WgX8TPpsxxt6jSwcKOiTnIQTaeLoZIA7DZ qvFp85Ebx62HJ8i75EWv87Rf5Z0RuzizIirPalmXtQ== X-Received: by 2002:aca:e34a:: with SMTP id a71-v6mr5422897oih.68.1523616524431; Fri, 13 Apr 2018 03:48:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:7081:0:0:0:0:0 with HTTP; Fri, 13 Apr 2018 03:48:43 -0700 (PDT) In-Reply-To: <20180413101140.GN6014@localhost> References: <0c2b76aba6a49e583f920ae582d6815fa9cc4361.1523346135.git.baolin.wang@linaro.org> <20180411093634.GC6014@localhost> <20180412093735.GF6014@localhost> <20180413034332.GI6014@localhost> <20180413063641.GL6014@localhost> <20180413101140.GN6014@localhost> From: Baolin Wang Date: Fri, 13 Apr 2018 18:48:43 +0800 Message-ID: Subject: Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration To: Vinod Koul Cc: Dan Williams , Eric Long , Mark Brown , dmaengine@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13 April 2018 at 18:11, Vinod Koul wrote: > 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 :) I do not think so. That's the DMA configuration need to set before audio use it. Not only audio, but also other drivers using DMA need to configure these configuration what we exported in sprd_dma_config. > > 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 Yes, we have not implemented the link list mode for audio now, but in our plan. So firstly we want to export these necessary configuration for users to configure. -- Baolin.wang Best Regards