From patchwork Wed Oct 25 14:45:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 737873 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5E5BCC25B47 for ; Wed, 25 Oct 2023 14:47:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CF76C7F8; Wed, 25 Oct 2023 16:46:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CF76C7F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1698245259; bh=nk8PnZvkM9dgf3oYiDp64P9nCqznqBo67f2J3QR0P6g=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=KCQN8iGtUq9ulODAf5sCyWPYoIZIxagBOoTC8zuK5dqiR9WOvxFucalSiJotyv+MR 1NIntLr8+mW7O5aHK9gFu/pK+FLim3l/VDWphnGM/HJuinVUFKZWMh4MEv+ZOKG6ON 7eARFtcPJltY7leJZt/l801A8/WDPHRwoJknBQMY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5E481F8010B; Wed, 25 Oct 2023 16:46:21 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B6FCCF8012B; Wed, 25 Oct 2023 16:46:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2987DF8019B; Wed, 25 Oct 2023 16:46:16 +0200 (CEST) Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 42CF4F8012B for ; Wed, 25 Oct 2023 16:46:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 42CF4F8012B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=fRa6sDXT Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-507d1cc0538so8314047e87.2 for ; Wed, 25 Oct 2023 07:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698245168; x=1698849968; darn=alsa-project.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7fCndReggPj8sG1syb2HDBs4AgKt0DkohlqpGAodX1o=; b=fRa6sDXTug7f7QjpzfSk5+B0TXDfg5SG5COL2Vv9CV9sCFS0yL4X27vnEImhvzEUVD 7x0jAmARD1liV/eoNEMRrzGUMHug23xkWjHAuIC9FpPxzQ1YzCkLjtr+JBV9nbXDCI4i 5A/t/pIHcHQNqRXJSEqRE4dNtahuTAedHbPzhceIWtKfElrDnWOXTw5ItFkVprlpw3Xh fTw5nT9ss2+bXJ2EF/BS6Q4h73O+opeuhzrL1WriC33WzE75saWrH+7xuTDilZBzvSF/ OQwQT2AhjYYyGplBxcfd8EZGdSFj74pgKQyA1mbJW3xqFq+KBBToo6ieMJ3W8sXzkY5O MmhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698245168; x=1698849968; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7fCndReggPj8sG1syb2HDBs4AgKt0DkohlqpGAodX1o=; b=CH1ihASnaJxUQD00mL+M6kzCLXmwCVkFeD5uRzCJk1J3eSRigMpJwbo0zbOUUuj3rH NUgKLSaRmy7RBydxMFnYHkEX6w00kYKGbo/SJNzMElmxKS2nYIeoFrRd0CSD7I7I84g9 qLNuoyKXPIKr1/wjx8hJsg0F8cVBQCyaZbhT3AmwN62WZrIBedlFC6KVDpUGM0TLubGf 77dfnzICkZElqLs8MMLy89v2wNLPNnnmNjW2u24Ipv/8D0RhBhkA313K9L79ea2vA0nW wOyPtw/tL9Sq6Kq43h0bQcFsCqO/edpHhEUk4V3sC9YB4hkzoqtBwgOJbQ591Ldn2yPp 3KnQ== X-Gm-Message-State: AOJu0Yx0zad9/gMOCFIqvQhI2/n6q6lytj19uDfeM0K0n0nwFMhvV/4Q 2Ab0YtGKG80RiOY8NqpKKlvzLw== X-Google-Smtp-Source: AGHT+IFNwe40aLcfWcgRqBNwoh4xuwRuxRmryBZCAYASICKbNwYeSIEIxBm3Mc2QFFfX2zJNfG3p9w== X-Received: by 2002:a19:7419:0:b0:4fd:c715:5667 with SMTP id v25-20020a197419000000b004fdc7155667mr10143878lfe.20.1698245168251; Wed, 25 Oct 2023 07:46:08 -0700 (PDT) Received: from krzk-bin.. ([178.197.218.126]) by smtp.gmail.com with ESMTPSA id i1-20020a05600011c100b0032dcb08bf94sm12267138wrx.60.2023.10.25.07.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 07:46:07 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/3] soundwire: qcom: drop unneeded DAI .set_stream callback Date: Wed, 25 Oct 2023 16:45:59 +0200 Message-Id: <20231025144601.268645-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: 2F5PIXPHSX7DAVN3HNJM6BFKW6TZEFXK X-Message-ID-Hash: 2F5PIXPHSX7DAVN3HNJM6BFKW6TZEFXK X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Qualcomm Soundwire controller drivers do not support multi-link setups, so DAI .set_stream() callback will not be used. What's more, if called it will overwrite the sdw_stream_runtime runtime set in DAI .startup (qcom_swrm_startup()) causing issues (unsupported multi-link error) when two Soundwire controllers are passed as codec DAIs. Signed-off-by: Krzysztof Kozlowski --- drivers/soundwire/qcom.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index f1b8d6ac5140..fe65c26c5281 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -1267,16 +1267,6 @@ static int qcom_swrm_hw_free(struct snd_pcm_substream *substream, return 0; } -static int qcom_swrm_set_sdw_stream(struct snd_soc_dai *dai, - void *stream, int direction) -{ - struct qcom_swrm_ctrl *ctrl = dev_get_drvdata(dai->dev); - - ctrl->sruntime[dai->id] = stream; - - return 0; -} - static void *qcom_swrm_get_sdw_stream(struct snd_soc_dai *dai, int direction) { struct qcom_swrm_ctrl *ctrl = dev_get_drvdata(dai->dev); @@ -1349,7 +1339,6 @@ static const struct snd_soc_dai_ops qcom_swrm_pdm_dai_ops = { .hw_free = qcom_swrm_hw_free, .startup = qcom_swrm_startup, .shutdown = qcom_swrm_shutdown, - .set_stream = qcom_swrm_set_sdw_stream, .get_stream = qcom_swrm_get_sdw_stream, }; From patchwork Wed Oct 25 14:46:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 738351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D13EFC07545 for ; Wed, 25 Oct 2023 14:48:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 477E2850; Wed, 25 Oct 2023 16:47:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 477E2850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1698245282; bh=1bed6+cvhg2e4+Wu0/xzpBi6Pr945mwQB22eQdy+JDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=mqP+eKNLiaLNwaxbRbfrzP0xqwIjMXgVa/cSo5whXUjIxkGUKqs6zNxMK6vs10vLg lpmn9YcZrBaSUy0gGZ6uWsRkL9bZnsnnfR2azU6vOSF5G3a0GpnhCZsf4fjqiCa3DH KelDTdr7d/UGW2/fUeu6AWYGt5yvaIxPWy9aH1Vs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 884C4F8055C; Wed, 25 Oct 2023 16:46:23 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id AEA6EF8055B; Wed, 25 Oct 2023 16:46:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6A78F8019B; Wed, 25 Oct 2023 16:46:17 +0200 (CEST) Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 453CDF8010B for ; Wed, 25 Oct 2023 16:46:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 453CDF8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=q22y2hxr Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-5079f9675c6so9043636e87.2 for ; Wed, 25 Oct 2023 07:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698245170; x=1698849970; darn=alsa-project.org; 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=UXAGRRDQU3qBmM4PuKRmO3omKxsrPu1G2pV7PjgXi9w=; b=q22y2hxrAbc90kn6RBMY3KuTKB4tt8fNugfh/7vbymMqWwR07XlUuWoXQPsZwoK8Hl MvZ6B7hHwejFVVpqiLkhNvE5kC2Dw+ylPXUTES7K2gVrDcvzbj2HCMl/ay4llBsM/TUJ vl90ScXQhhbG2BW99PdcPhnv6WPAM6iFYvKSaDs7cfUGNoQ8sCurmIEhUcwWPcCDNBXq ZiUNBS2BA0hxM/VCq1aBTqAnOQutSUM2/1RTbGH6ZGY6j0uZFJl5tH4bkr+UkcEQ5g0B N8X52upRVfYmd/upcpLGMS+5k/X9LP/69uXuMzq5th6UvdmCpHLyuD+fmKD1m38p4opS uTNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698245170; x=1698849970; 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=UXAGRRDQU3qBmM4PuKRmO3omKxsrPu1G2pV7PjgXi9w=; b=no0JsdQVZthRDLxIfPMIPAEa7uOe9xO6eODdKV08/WpuHSU3g92oRJcJFSXKQWOby6 O767DeB6i2RmVAnI9BN7yKYtEaSo39bXHUG9p9oMXUctPP4sxl1RCYrHclcBW3ZJAbtO +TOzUrdkmZUr+8qlXvB0mQxsZpN6Ary/mFzXxBML0jow8dUizv22BYRqqYF80dd4pQV5 JXk2OEuT3K2BJTyBjHUrZGQixIeszSquOUl5mnD3i7yc22NDEAVMMhY9wvNfvsU9yOzb q+bEM5+Beh1uJEkY6kUxf91/1T698m627MHrhzzP7DIieQhd2fCWUbqYQxvXkH839Tu7 fqPg== X-Gm-Message-State: AOJu0YxUjEcv9N/GFLL7UpCSoH/GnKPGdOyQciO1CYWMagfS++c3CvvA Hkvn3HGCFQGmdtI3tDKzLEcH0Q== X-Google-Smtp-Source: AGHT+IEm+oG84DNxepaw/B3zgRVBOqJdqjjLvSed6FNsaPOPc1JSYQPpe7VYHi0f4Xg01yt26Oo5fg== X-Received: by 2002:ac2:597a:0:b0:507:9623:8ae8 with SMTP id h26-20020ac2597a000000b0050796238ae8mr11125024lfp.29.1698245169886; Wed, 25 Oct 2023 07:46:09 -0700 (PDT) Received: from krzk-bin.. ([178.197.218.126]) by smtp.gmail.com with ESMTPSA id i1-20020a05600011c100b0032dcb08bf94sm12267138wrx.60.2023.10.25.07.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 07:46:09 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/3] soundwire: qcom: set owner device of runtime stream Date: Wed, 25 Oct 2023 16:46:00 +0200 Message-Id: <20231025144601.268645-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231025144601.268645-1-krzysztof.kozlowski@linaro.org> References: <20231025144601.268645-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: GXGY3ZJTAVT3GEWDTBFVGIBDEA4KMD45 X-Message-ID-Hash: GXGY3ZJTAVT3GEWDTBFVGIBDEA4KMD45 X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Srinivas Kandagatla Store the pointer to struct device of Soundwire controller owning this runtime stream. This can be later used by Soundwire devices, to check if their DAI prepare callback is called for the same bus, in cases where multiple Soundwire buses are used in same soundcard codec list. Signed-off-by: Srinivas Kandagatla Co-developed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski --- drivers/soundwire/qcom.c | 1 + include/linux/soundwire/sdw.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index fe65c26c5281..a95f39563b47 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -1298,6 +1298,7 @@ static int qcom_swrm_startup(struct snd_pcm_substream *substream, goto err_alloc; } + sruntime->dev = ctrl->bus.dev; ctrl->sruntime[dai->id] = sruntime; for_each_rtd_codec_dais(rtd, i, codec_dai) { diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 4f3d14bb1538..650334adc261 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -1023,6 +1023,7 @@ struct sdw_stream_params { * master_list can contain only one m_rt per Master instance * for a stream * @m_rt_count: Count of Master runtime(s) in this stream + * @dev: SoundWire controller owning this runtime stream */ struct sdw_stream_runtime { const char *name; @@ -1031,6 +1032,7 @@ struct sdw_stream_runtime { enum sdw_stream_type type; struct list_head master_list; int m_rt_count; + struct device *dev; }; struct sdw_stream_runtime *sdw_alloc_stream(const char *stream_name); From patchwork Wed Oct 25 14:46:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 737872 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 16143C07545 for ; Wed, 25 Oct 2023 14:48:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1754B852; Wed, 25 Oct 2023 16:47:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1754B852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1698245290; bh=BJb3NXnYIcyJzT8iGhsCD5K0T53wiU/3E3qgC6c41f4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bmQuwsyw9NPLLiITULE18HuXeN3rjQ7xiph5b+rULVJczMl/GfWrxt0btHazp1VXR v50GPtL4C5ccclRBbOLuvQDvAoqtC/PmryvMTkmH0zSl/DVTpoo9gTOlowCVH7AS7i Lc8YaGN1aBeDTf0Qd2rSXLR2wwoOwvbcn1NxyDt0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 878AAF80578; Wed, 25 Oct 2023 16:46:24 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 48F14F80578; Wed, 25 Oct 2023 16:46:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16D85F80165; Wed, 25 Oct 2023 16:46:19 +0200 (CEST) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 67C54F8012B for ; Wed, 25 Oct 2023 16:46:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 67C54F8012B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jjJNLaJr Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-32daeed7771so3806814f8f.3 for ; Wed, 25 Oct 2023 07:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698245173; x=1698849973; darn=alsa-project.org; 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=NSOu9HyrCio0gozoTkpNTmqH+O6Zq1CFoJPsJwIyKFk=; b=jjJNLaJrlyo/uc2zpB2WuNZMGQnu+m2idY5X7Ef3O8nu61wfPWG4yehful8QH++x8h k5FfACnKSQlzCpz8ZVXKDnigMtK/0eBS/gF7s7/rVErKzNx1uqyR+gOMbKGysoUDRcWo VmxrLjvM9ekIIWUlvwmb5cCuY2wOBt86Kcw2Sh0vUrleD9SMN3QW242mBZVfDhVpMMvt o29ctj27OvE/4T1jb5sTGm40YOcx47M8gE/n9qzU5sUCxISC4vCDXXF2mOlqFee5Qoeq vneNL9uyrqK+CNSoZ9a9nFkHaHsgwPJHDt+nkx0feMiLH2ieCaW3XIfMvdePXvkfPMcE /cBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698245173; x=1698849973; 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=NSOu9HyrCio0gozoTkpNTmqH+O6Zq1CFoJPsJwIyKFk=; b=QhtQmfc6zbNAuh/cw3QIR84B97k+//YKK8V8wdV0iTx2YdiAeosvAc4D3S3i3ODcMT b5lJf6+plUile28hEhktilRDASTh1Ka+Baqu/tnVjJABGGI0Upme7pQ0cdMaZg+TN3Yj 45r51F9LK9nxM/UIsw9C0UNRjHJYomBCktfcfFenrFp4sNJbukVeiW/F2c8fOlGJDiGZ /AY/7enppcPoM3OmkQVSyetO5JHd6sLuT8NMNeV+eN5S9JNtfKR7yfBjRQOKcts7gnfG j5TUODYNMcgA+Gd2Soalj68kBRJ4gHJh2FFtscVhLHTjGcOcWdW4WMPBaIEFjvVcGNM9 747w== X-Gm-Message-State: AOJu0YyBas2nFJNjeLWi2KxLjgGAxA2JDHw020InmiRwF5QblgTTYnTI DlJzODJFsrDsCAzrP97X6RiTJg== X-Google-Smtp-Source: AGHT+IEdhXacG3VtzhyUIJTLoFxeWnvtOMaJOeURJsu1+71zwQaYKeffXLMAW2rDPpUPUPrcyoQKDw== X-Received: by 2002:adf:f711:0:b0:32d:b051:9a2b with SMTP id r17-20020adff711000000b0032db0519a2bmr11838769wrp.2.1698245172872; Wed, 25 Oct 2023 07:46:12 -0700 (PDT) Received: from krzk-bin.. ([178.197.218.126]) by smtp.gmail.com with ESMTPSA id i1-20020a05600011c100b0032dcb08bf94sm12267138wrx.60.2023.10.25.07.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 07:46:12 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 3/3] ASoC: codecs: wsa884x: check if set_stream is called for proper bus Date: Wed, 25 Oct 2023 16:46:01 +0200 Message-Id: <20231025144601.268645-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231025144601.268645-1-krzysztof.kozlowski@linaro.org> References: <20231025144601.268645-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: X5ATZ3IV6JE7YZGERP7RGBWWLUN2CE65 X-Message-ID-Hash: X5ATZ3IV6JE7YZGERP7RGBWWLUN2CE65 X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Srinivas Kandagatla If multiple WSA8840 speakers, from two separate Soundwire buses, are used in one codec DAI link, the set_stream() should ignore calls for setting stream from other Soundwire controller. Signed-off-by: Srinivas Kandagatla Co-developed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wsa884x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c index bee6e763c700..91205e8c96f1 100644 --- a/sound/soc/codecs/wsa884x.c +++ b/sound/soc/codecs/wsa884x.c @@ -1775,6 +1775,12 @@ static int wsa884x_set_stream(struct snd_soc_dai *dai, void *stream, int direction) { struct wsa884x_priv *wsa884x = dev_get_drvdata(dai->dev); + struct sdw_stream_runtime *sruntime = stream; + struct sdw_slave *sdw = dev_to_sdw_dev(dai->dev); + + /* Check if this belongs to same bus */ + if (sdw->bus->dev != sruntime->dev) + return 0; wsa884x->sruntime = stream;