Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp575031ybg; Wed, 10 Jun 2020 08:10:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjFU+UZ7rZrdOFrFGsbh0IO5J8niIXR1He2yo5UH+OUeWkIsy09eZ0PxWxMQngg7JhPtGu X-Received: by 2002:aa7:c60e:: with SMTP id h14mr2925897edq.104.1591801846883; Wed, 10 Jun 2020 08:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591801846; cv=none; d=google.com; s=arc-20160816; b=XMvLZSjeqZHp1twF8YZYTFgvNF0RkmLmMk+MjYXV+hB+5/AGJHz8819rpbZdmU1Q4t U18iaGhj7YWusdbMUyTF0ifGrOcDYVRVi8+OJSplj3EZMp5F+Oup1Few5C12dMDFbA+n LrrdUtVs7d2ba0slCN5glSAqVKjYiOArWCBjrCT4MuSuW+uWIw0afKK1u1tLxJnww5d+ q+tr4Uyw14SiHJmFw0lKUDoP+Hg+1/NCVXUNhmkW6IqGLbLoifN1RQtfef1gz2uEZiiZ l+rD1apH+o2Uv6NsjotMmc3s42yw2y3UrLLVNkmcktLN0NGdNyW/GnB7Ifgfy36TTGQR MQkg== 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=UnDy64hZljmzCCB4ewm5NG3RMnOxSBIzsq7K4ctU/L8LrejKGatRh3nQqeoNiuC9PE 7J4tcL5pb/W4bVQ41EoblKvIxD8wTk6hJeXxVTqjykPaxPeJ8Qc3Eyl7hPxFt80J67R3 S4r5YK9pBp2oNkkLBJI9thBMCYzH7DAchv9ugWseZduF5E8eMMD+NyUbQGUhTclFoOTB o6fL3CEfIlvpGAu7obMoHFPXkA+FNVQx+C6n53dYUQh8KL4fmZ5h8IPcMHpeWx/ejB61 yACFsMEop6JCVw+7Wy9uh3uQOdFyUC6tBYbr9auys73YkhgTm2WkNy90bL369FUfcpSq g2Rg== 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 ss12si171649ejb.188.2020.06.10.08.10.24; Wed, 10 Jun 2020 08:10:46 -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 S1728201AbgFJKQ6 (ORCPT + 99 others); Wed, 10 Jun 2020 06:16:58 -0400 Received: from inva020.nxp.com ([92.121.34.13]:46794 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbgFJKQp (ORCPT ); Wed, 10 Jun 2020 06:16:45 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 91C491A0447; Wed, 10 Jun 2020 12:16:43 +0200 (CEST) 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 AE2F31A046E; Wed, 10 Jun 2020 12:16:38 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 4C632402F3; Wed, 10 Jun 2020 18:16:32 +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 v2 2/3] ASoC: dmaengine_pcm: export soc_component_to_pcm Date: Wed, 10 Jun 2020 18:05:48 +0800 Message-Id: <429c6ae1f3c5b47eb893f475d531d71cdcfe34c0.1591783089.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