mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soundwire: qcom: set controller id to hw master id
@ 2023-11-23 10:53 srinivas.kandagatla
  2023-11-23 11:53 ` Krzysztof Kozlowski
  2023-11-24  6:58 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: srinivas.kandagatla @ 2023-11-23 10:53 UTC (permalink / raw)
  To: alsa-devel, vkoul
  Cc: broonie, perex, tiwai, yung-chuan.liao, linux-kernel,
	pierre-louis.bossart, krzysztof.kozlowski, Srinivas Kandagatla

From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

Qualcomm Soundwire Controllers IP version after 1.3 have a dedicated
master id register which will provide a unique id value for each
controller instance. Use this value instead of artificially generated
value from idr. Versions 1.3 and below only have one instance of
soundwire controller which does no have this register, so let them use
value from idr.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---

This patch depends on "[RFC PATCH 0/2] soundwire: introduce
controller ID"
https://lore.kernel.org/lkml/4815c8d6-635d-415c-9e02-4e39e92a3d6d@sirena.org.uk/T/
patchset.


 drivers/soundwire/qcom.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index 8e027eee8b73..48291fbaf674 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -1624,9 +1624,13 @@ static int qcom_swrm_probe(struct platform_device *pdev)
 		}
 	}
 
-	/* FIXME: is there a DT-defined value to use ? */
 	ctrl->bus.controller_id = -1;
 
+	if (ctrl->version > SWRM_VERSION_1_3_0) {
+		ctrl->reg_read(ctrl, SWRM_COMP_MASTER_ID, &val);
+		ctrl->bus.controller_id = val;
+	}
+
 	ret = sdw_bus_master_add(&ctrl->bus, dev, dev->fwnode);
 	if (ret) {
 		dev_err(dev, "Failed to register Soundwire controller (%d)\n",
-- 
2.42.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] soundwire: qcom: set controller id to hw master id
  2023-11-23 10:53 [PATCH] soundwire: qcom: set controller id to hw master id srinivas.kandagatla
@ 2023-11-23 11:53 ` Krzysztof Kozlowski
  2023-11-24  6:58 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2023-11-23 11:53 UTC (permalink / raw)
  To: srinivas.kandagatla, alsa-devel, vkoul
  Cc: broonie, perex, tiwai, yung-chuan.liao, linux-kernel,
	pierre-louis.bossart

On 23/11/2023 11:53, srinivas.kandagatla@linaro.org wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> 
> Qualcomm Soundwire Controllers IP version after 1.3 have a dedicated
> master id register which will provide a unique id value for each
> controller instance. Use this value instead of artificially generated
> value from idr. Versions 1.3 and below only have one instance of
> soundwire controller which does no have this register, so let them use
> value from idr.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> 


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] soundwire: qcom: set controller id to hw master id
  2023-11-23 10:53 [PATCH] soundwire: qcom: set controller id to hw master id srinivas.kandagatla
  2023-11-23 11:53 ` Krzysztof Kozlowski
@ 2023-11-24  6:58 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2023-11-24  6:58 UTC (permalink / raw)
  To: alsa-devel, srinivas.kandagatla
  Cc: broonie, perex, tiwai, yung-chuan.liao, linux-kernel,
	pierre-louis.bossart, krzysztof.kozlowski


On Thu, 23 Nov 2023 10:53:32 +0000, srinivas.kandagatla@linaro.org wrote:
> Qualcomm Soundwire Controllers IP version after 1.3 have a dedicated
> master id register which will provide a unique id value for each
> controller instance. Use this value instead of artificially generated
> value from idr. Versions 1.3 and below only have one instance of
> soundwire controller which does no have this register, so let them use
> value from idr.
> 
> [...]

Applied, thanks!

[1/1] soundwire: qcom: set controller id to hw master id
      commit: a7ae05ef356162c2a7ff108a7ff154d7d0dcd6aa

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-24  6:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-23 10:53 [PATCH] soundwire: qcom: set controller id to hw master id srinivas.kandagatla
2023-11-23 11:53 ` Krzysztof Kozlowski
2023-11-24  6:58 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®