From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Vinod Koul <vkoul@kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Sanyog Kale <sanyog.r.kale@intel.com>,
linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Mark Brown <broonie@kernel.org>
Subject: [PATCH RESEND] soundwire: qcom: allow multi-link on newer devices
Date: Wed, 3 Apr 2024 15:27:16 +0200 [thread overview]
Message-ID: <20240403132716.325880-1-krzysztof.kozlowski@linaro.org> (raw)
Newer Qualcomm SoCs like X1E80100 might come with four speakers spread
over two Soundwire controllers, thus they need a multi-link Soundwire
stream runtime.
Cc: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Almost four months, so let's resend this one. Add Rb tag.
---
drivers/soundwire/qcom.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index 82b3ca5a405a..a97412c8671e 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -920,6 +920,18 @@ static int qcom_swrm_init(struct qcom_swrm_ctrl *ctrl)
return 0;
}
+static int qcom_swrm_read_prop(struct sdw_bus *bus)
+{
+ struct qcom_swrm_ctrl *ctrl = to_qcom_sdw(bus);
+
+ if (ctrl->version >= SWRM_VERSION_2_0_0) {
+ bus->multi_link = true;
+ bus->hw_sync_min_links = 3;
+ }
+
+ return 0;
+}
+
static enum sdw_command_response qcom_swrm_xfer_msg(struct sdw_bus *bus,
struct sdw_msg *msg)
{
@@ -1078,6 +1090,7 @@ static const struct sdw_master_port_ops qcom_swrm_port_ops = {
};
static const struct sdw_master_ops qcom_swrm_ops = {
+ .read_prop = qcom_swrm_read_prop,
.xfer_msg = qcom_swrm_xfer_msg,
.pre_bank_switch = qcom_swrm_pre_bank_switch,
.post_bank_switch = qcom_swrm_post_bank_switch,
@@ -1196,6 +1209,15 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
mutex_lock(&ctrl->port_lock);
list_for_each_entry(m_rt, &stream->master_list, stream_node) {
+ /*
+ * For streams with multiple masters:
+ * Allocate ports only for devices connected to this master.
+ * Such devices will have ports allocated by their own master
+ * and its qcom_swrm_stream_alloc_ports() call.
+ */
+ if (ctrl->bus.id != m_rt->bus->id)
+ continue;
+
if (m_rt->direction == SDW_DATA_DIR_RX) {
maxport = ctrl->num_dout_ports;
port_mask = &ctrl->dout_port_mask;
--
2.34.1
next reply other threads:[~2024-04-03 13:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 13:27 Krzysztof Kozlowski [this message]
2024-04-05 11:25 ` [PATCH RESEND] soundwire: qcom: allow multi-link on newer devices Vinod Koul
2024-04-05 11:54 ` Vinod Koul
2024-04-05 14:41 ` Krzysztof Kozlowski
2024-04-11 17:48 ` Vinod Koul
2024-04-12 4:46 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240403132716.325880-1-krzysztof.kozlowski@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=andersson@kernel.org \
--cc=broonie@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).