Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp290406pxu; Fri, 23 Oct 2020 00:14:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfGB+pq/SdeEqrxtO+XuVIeltlv7t5TsipghA/LwsJQbgtYvDa/vv1Bp/gm3tr2nrSTG38 X-Received: by 2002:a17:906:8293:: with SMTP id h19mr640016ejx.130.1603437258070; Fri, 23 Oct 2020 00:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603437258; cv=none; d=google.com; s=arc-20160816; b=kXSUMyzqCUizwyb06mzylQVF00q9Vrni27KQm0c/crtikm9e7MOGKLzQa83Ux9J81h Kv+54CuIZeEaGsPZHtOuhKdC7x5mfzeMpJnijfQiDVpnmTKzgAt+1r42rmvoN5w2zcZG RwLd5CsDimVL4TvtY+93gBS/X0LUe1E85/ZSS8zQvv68Lz46tNjO/qhyKQuvjygf3wdL 5PAks4XncD/SDzz26gIPOqdMAIdGzdjnw1gyn+ENH0lPvEs7sA1ym+9+LhnBrhJPHXWG zpJENYWRctS/5jQA2Xi2pRowT7SSdfGCe/UojzR+vTqR1lPTl90P43WbpjGSQx2i6Lt1 QvQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=Rg9/Dew2F/2VhfKAsFTCJ1KBTYxKHigqrIXBXSe/HiI=; b=XnFUh62UOH+0gebuS7Jq+LkG9lqzOZvEErVyXZCHCqOubsdGugqhiv+LP/EKMVHLut PB5Yx4jqwBZW/J06bNbACy6DvYQrca0nT5KmoE3Eqi6vPLTo5X9rRyiSkv8zOiW47tyH 2ok9M/mZjjJ9qF78Lhb1B+btyEE//xHlmehD7uJvpiSrKVs8hc+zoJ89cgXceb+hImUT coAS/P33rqFK/TX7b5Y8czsHC+WUX6oXFK3bADzg9ls4ln+SS1Q4cURe6TSWF9Ugbaad /RO45MTeH3xXwiQE9/122f3l8afbSbErAmhxExH6Kr5DyV5l/55ICNFJJ7YVyIF2VspO RDlg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt13si284721ejb.195.2020.10.23.00.13.55; Fri, 23 Oct 2020 00:14:18 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S373927AbgJWAfi (ORCPT + 99 others); Thu, 22 Oct 2020 20:35:38 -0400 Received: from mga11.intel.com ([192.55.52.93]:43018 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S373855AbgJWAfa (ORCPT ); Thu, 22 Oct 2020 20:35:30 -0400 IronPort-SDR: rfQdzNuwdYgwltS9QZkTBOv7Wp4bLJZstBs/gAFhywXgQbfG80WnDUW3Fb6C4xPmloH4JXmEt1 mHS9eOa5JNqg== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="164118649" X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="164118649" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 17:35:27 -0700 IronPort-SDR: i7OEA259GyUOowfHePBXVGXg7D8v4EvdiKvZDDeFM1HCojofUBOP9qDO9exRdoVIqiOSHj57M/ yRuuNOmljpgw== X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="302505820" Received: from dmert-dev.jf.intel.com ([10.166.241.5]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 17:35:26 -0700 From: Dave Ertman To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, linux-rdma@vger.kernel.org, jgg@nvidia.com, dledford@redhat.com, netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, gregkh@linuxfoundation.org, ranjani.sridharan@linux.intel.com, pierre-louis.bossart@linux.intel.com, fred.oh@linux.intel.com, parav@mellanox.com, shiraz.saleem@intel.com, dan.j.williams@intel.com, kiran.patil@intel.com, linux-kernel@vger.kernel.org, leonro@nvidia.com Subject: [PATCH v3 07/10] ASoC: SOF: sof-client: Add client APIs to access probes ops Date: Thu, 22 Oct 2020 17:33:35 -0700 Message-Id: <20201023003338.1285642-8-david.m.ertman@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201023003338.1285642-1-david.m.ertman@intel.com> References: <20201023003338.1285642-1-david.m.ertman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ranjani Sridharan Add client APIs to invoke the platform-specific DSP probes ops. Also, add a new API to get the SOF core device pointer which will be used for DMA buffer allocation. Reviewed-by: Pierre-Louis Bossart Tested-by: Fred Oh Signed-off-by: Ranjani Sridharan Signed-off-by: Dave Ertman --- sound/soc/sof/sof-client.c | 55 ++++++++++++++++++++++++++++++++++++++ sound/soc/sof/sof-client.h | 25 +++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/sound/soc/sof/sof-client.c b/sound/soc/sof/sof-client.c index dd75a0ba4c28..838aaa5ea179 100644 --- a/sound/soc/sof/sof-client.c +++ b/sound/soc/sof/sof-client.c @@ -11,6 +11,7 @@ #include #include #include +#include "ops.h" #include "sof-client.h" #include "sof-priv.h" @@ -112,4 +113,58 @@ struct dentry *sof_client_get_debugfs_root(struct sof_client_dev *cdev) } EXPORT_SYMBOL_NS_GPL(sof_client_get_debugfs_root, SND_SOC_SOF_CLIENT); +#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES_CLIENT) +int sof_client_probe_compr_assign(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, + struct snd_soc_dai *dai) +{ + return snd_sof_probe_compr_assign(cdev->sdev, cstream, dai); +} +EXPORT_SYMBOL_NS_GPL(sof_client_probe_compr_assign, SND_SOC_SOF_CLIENT); + +int sof_client_probe_compr_free(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, + struct snd_soc_dai *dai) +{ + return snd_sof_probe_compr_free(cdev->sdev, cstream, dai); +} +EXPORT_SYMBOL_NS_GPL(sof_client_probe_compr_free, SND_SOC_SOF_CLIENT); + +int sof_client_probe_compr_set_params(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, + struct snd_compr_params *params, + struct snd_soc_dai *dai) +{ + return snd_sof_probe_compr_set_params(cdev->sdev, cstream, params, dai); +} +EXPORT_SYMBOL_NS_GPL(sof_client_probe_compr_set_params, SND_SOC_SOF_CLIENT); + +int sof_client_probe_compr_trigger(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, int cmd, + struct snd_soc_dai *dai) +{ + return snd_sof_probe_compr_trigger(cdev->sdev, cstream, cmd, dai); +} +EXPORT_SYMBOL_NS_GPL(sof_client_probe_compr_trigger, SND_SOC_SOF_CLIENT); + +int sof_client_probe_compr_pointer(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, + struct snd_compr_tstamp *tstamp, + struct snd_soc_dai *dai) +{ + return snd_sof_probe_compr_pointer(cdev->sdev, cstream, tstamp, dai); +} +EXPORT_SYMBOL_NS_GPL(sof_client_probe_compr_pointer, SND_SOC_SOF_CLIENT); +#endif + +/* + * DMA buffer alloc fails when using the client device. Use the SOF core device instead. + * This will be needed for clients other than the probes client device as well. + */ +struct device *sof_client_get_dma_dev(struct sof_client_dev *cdev) +{ + return cdev->sdev->dev; +} +EXPORT_SYMBOL_NS_GPL(sof_client_get_dma_dev, SND_SOC_SOF_CLIENT); + MODULE_LICENSE("GPL"); diff --git a/sound/soc/sof/sof-client.h b/sound/soc/sof/sof-client.h index 429282df9f65..be80053068c9 100644 --- a/sound/soc/sof/sof-client.h +++ b/sound/soc/sof/sof-client.h @@ -7,6 +7,10 @@ #include #include #include +#include +#include +#include +#include #define SOF_CLIENT_PROBE_TIMEOUT_MS 2000 @@ -50,6 +54,27 @@ int sof_client_ipc_tx_message(struct sof_client_dev *cdev, u32 header, void *msg size_t msg_bytes, void *reply_data, size_t reply_bytes); struct dentry *sof_client_get_debugfs_root(struct sof_client_dev *cdev); +struct device *sof_client_get_dma_dev(struct sof_client_dev *cdev); + +#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES_CLIENT) +int sof_client_probe_compr_assign(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, + struct snd_soc_dai *dai); +int sof_client_probe_compr_free(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, + struct snd_soc_dai *dai); +int sof_client_probe_compr_set_params(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, + struct snd_compr_params *params, + struct snd_soc_dai *dai); +int sof_client_probe_compr_trigger(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, int cmd, + struct snd_soc_dai *dai); +int sof_client_probe_compr_pointer(struct sof_client_dev *cdev, + struct snd_compr_stream *cstream, + struct snd_compr_tstamp *tstamp, + struct snd_soc_dai *dai); +#endif /** * module_sof_client_driver() - Helper macro for registering an SOF Client -- 2.26.2