[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <11e09282-186b-43bd-b7ef-a179a4fe8f03@linaro.org>
Date: Thu, 23 Nov 2023 10:50:21 +0000
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
alsa-devel@...a-project.org
Cc: tiwai@...e.de, broonie@...nel.org, vkoul@...nel.org,
gregkh@...uxfoundation.org,
Bard liao <yung-chuan.liao@...ux.intel.com>,
Jaroslav Kysela <perex@...ex.cz>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Philippe Ombredanne <pombredanne@...b.com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Vijendar Mukunda <Vijendar.Mukunda@....com>
Subject: Re: [RFC PATCH 1/2] soundwire: bus: introduce controller_id
Thanks Pierre for the patch,
On 17/10/2023 17:09, Pierre-Louis Bossart wrote:
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index 55be9f4b8d59..e3ae4e4e07ac 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -1612,6 +1612,9 @@ static int qcom_swrm_probe(struct platform_device *pdev)
> }
> }
>
> + /* FIXME: is there a DT-defined value to use ? */
> + ctrl->bus.controller_id = -1;
> +
We could do a better than this, on Qcom IP we have a dedicated register
to provide a master id value. I will send a patch to add this change on
top of this patchset.
--------------------------------->cut<-------------------------------
From 78c516995d652324daadbe848fa787dabcede73f Mon Sep 17 00:00:00 2001
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Date: Thu, 23 Nov 2023 10:43:02 +0000
Subject: [PATCH] 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@...aro.org>
---
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
--------------------------------->cut<-------------------------------
thanks,
Srini
> ret = sdw_bus_master_add(&ctrl->bus, dev, dev->fwnode);
> if (ret) {
> dev_err(dev, "Failed to register Soundwire controller (%d)\n",
Powered by blists - more mailing lists