From patchwork Fri Apr 17 05:07:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192992 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 B89C9C2BB1D for ; Fri, 17 Apr 2020 05:11:51 +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 417BC21D94 for ; Fri, 17 Apr 2020 05:11:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="EJBbg52B" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 417BC21D94 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 A130A1660; Fri, 17 Apr 2020 07:10:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A130A1660 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1587100309; bh=yWWvu68lpPZXpTlxAJkzxn7e65cHfLpl5/a/hBagGXA=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EJBbg52BZzL6MHMVWRDNYddwID2oqjcSQSt5gZxC7wRI/V2bIMT6G81kKuAii4N7C rsCQMAL0bbYn44YVluw3SYEmD/OxPVxO+/cznRD8SGkp2iNff+Hsgd1RGtJKm33GSd Zhe6bQNceuOy6x+zCh+4SCXRpKf3oRoWxOIh0Bhw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4C666F802E8; Fri, 17 Apr 2020 07:07:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16F8AF802E3; Fri, 17 Apr 2020 07:07:13 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 84587F802DF for ; Fri, 17 Apr 2020 07:07:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 84587F802DF Date: 17 Apr 2020 14:07:08 +0900 X-IronPort-AV: E=Sophos;i="5.72,393,1580742000"; d="scan'208";a="44758898" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 17 Apr 2020 14:07:08 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 4FBE040A7323; Fri, 17 Apr 2020 14:07:08 +0900 (JST) Message-ID: <87zhbaog3n.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 8/8] ASoC: soc-compress: remove snd_compr_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") 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 snd_compr_ops couldn't care called component, but now we can care it via snd_compress_ops. All drivers switched to it. This patch removes snd_compr_ops. Signed-off-by: Kuninori Morimoto --- include/sound/soc-component.h | 1 - sound/soc/soc-compress.c | 145 ---------------------------------- 2 files changed, 146 deletions(-) diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h index 9122b11f51e9..864983b09846 100644 --- a/include/sound/soc-component.h +++ b/include/sound/soc-component.h @@ -146,7 +146,6 @@ struct snd_soc_component_driver { struct snd_pcm_substream *substream, struct vm_area_struct *vma); - const struct snd_compr_ops *compr_ops; /* remove me */ const struct snd_compress_ops *compress_ops; /* probe ordering - for components with runtime dependencies */ diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index 343de969179e..ceaf976db0bb 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -44,23 +44,6 @@ static int soc_compr_components_open(struct snd_compr_stream *cstream, } } - /* remvoe me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->open) - continue; - - ret = component->driver->compr_ops->open(cstream); - if (ret < 0) { - dev_err(component->dev, - "Compress ASoC: can't open platform %s: %d\n", - component->name, ret); - - *last = component; - return ret; - } - } - *last = NULL; return 0; } @@ -83,18 +66,6 @@ static int soc_compr_components_free(struct snd_compr_stream *cstream, component->driver->compress_ops->free(component, cstream); } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (component == last) - break; - - if (!component->driver->compr_ops || - !component->driver->compr_ops->free) - continue; - - component->driver->compr_ops->free(cstream); - } - return 0; } @@ -367,17 +338,6 @@ static int soc_compr_components_trigger(struct snd_compr_stream *cstream, return ret; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->trigger) - continue; - - ret = component->driver->compr_ops->trigger(cstream, cmd); - if (ret < 0) - return ret; - } - return 0; } @@ -481,17 +441,6 @@ static int soc_compr_components_set_params(struct snd_compr_stream *cstream, return ret; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->set_params) - continue; - - ret = component->driver->compr_ops->set_params(cstream, params); - if (ret < 0) - return ret; - } - return 0; } @@ -632,16 +581,6 @@ static int soc_compr_get_params(struct snd_compr_stream *cstream, break; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->get_params) - continue; - - ret = component->driver->compr_ops->get_params(cstream, params); - break; - } - err: mutex_unlock(&rtd->card->pcm_mutex); return ret; @@ -666,16 +605,6 @@ static int soc_compr_get_caps(struct snd_compr_stream *cstream, break; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->get_caps) - continue; - - ret = component->driver->compr_ops->get_caps(cstream, caps); - break; - } - mutex_unlock(&rtd->card->pcm_mutex); return ret; } @@ -699,17 +628,6 @@ static int soc_compr_get_codec_caps(struct snd_compr_stream *cstream, break; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->get_codec_caps) - continue; - - ret = component->driver->compr_ops->get_codec_caps(cstream, - codec); - break; - } - mutex_unlock(&rtd->card->pcm_mutex); return ret; } @@ -740,17 +658,6 @@ static int soc_compr_ack(struct snd_compr_stream *cstream, size_t bytes) goto err; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->ack) - continue; - - ret = component->driver->compr_ops->ack(cstream, bytes); - if (ret < 0) - goto err; - } - err: mutex_unlock(&rtd->card->pcm_mutex); return ret; @@ -779,16 +686,6 @@ static int soc_compr_pointer(struct snd_compr_stream *cstream, break; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->pointer) - continue; - - ret = component->driver->compr_ops->pointer(cstream, tstamp); - break; - } - mutex_unlock(&rtd->card->pcm_mutex); return ret; } @@ -812,16 +709,6 @@ static int soc_compr_copy(struct snd_compr_stream *cstream, break; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->copy) - continue; - - ret = component->driver->compr_ops->copy(cstream, buf, count); - break; - } - mutex_unlock(&rtd->card->pcm_mutex); return ret; } @@ -851,18 +738,6 @@ static int soc_compr_set_metadata(struct snd_compr_stream *cstream, return ret; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->set_metadata) - continue; - - ret = component->driver->compr_ops->set_metadata(cstream, - metadata); - if (ret < 0) - return ret; - } - return 0; } @@ -889,16 +764,6 @@ static int soc_compr_get_metadata(struct snd_compr_stream *cstream, component, cstream, metadata); } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->get_metadata) - continue; - - return component->driver->compr_ops->get_metadata(cstream, - metadata); - } - return 0; } @@ -1029,16 +894,6 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) break; } - /* remove me */ - for_each_rtd_components(rtd, i, component) { - if (!component->driver->compr_ops || - !component->driver->compr_ops->copy) - continue; - - compr->ops->copy = soc_compr_copy; - break; - } - mutex_init(&compr->lock); ret = snd_compress_new(rtd->card->snd_card, num, direction, new_name, compr);