Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp21214lfv; Tue, 12 Apr 2022 15:34:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOEK7xBcE/L5W4PRE8Gsu3AKiiZgnXYgfhjjzKobQgmODpJJBf/dl/I5XkLmgq9dNMLDzl X-Received: by 2002:a17:903:1cd:b0:158:8feb:86bc with SMTP id e13-20020a17090301cd00b001588feb86bcmr4053418plh.114.1649802841280; Tue, 12 Apr 2022 15:34:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649802841; cv=none; d=google.com; s=arc-20160816; b=WXjQCNq00eNoKzlUjJ4ChBPYoVIS5TdLLi3aImJvALxOkH+oAIUs0T5kl7kpiL63op x/rSYpkCERPDCNoAYWlVnJ4BDAd4R62kXqQBb3O6hl2MQwHcb0UdEteRHlmg4RlQFaGX vmRRYKNPb7K6pGqWElgi7hFaAqE84TshIjG3+m6RaCnJvQNnoK4FPBonGvK1zKQvBmpO TRH5piC8aK2gwnEVn2G+Mu3qHSY2YDnlGcmezT/QjRTXjuAI9c/AUElyjwBUg+5yVFPa p/NtKKQi5XxPWNmPhyHRdKWTdoDnturuyqRiIU/AUlgOSXSBM3dLzzK+HNGbfZLh/heB pkEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=hwbJIxelmWdIS66BARh342xTfH8FL/04PoHG44kF7GU=; b=f/zzYBlFuHGRO3ybZFIX+ZAFkiMzgo9H4kR0BjcneahF10Jt8YagZAhfZwW3CK4xBS wZymbj/hMJ2A6JJLaPT9C7ZwutWgXKYvu+gefDREUgSCt8f+jD7gmU/qkC/+KRI5yqGw U1XGr0dP9s4Gbzl4bt6/qFHzHhXux/xFI6XK9kpnxkqoIo9nW77r5FE/XTgB+pYiu8av imF2mABzH8P3j74jkQ7NVcn/vyCH1Pd6PCCLOZTDhep0j72Qe6TZvh1QxR+MArKNIqrV Iq7NAiu+SVQhywNtGyYsf0UDLmRwPDEATOATd/ZGC9k3o0y5i9qvcZaX3Vx8X9XHuc2x yHTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y18-20020a63fa12000000b003991d7c288fsi3998748pgh.561.2022.04.12.15.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:34:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 969ACE29E3; Tue, 12 Apr 2022 14:10:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240088AbiDLKWU (ORCPT + 99 others); Tue, 12 Apr 2022 06:22:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380373AbiDLKU3 (ORCPT ); Tue, 12 Apr 2022 06:20:29 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DB7212606 for ; Tue, 12 Apr 2022 02:24:34 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 2FD681A227D; Tue, 12 Apr 2022 11:24:33 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EE26E1A224E; Tue, 12 Apr 2022 11:24:32 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id AF84E184BDC5; Tue, 12 Apr 2022 17:24:31 +0800 (+08) From: Shengjiu Wang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, patches@opensource.cirrus.com, alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com Subject: [PATCH] ASoC: wm8524: remove rate constraint for FE-BE case Date: Tue, 12 Apr 2022 17:13:46 +0800 Message-Id: <1649754826-2651-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The constraint is propagate to Front End Bitstream for Front End and Back End share same snd_soc_pcm_runtime. The constraint is not needed for Back End Bitstream when there is be_hw_params_fixup() defined. Signed-off-by: Shengjiu Wang Tested-by: Fabio Estevam --- sound/soc/codecs/wm8524.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wm8524.c b/sound/soc/codecs/wm8524.c index 81f858f6bd67..442a59857875 100644 --- a/sound/soc/codecs/wm8524.c +++ b/sound/soc/codecs/wm8524.c @@ -61,6 +61,7 @@ static int wm8524_startup(struct snd_pcm_substream *substream, { struct snd_soc_component *component = dai->component; struct wm8524_priv *wm8524 = snd_soc_component_get_drvdata(component); + struct snd_soc_pcm_runtime *rtd = substream->private_data; /* The set of sample rates that can be supported depends on the * MCLK supplied to the CODEC - enforce this. @@ -71,9 +72,10 @@ static int wm8524_startup(struct snd_pcm_substream *substream, return -EINVAL; } - snd_pcm_hw_constraint_list(substream->runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, - &wm8524->rate_constraint); + if (!rtd->dai_link->be_hw_params_fixup) + snd_pcm_hw_constraint_list(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_RATE, + &wm8524->rate_constraint); gpiod_set_value_cansleep(wm8524->mute, 1); -- 2.17.1