Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp903117pxf; Thu, 11 Mar 2021 18:56:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJytTmTvrT0Etl9yU3ppPRn4u9NQZVPnhSlu6MWIAusaFckPqzVBZDqoUVmsAu0VwpuQaRW3 X-Received: by 2002:a05:6402:158d:: with SMTP id c13mr11610805edv.297.1615517814317; Thu, 11 Mar 2021 18:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615517814; cv=none; d=google.com; s=arc-20160816; b=tpwwGJd7FbOxSNugdxd6sid1NSK5stro1hoKTL+ktnsq+Fo/O+klNZ7ogK+DMt0GaF onoT+HwdnIQtz4fReelFaToX4ZKlbAn30cb4kGcBq5ypOeiahsuJj5H8vJCEb+T+ipnN 7FNN89LA7wFju3VBKlUy6KugzM6g7+VILrUOmoZYe6ezcjunhlbc4AfYg7WsiVs4hNbs uT/2QQYRFFxGvNIxtE9+x59wZ0nVNsF4IZv1htm1jVXe4QBD8ssLV7WbTL2eXSP81pL7 877Q1HREyAgZ3MJ5Hso1k4hpz78WF+6WDD05yCkAa+onoa3HhrHMCM8MWM0xXNaG22Oa 6AWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from; bh=0TC2cTbQEoEWbYHH7znPE1zK19tfJIcoDmAaCs722Qg=; b=Sslq17QDe2k5aF8HfeBL3HM+njxJJRpbUwjXe3AaUsveV2TxGVlr43jD/+YbjwQaHS GJjxX7cBLuBrBpo66LUlg7yXcTjZqi+Skkif/vXUXhWTb6QjeXWB40IbF6T2ztnDVyba BLr1WexG5D2BJqZwkaYSdmKkbt8VfwZaSefUgx12tf2r+tcNHgxKwFXpiWjr7zJjA3vs eFZ5ddT/fSwsMq5zbxBfgtp5CgavwEI6feEYskPDxC6sXCXlA80EJhcpiUx9PW4RRyuI phXwChVkA4qN3zNLSogdl9/zQ6HUCp7/o9L0Odp2N3n0JwHMFvq1ENtx7jyw6t91q9T1 NDRg== 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 g21si2998449eje.108.2021.03.11.18.56.32; Thu, 11 Mar 2021 18:56:54 -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 S231368AbhCLCyI (ORCPT + 99 others); Thu, 11 Mar 2021 21:54:08 -0500 Received: from inva020.nxp.com ([92.121.34.13]:53058 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231439AbhCLCyB (ORCPT ); Thu, 11 Mar 2021 21:54:01 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C64161A04A3; Fri, 12 Mar 2021 03:54:00 +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 25C841A04A5; Fri, 12 Mar 2021 03:53:54 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 560E74029B; Fri, 12 Mar 2021 03:53:45 +0100 (CET) From: Shengjiu Wang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, linuxppc-dev@lists.ozlabs.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v5 1/6] ASoC: soc-component: Add snd_soc_pcm_component_ack Date: Fri, 12 Mar 2021 10:38:40 +0800 Message-Id: <1615516725-4975-2-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1615516725-4975-1-git-send-email-shengjiu.wang@nxp.com> References: <1615516725-4975-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add snd_soc_pcm_component_ack back, which can be used to get an updated buffer pointer in the platform driver. On Asymmetric multiprocessor, this pointer can be sent to Cortex-M core for audio processing. Signed-off-by: Shengjiu Wang --- include/sound/soc-component.h | 3 +++ sound/soc/soc-component.c | 14 ++++++++++++++ sound/soc/soc-pcm.c | 2 ++ 3 files changed, 19 insertions(+) diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h index 7dc75b39287f..722cfab28d29 100644 --- a/include/sound/soc-component.h +++ b/include/sound/soc-component.h @@ -146,6 +146,8 @@ struct snd_soc_component_driver { int (*mmap)(struct snd_soc_component *component, struct snd_pcm_substream *substream, struct vm_area_struct *vma); + int (*ack)(struct snd_soc_component *component, + struct snd_pcm_substream *substream); const struct snd_compress_ops *compress_ops; @@ -498,5 +500,6 @@ int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd, void *stream); void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd, void *stream, int rollback); +int snd_soc_pcm_component_ack(struct snd_pcm_substream *substream); #endif /* __SOC_COMPONENT_H */ diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index 8415e9bd2932..3a5e84e16a87 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -1212,3 +1212,17 @@ void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd, soc_component_mark_pop(component, stream, pm); } } + +int snd_soc_pcm_component_ack(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct snd_soc_component *component; + int i; + + /* FIXME: use 1st pointer */ + for_each_rtd_components(rtd, i, component) + if (component->driver->ack) + return component->driver->ack(component, substream); + + return 0; +} diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index ba8ffbf8a5d3..e75b404a9f36 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2826,6 +2826,8 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) rtd->ops.page = snd_soc_pcm_component_page; if (drv->mmap) rtd->ops.mmap = snd_soc_pcm_component_mmap; + if (drv->ack) + rtd->ops.ack = snd_soc_pcm_component_ack; } if (playback) -- 2.27.0