Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4231731pxb; Tue, 26 Jan 2021 16:28:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtX05hDGdCi50tUCwI/5siUYlkPAG60KVRDJ+7NCLDm9k5fZrtyVpVVJ/h1jqvcaUmDSGA X-Received: by 2002:a50:e0c1:: with SMTP id j1mr6416714edl.253.1611707318962; Tue, 26 Jan 2021 16:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611707318; cv=none; d=google.com; s=arc-20160816; b=P+J7wS1rnS5s5FgP92uq6OSkO7px/uxF2+E7GjAjLU/lqO6V/GSvzsLW0w7Fn8cUts qOOCqZKONNk8K9oi2ZTTeK2SMWOMHpEH2C4WcNADnuyuC+PzXt9vo0jvahv9yegy/9t3 fuEx3ccG2zq+1LKI34hITwyqVUDOdD/EjJnBS4fonnDliIrJE3a5dNp8c5Zm3QscZov8 sJeuyTwZdlQNljvvJmrVenMib2tvcyAgmY0N+Mpis7mgra+H6feudKElL+Hp8ozmnUod gjG+WM3er9ELfCzDDmFQju6GcWxUTcOSlppfHQEqOJ3MNjdqiTs9BCPWsdnZbj4jIwaE YlYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=c12WrviFq0vx3MfkcTG9d+BkMJPl35SJWcdqdIyO4VQ=; b=vSJ2qburuoAeVk66le3eQm9/KitXcP4ydVP2bpesI8wRqiHaN4gO7aq3QCYjTQZ3Nf IWWsPXlfo1+rkvWUbf5kEZw9Ml+UhMIGcXes2AwE1lcAyXhwdOys0cBfTyUPYLN42uRN P2uvp0Ig3w/ab4meRU0Dq9Dpbmcx9h1wmk+kT8U02uuqiLUYvGm3UWu+1Mn6YcgPAWYh K5hmjAiIaZTVx4ydL0n4OQhMgTf02LQsTimCc7hbGJIMEP8fzwYuAbkeW3Az4pHOt83n GYVbysiFCErQ8ryUq5Gz8MbZ+Jht5YHOLfugT8TQaH1CnqBBSYMgY/Kj730cY4P8p80W 8Tfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a27si89200ejc.18.2021.01.26.16.28.14; Tue, 26 Jan 2021 16:28:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388651AbhAZXZA (ORCPT + 99 others); Tue, 26 Jan 2021 18:25:00 -0500 Received: from inva020.nxp.com ([92.121.34.13]:56928 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732442AbhAZFte (ORCPT ); Tue, 26 Jan 2021 00:49:34 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3BC741A0168; Tue, 26 Jan 2021 06:48:46 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E33541A0C31; Tue, 26 Jan 2021 06:48:43 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id AF022402F0; Tue, 26 Jan 2021 06:48:40 +0100 (CET) From: Shengjiu Wang To: lars@metafoo.de, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: dmaengine_pcm: add peripheral configuration Date: Tue, 26 Jan 2021 13:38:16 +0800 Message-Id: <1611639496-4616-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit e7bbb7acabf4 ("dmaengine: add peripheral configuration") adds peripheral configuration for dma_slave_config. This configuration is useful for some audio peripherals, for example, the peripheral supports multi fifos, we can let the DMA know which fifos are selected. So also add this configuration for snd_dmaengine_dai_dma_data. Signed-off-by: Shengjiu Wang --- include/sound/dmaengine_pcm.h | 5 +++++ sound/core/pcm_dmaengine.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index 8c5e38180fb0..96666efddb39 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -66,6 +66,9 @@ struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream) * @chan_name: Custom channel name to use when requesting DMA channel. * @fifo_size: FIFO size of the DAI controller in bytes * @flags: PCM_DAI flags, only SND_DMAENGINE_PCM_DAI_FLAG_PACK for now + * @peripheral_config: peripheral configuration for programming peripheral + * for dmaengine transfer + * @peripheral_size: peripheral configuration buffer size */ struct snd_dmaengine_dai_dma_data { dma_addr_t addr; @@ -76,6 +79,8 @@ struct snd_dmaengine_dai_dma_data { const char *chan_name; unsigned int fifo_size; unsigned int flags; + void *peripheral_config; + size_t peripheral_size; }; void snd_dmaengine_pcm_set_config_from_dai_data( diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index 4d0e8fe535a1..1fc2fa077574 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -125,6 +125,8 @@ void snd_dmaengine_pcm_set_config_from_dai_data( } slave_config->slave_id = dma_data->slave_id; + slave_config->peripheral_config = dma_data->peripheral_config; + slave_config->peripheral_size = dma_data->peripheral_size; } EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_set_config_from_dai_data); -- 2.27.0