summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2023-11-23 13:53:32 +0300
committerVinod Koul <vkoul@kernel.org>2023-11-24 09:56:26 +0300
commita7ae05ef356162c2a7ff108a7ff154d7d0dcd6aa (patch)
tree5d59022064046f94ab7272c4cef8dfafaa5be899 /drivers
parent8a8a9ac8a4972ee69d3dd3d1ae43963ae39cee18 (diff)
downloadlinux-a7ae05ef356162c2a7ff108a7ff154d7d0dcd6aa.tar.xz
soundwire: qcom: set controller id to hw master id
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> Link: https://lore.kernel.org/r/20231123105332.102167-1-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/soundwire/qcom.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index 7f8549aab42f..d869e2276815 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -1620,9 +1620,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",