Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp274249ybg; Fri, 12 Jun 2020 00:51:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd5+H5b+7/KCv73m/9+w6wu0b/aKiewv4RxWYLs2R8w+Lyt8Zbr5AVuFyRSyjI/6sNyBHO X-Received: by 2002:a17:906:cd06:: with SMTP id oz6mr12694048ejb.434.1591948274658; Fri, 12 Jun 2020 00:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591948274; cv=none; d=google.com; s=arc-20160816; b=PfGEhAdsxt3D5ZRFsGeWs9ul4QeJ+QSa0kyKPA6ELQxzetDdmW0/mOQgvIz4waao2C ds/skLC//pD+XrO4pDeno4n3xtOIM23eMa2x7rpY6WnbElbeOHx2jE5KU/YWHPWmsuH7 VsIqOtr9KBolKrkWLsiASSqry8L04u76HSaL8eeDpGlRWEZRYFnWzx9fbbNH+i5SMIdY cpcOeDujJWuGYQq224Pu6OQzazbOCY275xzk+kmYxIo0gkw/MlVLFvYGiT5LGxZEJyc1 qOMG1ojUxDcHirWD7LtY0q+3AvUCPAShqnwD0CdooysYilpXO+W/FtaWW8iebL6KspRe PJqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:to:from; bh=GsgLZ98kQqxKUgy+U60UCrfKJjImIGw6SDBoKQOppkQ=; b=zWtBjwAZtejyj+QL1TxkdLcNwWhfddyYpeibxyAwjhRiBsq91EXpGd3+25GO7Y0t99 FJ5u7yy7NFjdcGZ3d4UCDykk/PAFiiuSSM+d3k4SEU+PE1Xl2+WDZA+PKW569lBYbv0x YeQi9iBLMjRpm4ZmBfg8YJzrp76yoy77RGtfPWaF3hpkBl2SNaSNlwv/y4m4qZTahYQ4 nv1asRnq4MX+JRkd9g1CCtunZMJomikTNZkOr9E57o/6QO62nepVgVCaIgU70HLlE0oc tynBIvUjLLuOhcHoEFzuONYAqmWjHctcOhwfgOiB0D3M1hCIvEbZ8zuGEnUjtET5+ybo +GRw== 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 b18si3241201edx.581.2020.06.12.00.50.52; Fri, 12 Jun 2020 00:51:14 -0700 (PDT) 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 S1726513AbgFLHs5 (ORCPT + 99 others); Fri, 12 Jun 2020 03:48:57 -0400 Received: from inva021.nxp.com ([92.121.34.21]:38546 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbgFLHsx (ORCPT ); Fri, 12 Jun 2020 03:48:53 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C7779200922; Fri, 12 Jun 2020 09:48:49 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D9378200037; Fri, 12 Jun 2020 09:48:44 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 91748402FB; Fri, 12 Jun 2020 15:48:38 +0800 (SGT) From: Shengjiu Wang To: lars@metafoo.de, perex@perex.cz, tiwai@suse.com, lgirdwood@gmail.com, broonie@kernel.org, timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH v3 2/4] ASoC: dmaengine_pcm: export soc_component_to_pcm Date: Fri, 12 Jun 2020 15:37:49 +0800 Message-Id: <429c6ae1f3c5b47eb893f475d531d71cdcfe34c0.1591947428.git.shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In DPCM case, Front-End needs to get the dma chan which has been requested by Back-End and reuse it. Signed-off-by: Shengjiu Wang --- include/sound/dmaengine_pcm.h | 11 +++++++++++ sound/soc/soc-generic-dmaengine-pcm.c | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index b65220685920..8c5e38180fb0 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -161,4 +161,15 @@ int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, #define SND_DMAENGINE_PCM_DRV_NAME "snd_dmaengine_pcm" +struct dmaengine_pcm { + struct dma_chan *chan[SNDRV_PCM_STREAM_LAST + 1]; + const struct snd_dmaengine_pcm_config *config; + struct snd_soc_component component; + unsigned int flags; +}; + +static inline struct dmaengine_pcm *soc_component_to_pcm(struct snd_soc_component *p) +{ + return container_of(p, struct dmaengine_pcm, component); +} #endif diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index f728309a0833..80a4e71f2d95 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -21,18 +21,6 @@ */ #define SND_DMAENGINE_PCM_FLAG_NO_RESIDUE BIT(31) -struct dmaengine_pcm { - struct dma_chan *chan[SNDRV_PCM_STREAM_LAST + 1]; - const struct snd_dmaengine_pcm_config *config; - struct snd_soc_component component; - unsigned int flags; -}; - -static struct dmaengine_pcm *soc_component_to_pcm(struct snd_soc_component *p) -{ - return container_of(p, struct dmaengine_pcm, component); -} - static struct device *dmaengine_dma_dev(struct dmaengine_pcm *pcm, struct snd_pcm_substream *substream) { -- 2.21.0