2023-11-23 10:56:40

by Srinivas Kandagatla

[permalink] [raw]
Subject: [PATCH] soundwire: qcom: set controller id to hw master id

From: Srinivas Kandagatla <[email protected]>

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 <[email protected]>
---

This patch depends on "[RFC PATCH 0/2] soundwire: introduce
controller ID"
https://lore.kernel.org/lkml/[email protected]/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


2023-11-23 11:54:22

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH] soundwire: qcom: set controller id to hw master id

On 23/11/2023 11:53, [email protected] wrote:
> From: Srinivas Kandagatla <[email protected]>
>
> 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 <[email protected]>
> ---
>


Reviewed-by: Krzysztof Kozlowski <[email protected]>
Tested-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2023-11-24 06:59:06

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH] soundwire: qcom: set controller id to hw master id


On Thu, 23 Nov 2023 10:53:32 +0000, [email protected] 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