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);