From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8793EC2BB1D for ; Fri, 17 Apr 2020 05:10:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1541D221E9 for ; Fri, 17 Apr 2020 05:10:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="QNzPC7u+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1541D221E9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 49F171666; Fri, 17 Apr 2020 07:09:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 49F171666 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1587100246; bh=ljnl5txoyzy9ggcsBWdvHaPPmC6BFy5mJIeSotOS/2I=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QNzPC7u+3n7gs6UubBGTd7woP7gTOqdg4NCONE8JLT2y8mceDUhOdyS8pJJOthp8b uuVQlx922lB/SRlMk6SBNHLJYvoXESuMnE+AE5s20SicH2tY2rlZH39QoX0QB+RS8C Q8uqPClyKIHYAvds3bdzfEycGM/l9OxeMIKiydI4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 430B8F802DD; Fri, 17 Apr 2020 07:07:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 62C21F802A8; Fri, 17 Apr 2020 07:07:01 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 242B9F802A8 for ; Fri, 17 Apr 2020 07:06:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 242B9F802A8 Date: 17 Apr 2020 14:06:56 +0900 X-IronPort-AV: E=Sophos;i="5.72,393,1580742000"; d="scan'208";a="44972254" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 17 Apr 2020 14:06:56 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B422C4132521; Fri, 17 Apr 2020 14:06:56 +0900 (JST) Message-ID: <873692puof.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 6/8] ASoC: sof: use snd_compress_ops User-Agent: Wanderlust/2.15.9 Emacs/25.2 Mule/6.0 To: Mark Brown In-Reply-To: <87blnqpuqp.wl-kuninori.morimoto.gx@renesas.com> References: <87blnqpuqp.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto We can use snd_compress_ops. Let's switch to use it. Upstream code doesn't have sof_compressed_ops. This patch assume it is implemented at out-of-tree. Signed-off-by: Kuninori Morimoto --- sound/soc/sof/compress.c | 34 +++++++++++++++++++++------------- sound/soc/sof/compress.h | 34 +++++++++++++++++++++------------- sound/soc/sof/pcm.c | 4 ++-- sound/soc/sof/sof-priv.h | 2 +- 4 files changed, 45 insertions(+), 29 deletions(-) diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c index 7354dc6a49cf..52a1d7ed97a5 100644 --- a/sound/soc/sof/compress.c +++ b/sound/soc/sof/compress.c @@ -13,13 +13,14 @@ #include "ops.h" #include "probe.h" -struct snd_compr_ops sof_probe_compressed_ops = { +struct snd_compress_ops sof_probe_compressed_ops = { .copy = sof_probe_compr_copy, }; EXPORT_SYMBOL(sof_probe_compressed_ops); -int sof_probe_compr_open(struct snd_compr_stream *cstream, - struct snd_soc_dai *dai) +int sof_probe_compr_open(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + struct snd_soc_dai *dai) { struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(dai->component); @@ -36,8 +37,9 @@ int sof_probe_compr_open(struct snd_compr_stream *cstream, } EXPORT_SYMBOL(sof_probe_compr_open); -int sof_probe_compr_free(struct snd_compr_stream *cstream, - struct snd_soc_dai *dai) +int sof_probe_compr_free(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + struct snd_soc_dai *dai) { struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(dai->component); @@ -68,8 +70,10 @@ int sof_probe_compr_free(struct snd_compr_stream *cstream, } EXPORT_SYMBOL(sof_probe_compr_free); -int sof_probe_compr_set_params(struct snd_compr_stream *cstream, - struct snd_compr_params *params, struct snd_soc_dai *dai) +int sof_probe_compr_set_params(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + struct snd_compr_params *params, + struct snd_soc_dai *dai) { struct snd_compr_runtime *rtd = cstream->runtime; struct snd_sof_dev *sdev = @@ -97,8 +101,9 @@ int sof_probe_compr_set_params(struct snd_compr_stream *cstream, } EXPORT_SYMBOL(sof_probe_compr_set_params); -int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd, - struct snd_soc_dai *dai) +int sof_probe_compr_trigger(struct snd_soc_component *component, + struct snd_compr_stream *cstream, int cmd, + struct snd_soc_dai *dai) { struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(dai->component); @@ -107,8 +112,10 @@ int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd, } EXPORT_SYMBOL(sof_probe_compr_trigger); -int sof_probe_compr_pointer(struct snd_compr_stream *cstream, - struct snd_compr_tstamp *tstamp, struct snd_soc_dai *dai) +int sof_probe_compr_pointer(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + struct snd_compr_tstamp *tstamp, + struct snd_soc_dai *dai) { struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(dai->component); @@ -117,8 +124,9 @@ int sof_probe_compr_pointer(struct snd_compr_stream *cstream, } EXPORT_SYMBOL(sof_probe_compr_pointer); -int sof_probe_compr_copy(struct snd_compr_stream *cstream, - char __user *buf, size_t count) +int sof_probe_compr_copy(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + char __user *buf, size_t count) { struct snd_compr_runtime *rtd = cstream->runtime; unsigned int offset, n; diff --git a/sound/soc/sof/compress.h b/sound/soc/sof/compress.h index 800f163603e1..afc7ab9bc3c9 100644 --- a/sound/soc/sof/compress.h +++ b/sound/soc/sof/compress.h @@ -13,19 +13,27 @@ #include -extern struct snd_compr_ops sof_probe_compressed_ops; +extern struct snd_compress_ops sof_probe_compressed_ops; -int sof_probe_compr_open(struct snd_compr_stream *cstream, - struct snd_soc_dai *dai); -int sof_probe_compr_free(struct snd_compr_stream *cstream, - struct snd_soc_dai *dai); -int sof_probe_compr_set_params(struct snd_compr_stream *cstream, - struct snd_compr_params *params, struct snd_soc_dai *dai); -int sof_probe_compr_trigger(struct snd_compr_stream *cstream, int cmd, - struct snd_soc_dai *dai); -int sof_probe_compr_pointer(struct snd_compr_stream *cstream, - struct snd_compr_tstamp *tstamp, struct snd_soc_dai *dai); -int sof_probe_compr_copy(struct snd_compr_stream *cstream, - char __user *buf, size_t count); +int sof_probe_compr_open(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + struct snd_soc_dai *dai); +int sof_probe_compr_free(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + struct snd_soc_dai *dai); +int sof_probe_compr_set_params(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + struct snd_compr_params *params, + struct snd_soc_dai *dai); +int sof_probe_compr_trigger(struct snd_soc_component *component, + struct snd_compr_stream *cstream, int cmd, + struct snd_soc_dai *dai); +int sof_probe_compr_pointer(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + struct snd_compr_tstamp *tstamp, + struct snd_soc_dai *dai); +int sof_probe_compr_copy(struct snd_soc_component *component, + struct snd_compr_stream *cstream, + char __user *buf, size_t count); #endif diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index 47cd741f2a8c..0885826adb6c 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -785,11 +785,11 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev) pd->pointer = sof_pcm_pointer; #if IS_ENABLED(CONFIG_SND_SOC_SOF_COMPRESS) - pd->compr_ops = &sof_compressed_ops; + pd->compress_ops = &sof_compressed_ops; #endif #if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_PROBES) /* override cops when probe support is enabled */ - pd->compr_ops = &sof_probe_compressed_ops; + pd->compress_ops = &sof_probe_compressed_ops; #endif pd->pcm_construct = sof_pcm_new; pd->ignore_machine = drv_name; diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index a4b297c842df..965b9da696d5 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -522,7 +522,7 @@ void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev); /* * Platform specific ops. */ -extern struct snd_compr_ops sof_compressed_ops; +extern struct snd_compress_ops sof_compressed_ops; /* * DSP Architectures. -- 2.17.1