Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7882887rwl; Thu, 23 Mar 2023 09:46:03 -0700 (PDT) X-Google-Smtp-Source: AKy350a8mIIm/khH9K9d+KD9qv4KtP+0ueEm4DkXAalvqX38kA2QI+pgv/PRoDnH0bYODfj3RsMh X-Received: by 2002:aa7:d3c6:0:b0:4fe:1b54:4351 with SMTP id o6-20020aa7d3c6000000b004fe1b544351mr83807edr.4.1679589963681; Thu, 23 Mar 2023 09:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679589963; cv=none; d=google.com; s=arc-20160816; b=jEphru6SyptebmXfYIXRyQSYdAOHE6OCfRhp18pdib+GzPN6KCIp1PTJcoNxfz6x+i Af2S4sm17oFwad0GtsbsNpIAxWTqJn2oMrv3YeioaS9poUQR/Djy0ZUUFqTCVL6d9AO8 DxJE06t+FEKnPTBcnvy7J3pYfJEJ/TKZWtcG0VWRMm6nJQAL9TTLS4ReMC6xuhOiHGoq Rk6cXp3R4kVXc+s27kna33IX71iUdFm11FeQp+fyl6RuXeReMnR+j1+KDnwjyxWyFgFO cgV0yyPdMk0VH1dt+IiHb8m3fA/OS8+nYOGjnbaOGZkqsOz2anqgiNSe1fKllLKxygLT 5IRQ== 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 :dkim-signature; bh=4p58Lw+agHASsKfJ6aDJH9J3fw9PY/7V6UBtha5qnBQ=; b=kLZvBQO5elsL8qG4WvqqI+7UA+jTxuo4OxLrFaFMndawTHfT5HZLlfYgqSajL/7QoZ Trr1+T5HxyOVgX0CFcBK+nhxSssxltd4OLWHhl/WfD6CfcPVlfE+cZguXQGk9JM8XtXQ T4Tao/kSYil9hmoY59writMlOGYSR9IXOXRE0ghmmDUxVPb/rTxzCj3AENZgZzEb3JLf bp5P0Oy/O/C16yyj3j2Aw6bSoxJFDR99AkzX2DD1QBauurAICBAj+6h2iWXFw9tJyEex srrotBiaVVGVI954IUmxgHMaKsLwp1RH3Th3GiALtZLcnGK1gm8ghp2ul4skidv32bJ6 574g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mkSLbSGc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020aa7c607000000b004ace582aca8si10976214edq.256.2023.03.23.09.45.37; Thu, 23 Mar 2023 09:46:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mkSLbSGc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232432AbjCWQpZ (ORCPT + 99 others); Thu, 23 Mar 2023 12:45:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231358AbjCWQpC (ORCPT ); Thu, 23 Mar 2023 12:45:02 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78526BDC5 for ; Thu, 23 Mar 2023 09:44:16 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id eh3so89494192edb.11 for ; Thu, 23 Mar 2023 09:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679589856; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4p58Lw+agHASsKfJ6aDJH9J3fw9PY/7V6UBtha5qnBQ=; b=mkSLbSGc8DserzlRocfmGovK4CVXM9wFX93zf+RwrfRNWUdp0Aqb3/jH+3ZaNQ99Mu 5pnqk8ZX63k1t+viVUk0gpVnV4uNs+fEL6HN7KBXrplCxQSWeBe+qV8rUHCuZCVMfaUJ UCmEeyBAG8reHjZxRR+Uk1XhfRgn/00G0CNcSpQfjbGGoeNF/kyd5/CbsnC+e7IoKdo6 8JzuammEipu17QgSECVds5BEVRGVaL0mooaiJqUw+B6oO2CWoShT5kq9DFIZ3jTg1n+2 1WaNZ7pGrmOJhHD7qg9vPhIorYzlbU8fynb98St6KupzEuMSjsPbYpaE4hzjlEHyIKqq OIdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679589856; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4p58Lw+agHASsKfJ6aDJH9J3fw9PY/7V6UBtha5qnBQ=; b=sFiTL4XP/AaoXPz0XE2b/S7o7Jp5ITli9zF2Cvb+f9FAUvEp/jXqRvD+B1xjsVhnXE wRuvN8jzqhVFHF3ASQAfAEwcuHEPGrOHarif7en9QoTbZKp0KoBloIIG/pe6kM8rCB3Y 9nDpqUj2MS18+FIehDGW3oLkaYkkw8UXYYQvqHhQsQo1aWVmBip0ALwBsoF2ChTDy8Fl 6zbhpjaFz2WA28TaA4ZOYLaVXEF9ujuQK7/2NyPUk9NbKjJSoe7Bn1qnuVrKY1ppyq/Y yLPgnL986c8YDBFEetZdDtOZUShoxNVSap23R42NDKoCuS8TW98027ovTECsjUQ+LMSJ 41ng== X-Gm-Message-State: AO0yUKW/LY+EsTyfCruILu6T0OKRHFsZ8CzVZorLJENxUxBD+2IgseeD vLUFoYrJOz/kQfovQM2vvckonw== X-Received: by 2002:a17:906:6d4e:b0:8b8:c06e:52d8 with SMTP id a14-20020a1709066d4e00b008b8c06e52d8mr11481150ejt.36.1679589855954; Thu, 23 Mar 2023 09:44:15 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id m10-20020a50998a000000b004e48f8df7e2sm9542187edb.72.2023.03.23.09.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 09:44:15 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: perex@perex.cz, tiwai@suse.com, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, johan+linaro@kernel.org, steev@kali.org, dmitry.baryshkov@linaro.org, Srinivas Kandagatla Subject: [PATCH 2/4] ASoC: qcom: sdw: do not restart soundwire ports for every prepare Date: Thu, 23 Mar 2023 16:44:01 +0000 Message-Id: <20230323164403.6654-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20230323164403.6654-1-srinivas.kandagatla@linaro.org> References: <20230323164403.6654-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 unpreparing/disabling and preparing/reenabling soundwire ports is not required for every prepare call, this add lots of click and pop noise if we do this in middle of playback or capture. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/sdw.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sound/soc/qcom/sdw.c b/sound/soc/qcom/sdw.c index 10249519a39e..1a41419c7eb8 100644 --- a/sound/soc/qcom/sdw.c +++ b/sound/soc/qcom/sdw.c @@ -32,11 +32,8 @@ int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream, return 0; } - if (*stream_prepared) { - sdw_disable_stream(sruntime); - sdw_deprepare_stream(sruntime); - *stream_prepared = false; - } + if (*stream_prepared) + return 0; ret = sdw_prepare_stream(sruntime); if (ret) -- 2.21.0